A Model Context Protocol server for CAP development.
It's in an alpha state.
The server is supposed to help AI models answer questions like
- Which CDS services are there in this project and where are they served?
- What are the entities about?
- How do they relate?
git clone https://github.com/cap-js/cds-mcp
cd cds-mcp
npm install
npm i -g @cap-js/cds-mcp@.
Configure your MCP Client (Cline, Codex, opencode, etc.) to use the server with command cds-mcp
.
It is strongly recommended to use an API docs provider, like context7
, to get the best results.
The library ID for CAP in context7
is /context7/cap_cloud_sap
.
The following rules help to guide the LLM to use the servers correctly:
- You MUST search for CDS definitions, like entities, fields and services with the MCP server `cds`, only if it fails you MAY read \*.cds files in the project.
- Whenever you want to execute OData requests to the running CAP app, you must first search the cds definition `search_cds_definition` to retrieve the service entity (not the db entity), which contains info about the endpoint
- Whenever you start the cds app, e.g. using `cds serve`, it must be done in the background and afterwards you must check that it runs.
- You MUST consult context7 (library id: `/context7/cap_cloud_sap`) for documentation and guidance EVERY TIME you modify CDS models. Do NOT propose, suggest or make any CDS changes without first checking context7.
- You MUST consult context7 (library id: `/context7/cap_cloud_sap`) for documentation and guidance EVERY TIME you use APIs from SAP Cloud Application Programming Model (CAP). Do NOT propose, suggest or make any CDS changes without first checking context7.
Caution
At SAP, MCP in VS Code seems to be centrally disabled at the moment. Error is: Unable to write chat.mcp.enabled because it is configured in system policy.
Register the server once: run command MCP: Add Server...
. In there:
- Select
command
. - Set
cds-mcp
as command.
In an application project, open the Chat panel. Select the server through the Select tools button.
See the VS Code docs for more.
Usage in opencode
Use the following configuration in ~/.config/opencode/opencode.json, it's recommended to use an API docs provider, like context7
:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"cds": {
"type": "local",
"command": ["cds-mcp"],
"enabled": true,
"environment": {}
},
"context7": {
"type": "local",
"command": ["context7-mcp"],
"enabled": true,
"environment": {}
}
}
}
Don't forget to add the rules to ~/.config/opencode/AGENTS.md, or in your project-specific AGENTS.md file.
You can test the server with the MCP Inspector tool:
cd cds-mcp
npx @modelcontextprotocol/inspector node index.js <projectRoot>
See the MCP Inspector docs for more.