Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and more.
git clone https://github.com/cap-js/cds-mcp
cd cds-mcp
npm install
npm i -g @cap-js/cds-mcp@.
```

## Usage in VS Code
Expand All @@ -44,6 +45,40 @@ Select the server through the _Select tools_ button.

See the [VS Code docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more.

## Usage in [opencode](https://github.com/sst/opencode)

Use the following configuration in ~/.config/opencode/opencode.json, it's recommended to use an API docs provider, like `context7`:

```json
{
"$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": {}
}
}
}
```

It's useful to add the following rules to your ~/.config/opencode/AGENTS.md:

```markdown
- 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
- 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.
- 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.
```

## Usage in MCP Inspector

You can test the server with the _MCP Inspector tool_:
Expand Down