Skip to content

cap-js/mcp

About this project

This is a protocol adapter for the MCP protocol to expose CAP services for agent consumption. For more information, check the official documentation.

Requirements and Setup

We use the @capire/bookshop as a running sample hereinafter. Clone it and open it in VSCode as follows:

git clone https://github.com/capire/bookshop
code bookshop

Feature Flags

All configuration lives under cds.mcp in your package.json:

{
  "cds": {
    "mcp": {
      "per_action_tool": false,
      "toon_format": true
    }
  }
}
Flag Default Description
per_action_tool false Expose each action/function as its own dedicated tool instead of the generic call_action tool.
toon_format true Return query results in TOON format. Set to false to use JSON instead.
prefix false Prefix tool names with the slugified service name to avoid collisions when a MCP client connects to multiple MCP servers (e.g. catalog_query, admin_describe).

For all other configuration options, refer to the official documentation.

Custom Server Instructions

You can customize the MCP server instructions sent to agents during initialization using the @mcp.instructions annotation:

annotate MyService with @mcp.instructions: 'Use describe to explore the product catalog. Use query to search products by name or category.';

If not set, a default instruction is used. The annotation also supports i18n references ({i18n>key}).

Support, Feedback, Contributing

This project is open to feature requests/suggestions, bug reports etc. via GitHub issues. Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines.

Security / Disclosure

If you find any bug that may be a security problem, please follow the instructions found in our security policy on how to report it. Please do not create GitHub issues for security-related doubts or problems.

Code of Conduct

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its Code of Conduct at all times.

Licensing

Copyright 2026 SAP SE or an SAP affiliate company and cap-js/mcp contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.

About

CAP plugin to expose services over MCP for AI agent consumption.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

11 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors