You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See [Getting Started](https://cap.cloud.sap/docs/get-started) on how to jumpstart your development and grow as you go with SAP Cloud Application Programming Model.
49
+
50
+
51
+
52
+
## Setup
53
+
54
+
```sh
55
+
npm i -g @cap-js/mcp-server
56
+
```
57
+
58
+
This will provide the command `cds-mcp` to start the CAP MCP server.
59
+
60
+
17
61
18
62
## Available Tools
19
63
64
+
> [!NOTE]
65
+
> Tools are meant to be used by AI models and do not constitute a stable API.
66
+
20
67
The server provides these tools for CAP development:
21
68
22
69
### `search_model`
23
70
24
-
Search for CDS definitions (entities, services, actions) including:
25
-
71
+
Search for CDS definitions (entities, services, actions), including:
Configure your MCP client (Cline, opencode, Claude Code, etc.) to start the server using the `cds-mcp` command.
88
+
89
+
The following rules help the LLM use the server correctly:
90
+
91
+
```markdown
92
+
- You MUST search for CDS definitions, like entities, fields and services (which include HTTP endpoints) with cds-mcp, only if it fails you MAY read \*.cds files in the project.
93
+
- You MUST search for CAP docs with cds-mcp EVERY TIME you modify CDS models or when using APIs from CAP. Do NOT propose, suggest or make any changes without first checking it.
42
94
```
43
95
44
-
This will provide the command `cds-mcp` to start the CAP MCP server.
96
+
Add these rules to your existing global or project-specific [`AGENTS.md`](https://agents.md/) (specifics may vary based on respective MCP client).
45
97
46
-
## Usage
98
+
###Usage in VS Code
47
99
48
-
Configure your MCP client (Claude Code, opencode, and so on) to start the server with command `cds-mcp`.
100
+
Example for VS Code extension [Cline](https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev):
101
+
```json
102
+
{
103
+
"mcpServers": {
104
+
"cds-mcp": {
105
+
"command": "cds-mcp",
106
+
"args": [],
107
+
"env": {}
108
+
}
109
+
}
110
+
}
111
+
```
49
112
50
-
Example for opencode:
113
+
See [VS Code Marketplace](https://marketplace.visualstudio.com/search?term=tag%3Aagent&target=VSCode&category=All%20categories&sortBy=Relevance) for more agent extensions.
51
114
115
+
### Usage in opencode
116
+
117
+
Example for [opencode](https://github.com/sst/opencode):
52
118
```json
53
119
{
54
120
"mcp": {
@@ -61,16 +127,9 @@ Example for opencode:
61
127
}
62
128
```
63
129
64
-
The following rules help guide the LLM to use the server correctly:
65
-
66
-
```markdown
67
-
- You MUST search for CDS definitions, like entities, fields and services (which include HTTP endpoints) with cds-mcp, only if it fails you MAY read \*.cds files in the project.
68
-
- You MUST search for CAP docs with cds-mcp EVERY TIME you modify CDS models or when using APIs from CAP. Do NOT propose, suggest or make any changes without first checking it.
69
-
```
70
-
71
130
### CLI Usage
72
131
73
-
You can also use the tools directly from the command line:
132
+
For experimental purposes, you can also use the tools directly from the command line:
cds-mcp search_docs "how to add columns to a select statement in CAP Node.js" 1
81
140
```
82
141
142
+
143
+
83
144
## How It Works
84
145
85
-
The server provides two complementary search mechanisms optimized for different use cases:
146
+
The server provides two complementary search mechanisms, optimized for different use cases:
86
147
87
148
### `search_model` - Compiled Model Search
88
149
89
-
This tool performs fuzzy search against the compiled CDS model (CSN - Core Schema Notation). When you run a CAP project, CDS compiles all your `.cds` files into a unified model representation that includes:
90
-
150
+
This tool performs fuzzy searches against the compiled CDS model (CSN - Core Schema Notation).
151
+
When you run a CAP project, CDS compiles all your `.cds` files into a unified model representation that includes:
91
152
- All entities, services, actions, and their relationships
92
153
- Resolved annotations and metadata
93
154
- Generated HTTP endpoints and OData URLs
@@ -97,30 +158,40 @@ The fuzzy search algorithm matches definition names and allows for partial match
This tool uses vector embeddings to search through preprocessed CAP documentation content stored locally. The process works as follows:
161
+
This tool uses vector embeddings to search through preprocessed CAP documentation stored locally. The process works as follows:
162
+
163
+
1.**Pre-processing:** CAP documentation is split into semantic sections and converted to vector embeddings using a local embedding model.
164
+
2.**Query processing:** Your search query is also converted to an embedding vector.
165
+
3.**Similarity search:** The system finds documentation chunks with the highest semantic similarity to your query.
166
+
167
+
This semantic search approach enables you to find relevant documentation even when your query does not use the exact keywords found in the docs.
101
168
102
-
1.**Pre-processing**: CAP documentation is chunked into semantic sections and converted to vector embeddings using a local embedding model.
103
-
2.**Query processing**: Your search query is also converted to an embedding vector.
104
-
3.**Similarity search**: The system finds documentation chunks with the highest semantic similarity to your query.
105
169
106
-
This approach enables semantic search - you can find relevant documentation even when your query doesn't contain exact keywords from the docs.
107
170
108
171
## Support, Feedback, Contributing
109
172
110
173
This project is open to feature requests/suggestions, bug reports, and so on, via [GitHub issues](https://github.com/cap-js/mcp-server/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](CONTRIBUTING.md).
111
174
175
+
176
+
112
177
## Security / Disclosure
113
178
114
179
If you find any bug that may be a security problem, please follow our instructions at [in our security policy](https://github.com/cap-js/mcp-server/security/policy) on how to report it. Please don't create GitHub issues for security-related doubts or problems.
115
180
181
+
182
+
116
183
## Code of Conduct
117
184
118
185
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](https://github.com/cap-js/.github/blob/main/CODE_OF_CONDUCT.md) at all times.
119
186
187
+
188
+
120
189
## Licensing
121
190
122
191
Copyright 2025 SAP SE or an SAP affiliate company and @cap-js/cds-mcp contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/cap-js/mcp-server).
123
192
193
+
194
+
124
195
## Acknowledgments
125
196
126
197
-**onnxruntime-web** is used for creating embeddings in Node.js.
0 commit comments