Skip to content

Commit 9be2c58

Browse files
committed
Merge branch 'main' into prep-v0.0.1
2 parents 4547839 + efd14ed commit 9be2c58

31 files changed

+2596
-41751
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v2
18-
- run: npm i
18+
- name: Use Node.js 22.x
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: 22.x
22+
- run: npm ci
1923
- run: npm run lint
2024
test:
2125
runs-on: ubuntu-latest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
models/
2+
embeddings/
13
node_modules/

CONTRIBUTING.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,4 @@
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201201
limitations under the License.
202+

LICENSES/Apache-2.0.txt

Lines changed: 0 additions & 73 deletions
This file was deleted.

README.md

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,40 @@
11
# Welcome to @cap-js/mcp-server
22

3-
[![REUSE status](https://api.reuse.software/badge/github.com/cap-js/mcp-server)](https://api.reuse.software/info/github.com/cap-js/mcp-server)
4-
53
> [!WARNING]
64
> Alpha!
75
86
## About this project
97

10-
MCP server for SAP Cloud Application Programming Model (`@cap-js/mcp-server`) is a Model Context Protocol server for AI-assisted development (_vibe coding_) of CAP applications.
8+
MCP server for SAP Cloud Application Programming Model (`@cap-js/mcp-server`) is a Model Context Protocol server for AI-assisted development (_agentic coding_) with CAP applications.
119

12-
The server is supposed to help AI models answer questions like
10+
The server helps AI models answer questions like:
1311

1412
- _Which CDS services are there in this project and where are they served?_
1513
- _What are the entities about?_
1614
- _How do they relate?_
15+
- _How do I add columns to a select statement in CAP Node.js?_
16+
17+
## Available Tools
18+
19+
The server provides two main tools for CAP development:
20+
21+
### `search_model`
22+
23+
Search for CDS definitions (entities, services, actions) including:
1724

18-
## Requirements
25+
- Model structure and relationships
26+
- Annotations and metadata
27+
- HTTP endpoints and OData URLs
28+
- File locations
1929

20-
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.
30+
### `search_docs`
31+
32+
Search CAP documentation for:
33+
34+
- Code snippets and examples
35+
- API usage patterns
36+
- Best practices
37+
- Implementation guides
2138

2239
## Setup
2340

@@ -30,14 +47,26 @@ npm i -g @cap-js/mcp-server@.
3047

3148
## Usage
3249

33-
Configure your MCP Client (Cline, Codex, opencode, etc.) to use the server with command `cds-mcp`.
34-
The following rules help to guide the LLM to use the servers correctly:
50+
Configure your MCP client (Cline, Codex, opencode, etc.) to use the server with command `cds-mcp`.
51+
The following rules help guide the LLM to use the server correctly:
3552

3653
```markdown
3754
- 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.
3855
- 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.
3956
```
4057

58+
### CLI Usage
59+
60+
You can also use the tools directly from the command line:
61+
62+
```sh
63+
# Search for CDS model definitions
64+
cds-mcp search_model . Books entity
65+
66+
# Search CAP documentation
67+
cds-mcp search_docs "how to add columns to a select statement in CAP Node.js"
68+
```
69+
4170
### Usage in VS Code
4271

4372
**Register the server** once: run command `MCP: Add Server...`.
@@ -76,24 +105,40 @@ Don't forget to add the rules to `~/.config/opencode/AGENTS.md`, or in your proj
76105
You can test the server with the _MCP Inspector tool_:
77106

78107
```sh
79-
cd mcp-server
80-
npx @modelcontextprotocol/inspector node index.js <projectRoot>
108+
npx @modelcontextprotocol/inspector cds-mcp <projectRoot>
81109
```
82110

83111
See the [MCP Inspector docs](https://modelcontextprotocol.io/docs/tools/inspector) for more.
84112

85-
## Support, Feedback, Contributing
113+
## How It Works
114+
115+
The server provides two complementary search mechanisms optimized for different use cases:
116+
117+
### `search_model` - Compiled Model Search
118+
119+
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:
120+
121+
- All entities, services, actions, and their relationships
122+
- Resolved annotations and metadata
123+
- Generated HTTP endpoints and OData URLs
124+
- Cross-references between definitions
125+
126+
The fuzzy search algorithm matches definition names and allows for typos or partial matches, making it easy to find entities like "Books" even when searching for "book" or "boks".
127+
128+
### `search_docs` - Embedding-Based Documentation Search
86129

87-
This project is open to feature requests/suggestions, bug reports etc. 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).
130+
This tool uses vector embeddings to search through CAP documentation content stored locally. The process works as follows:
88131

89-
## Security / Disclosure
132+
1. **Pre-processing**: CAP documentation is chunked into semantic sections and converted to vector embeddings using a local embedding model
133+
2. **Query processing**: Your search query is also converted to an embedding vector
134+
3. **Similarity search**: The system finds documentation chunks with the highest semantic similarity to your query
90135

91-
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 do not create GitHub issues for security-related doubts or problems.
136+
This approach enables semantic search - you can find relevant documentation even when your query doesn't contain exact keywords from the docs.
92137

93-
## Code of Conduct
138+
## How to Obtain Support
94139

95-
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.
140+
In case you find a bug, please report an [incident](https://cap.cloud.sap/docs/resources/#support-channels) on SAP Support Portal.
96141

97-
## Licensing
142+
## License
98143

99-
Copyright 2025 SAP SE or an SAP affiliate company and mcp-server 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).
144+
This package is provided under the terms of the [SAP Developer License Agreement](https://cap.cloud.sap/resources/license/developer-license-3_2_CAP.txt).

0 commit comments

Comments
 (0)