Skip to content

Commit 7d50a70

Browse files
sjvansDavid-Kunz
andauthored
chore: improve readme (#54)
* chore: improve readme * Update README.md * AGENTS.md + Usage in VS Code * opencode * adjusted copilot review --------- Co-authored-by: Dr. David A. Kunz <david.kunz@sap.com>
1 parent e79e548 commit 7d50a70

File tree

1 file changed

+103
-32
lines changed

1 file changed

+103
-32
lines changed

README.md

Lines changed: 103 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,74 @@
1-
# @cap-js/mcp-server
1+
# Welcome to @cap-js/mcp-server
22

33
[![REUSE status](https://api.reuse.software/badge/github.com/cap-js/mcp-server)](https://api.reuse.software/info/github.com/cap-js/mcp-server)
44

5+
6+
7+
> [!NOTE]
8+
> This project is in alpha state. Don't use it for production code.
9+
10+
11+
12+
## About This Project
13+
514
A Model Context Protocol (MCP) server for the [SAP Cloud Application Programming Model (CAP)](https://cap.cloud.sap).
615
Use it for AI-assisted development of CAP applications (_agentic coding_).
716

8-
The server helps AI models answer questions like:
9-
10-
- _Which CDS services are there in this project and where are they served?_
17+
The server helps AI models answer questions such as:
18+
- _Which CDS services are in this project, and where are they served?_
1119
- _What are the entities about?_
1220
- _How do they relate?_
1321
- _How do I add columns to a select statement in CAP Node.js?_
1422

15-
> [!NOTE]
16-
> This project is in alpha state. Don't use it for production code.
23+
24+
25+
## Table of Contents
26+
27+
- [About This Project](#about-this-project)
28+
- [Requirements](#requirements)
29+
- [Setup](#setup)
30+
- [Available Tools](#available-tools)
31+
- [`search_model`](#search_model)
32+
- [`search_docs`](#search_docs)
33+
- [Usage](#usage)
34+
- [Usage in VS Code](#usage-in-vs-code)
35+
- [Usage in opencode](#usage-in-opencode)
36+
- [CLI UsageI](#cli-usage)
37+
- [How It Works](#how-it-works)
38+
- [Support, Feedback, Contributing](#support-feedback-contributing)
39+
- [Security / Disclosure](#security--disclosure)
40+
- [Code of Conduct](#code-of-conduct)
41+
- [Licensing](#licensing)
42+
- [Acknowledgments](#acknowledgments)
43+
44+
45+
46+
## Requirements
47+
48+
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+
1761

1862
## Available Tools
1963

64+
> [!NOTE]
65+
> Tools are meant to be used by AI models and do not constitute a stable API.
66+
2067
The server provides these tools for CAP development:
2168

2269
### `search_model`
2370

24-
Search for CDS definitions (entities, services, actions) including:
25-
71+
Search for CDS definitions (entities, services, actions), including:
2672
- Model structure and relationships
2773
- Annotations and metadata
2874
- HTTP endpoints and OData URLs
@@ -31,24 +77,44 @@ Search for CDS definitions (entities, services, actions) including:
3177
### `search_docs`
3278

3379
Search [CAP documentation](https://cap.cloud.sap) for:
34-
3580
- Code snippets and examples
3681
- API usage patterns
3782

38-
## Setup
3983

40-
```sh
41-
npm i -g @cap-js/mcp-server
84+
85+
## Usage
86+
87+
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.
4294
```
4395

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).
4597

46-
## Usage
98+
### Usage in VS Code
4799

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+
```
49112

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.
51114

115+
### Usage in opencode
116+
117+
Example for [opencode](https://github.com/sst/opencode):
52118
```json
53119
{
54120
"mcp": {
@@ -61,16 +127,9 @@ Example for opencode:
61127
}
62128
```
63129

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-
71130
### CLI Usage
72131

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:
74133

75134
```sh
76135
# Search for CDS model definitions
@@ -80,14 +139,16 @@ cds-mcp search_model . Books entity
80139
cds-mcp search_docs "how to add columns to a select statement in CAP Node.js" 1
81140
```
82141

142+
143+
83144
## How It Works
84145

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:
86147

87148
### `search_model` - Compiled Model Search
88149

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:
91152
- All entities, services, actions, and their relationships
92153
- Resolved annotations and metadata
93154
- Generated HTTP endpoints and OData URLs
@@ -97,30 +158,40 @@ The fuzzy search algorithm matches definition names and allows for partial match
97158

98159
### `search_docs` - Embedding-Based Documentation Search
99160

100-
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.
101168

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.
105169

106-
This approach enables semantic search - you can find relevant documentation even when your query doesn't contain exact keywords from the docs.
107170

108171
## Support, Feedback, Contributing
109172

110173
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).
111174

175+
176+
112177
## Security / Disclosure
113178

114179
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.
115180

181+
182+
116183
## Code of Conduct
117184

118185
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.
119186

187+
188+
120189
## Licensing
121190

122191
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).
123192

193+
194+
124195
## Acknowledgments
125196

126197
- **onnxruntime-web** is used for creating embeddings in Node.js.

0 commit comments

Comments
 (0)