@cap-js/mcp-server
SAP's MCP server for CAP development, run as cds-mcp: search_model searches the project's compiled CDS model, search_docs searches the CAP documentation indexed as embeddings on the developer's own machine.
A coding agent asked to change a CAP project answers from what it remembers about CAP and from whichever .cds files it happened to open. This server gives it two tools instead: search_model fuzzy-matches names in the compiled CDS model, which carries every definition with its annotations and the HTTP endpoints the services are served at, and search_docs runs a semantic search over preprocessed CAP documentation held as embeddings on the machine the server runs on. It is registered with the MCP client rather than added to the project: the client starts npx -y @cap-js/mcp-server, for which the README shows the configuration in VS Code, Claude Code, OpenAI Codex and opencode, and two rules to paste into AGENTS.md are what tell the model to search before it proposes a change. Installed globally it is also a command, so cds-mcp search_docs and cds-mcp search_model answer the same two questions from a terminal. Both tools read; what the agent then writes is the agent's.
Facts
Where it sits
Who is behind it
In the atlas: maintains 34@cap-jsmaintainerChristian GeorgiContributes to this
In the atlas: maintains 1, contributes to 53@chgeoDr. David A. KunzContributes to this
In the atlas: contributes to 16@David-KunzKevin RiedelsheimerContributes to this
In the atlas: contributes to 11@KevinRiedelsheimerSimon KoblerContributes to this
In the atlas: contributes to 6@KoblerSLars PlessingContributes to this
In the atlas: contributes to 9@larsPlessingOle LilienthalContributes to this
In the atlas: contributes to 1@ole-lilienthalVladimirs SemikinsContributes to this
In the atlas: contributes to 1@seVladimirssjvansContributes to this
In the atlas: contributes to 45@sjvansMahati ShankarContributes to this
In the atlas: contributes to 4@smahatiSteffen WaldmannContributes to this
In the atlas: contributes to 25@swaldmann10 contributors
Before choosing this
Conditions
PracticalFunctional boundary
The tools are documented as meant for AI models and not a stable API, so anything built to parse cds-mcp output rather than to feed a model can break between releases. Its corpus is the CAP documentation, so Fiori elements, BTP service or ABAP questions are not in what search_docs indexes.
What it declares
Every artifact
- Type
- MCP server
- Origin
- By SAP
As an MCP server
- Transport
- stdio
Connections
Letting a coding agent read and act on your project or system
Finding answers in written documentation, and writing what is missing
CAP Node.js runtime
Command line client and development toolkit for CAP
Forty SAP development plugins for coding agents
MCP server inside a CAP application with model and query tools
Download
Install
npm add @cap-js/mcp-serverDerived from the package name. No recipe recorded; the README has the configuration.
Learn more
- AI Assisted CAP DevelopmentAI Assisted CAP DevelopmentA Devtoberfest 2026 session (CAP-43) on building CAP applications with a coding agent, in two demos. The first asks the same question twice in a dev container, once with no MCP server configured and once with @cap-js/mcp-server registered: without it the agent answers CAP's semantic search with an outdated vector type and CQL, with its documentation search it writes the built-in vector embedding function and a working similarity query. The second installs the cap-developer plugin from capire/skills, from a Devtoberfest preview branch, and runs its guided-development skill stage by stage — domain model, sample data, services, constraints — each stage reviewed before the next.SAP Developers, published 2026-10-16SAP Developers, YouTube — SAP Developers playlists
- Boost your CAP Development with AI: Introducing the MCP Server for CAPBoost your CAP Development with AI: Introducing the MCP Server for CAPThe announcement of the development-tool half of the two things called MCP here: a server that gives an agent context about the project in front of it and relevant CAP examples, so Claude Code or Copilot steers better. Names the agents it was tried with, which is more than most announcements do.published 2025-09-03BirgitS, SAP Community
- OData to outcomes—Build AI-enabled SAP Fiori apps using SAP Fiori elementsOData to outcomes—Build AI-enabled SAP Fiori apps using SAP Fiori elementsA Fiori elements app built through SAP's MCP servers: the OData V4 service comes from the MCP server for RAP, which the atlas holds as the ADT MCP Server, or from @cap-js/mcp-server for CAP, and the UI from @sap-ux/fiori-mcp-server, with annotations and actions added before the app is tied to SAP's AI features. Agent access to your code on both the service and the UI side; SAP's abstract names the servers and the steps and says nothing about which AI features or which agent host. A TechEd 2026 session (Thursday 29 October, Berlin), presented by Benedikt Schoelch, Sebastian Steinhauer, Sebastian Werner and Stefan Engelhardt, written here from SAP's abstract; the recording is not yet published.Stefan Engelhardt, SAP TechEd — session catalogue
Architecture
Download
README
quoted from cap-js/mcp-server under Apache-2.0, readWelcome to @cap-js/mcp-server
About This Project
A Model Context Protocol (MCP) server for the SAP Cloud Application Programming Model (CAP). Use it for AI-assisted development of CAP applications (agentic coding).
The server helps AI models answer questions such as:
- Which CDS services are in this project, and where are they served?
- What are the entities about and how do they relate?
- How do I add columns to a select statement in CAP Node.js?
Table of Contents
- About This Project
- Requirements
- Setup
- Available Tools
- Support, Feedback, Contributing
- Security / Disclosure
- Code of Conduct
- Licensing
- Acknowledgments
Requirements
See Getting Started on how to jumpstart your development and grow as you go with SAP Cloud Application Programming Model.
Setup
Configure your MCP client (Cline, opencode, Claude Code, GitHub Copilot, etc.) to start the server using the command npx -y @cap-js/mcp-server as in the following examples.
Usage in Claude Code
Register the server with Claude Code.
For all projects (user scope):
claude mcp add --scope user cds-mcp -- npx -y @cap-js/mcp-server
For the current project only (local scope, not committed):
claude mcp add cds-mcp -- npx -y @cap-js/mcp-server
For the current project only (committed to the repository):
claude mcp add --scope project cds-mcp -- npx -y @cap-js/mcp-server
To set an environment variable, add --env before the server name:
claude mcp add --scope user --env CDS_MCP_MODEL=nomic-ai/nomic-embed-text-v1.5 cds-mcp -- npx -y @cap-js/mcp-server
Usage in VS Code
Example for VS Code extension Cline:
{
"mcpServers": {
"cds-mcp": {
"command": "npx",
"args": ["-y", "@cap-js/mcp-server"],
"env": {}
}
}
}
Example for VS Code global mcp.json:
Note: GitHub Copilot uses the
mcp.jsonfile as source for it's Agent mode.
{
"servers": {
"cds-mcp": {
"command": "npx",
"args": ["-y", "@cap-js/mcp-server"],
"env": {},
"type": "stdio"
},
"inputs": []
}
}
To set an environment variable, replace the server's empty env object with:
"env": {
"CDS_MCP_MODEL": "nomic-ai/nomic-embed-text-v1.5"
}
See VS Code Marketplace for more agent extensions.
Usage in OpenAI Codex
Register the server with OpenAI Codex:
codex mcp add cds-mcp -- npx -y @cap-js/mcp-server
To set an environment variable, add --env before the command:
codex mcp add cds-mcp --env CDS_MCP_MODEL=nomic-ai/nomic-embed-text-v1.5 -- npx -y @cap-js/mcp-server
Usage in opencode
Add to opencode.jsonc in your project, or to ~/.config/opencode/opencode.jsonc for global use:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"cds-mcp": {
"type": "local",
"command": ["npx", "-y", "@cap-js/mcp-server"],
"environment": {
"CDS_MCP_MODEL": "nomic-ai/nomic-embed-text-v1.5"
},
"enabled": true
}
}
}
This is the opencode v1 format. In opencode v2, use the same config but nest the server under "servers" — "mcp": { "servers": { "cds-mcp": { ... } } } — or use the CLI instead:
opencode mcp add --global cds-mcp -- npx -y @cap-js/mcp-server
To set an environment variable:
opencode mcp add --global cds-mcp \
--env CDS_MCP_MODEL=nomic-ai/nomic-embed-text-v1.5 \
-- npx -y @cap-js/mcp-server
Environment Variables
| Variable | Description |
|---|---|
CDS_MCP_OFFLINE | Set to true to use locally cached embeddings without checking for updates. Accepts true or false. |
CDS_MCP_MODEL | Non-empty embedding model name. |
CDS_MCP_MANIFEST_TIMEOUT | Manifest request timeout in positive integer milliseconds. Defaults to 15000. |
CDS_MCP_DOWNLOAD_TIMEOUT | Bundle response-header timeout in positive integer milliseconds. Defaults to 30000. |
CDS_MCP_GENERIC_EMBEDDINGS | Set to true to skip the runtime filter and search all runtimes. By default search_docs keeps only the chunks of the detected project runtime (Node.js or Java) plus the runtime-agnostic chunks. |
CDS_MCP_MAX_RESULTS | Upper limit on the number of search_docs results, as a positive integer. Caps the per-call maxResults. |
RERANK_ENABLED | Set to true to rerank search_docs results with a local cross-encoder model. Accepts true or false; disabled by default. |
CDS_MCP_RERANK_MODEL | Non-empty cross-encoder model name used when reranking. Defaults to Xenova/ms-marco-MiniLM-L-6-v2. |
CDS_MCP_RERANK_DTYPE | Non-empty data type used to load the reranking model. Defaults to q8; set to fp32 for models without model_quantized.onnx. |
CDS_MCP_RERANK_EXTERNAL_DATA | Set to true for reranking models whose ONNX weights are stored in external .onnx_data files. Accepts true or false. |
CDS_MCP_RERANK_BATCH_SIZE | Positive integer number of results to process in each reranking batch. Defaults to 1. |
Rules
The following rules help the LLM use the server correctly:
- 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.
- You MUST search for CAP docs with cds-mcp EVERY TIME you create, modify CDS models or when using APIs or the `cds` CLI from CAP. Do NOT propose, suggest or make any changes without first checking it.
Add these rules to your existing global or project-specific AGENTS.md (specifics may vary based on respective MCP client).
CLI Usage
You can also use the tools directly from the command line.
npm i -g @cap-js/mcp-server
Warning
When the package is installed globally,
npxuses the installed version instead of downloading the latest from npm. You must update the package manually:npm update -g @cap-js/mcp-server
This will provide the command cds-mcp, with which you can invoke the tools directly as follows.
# Search CAP documentation
cds-mcp search_docs "how to add columns to a select statement in CAP Node.js" 1
# Search for CDS model definitions
cds-mcp search_model . Books entity
Available Tools
Note
Tools are meant to be used by AI models and do not constitute a stable API.
The server provides these tools for CAP development:
search_docs
This tool uses vector embeddings to locally search through preprocessed CAP documentation, stored as embeddings. The process works as follows:
- Query processing: Your search query is converted to an embedding vector.
- Similarity search: The system finds documentation chunks with the highest semantic similarity to your query.
This semantic search approach enables you to find relevant documentation even when your query does not use the exact keywords found in the docs, all locally on your machine.
search_model
This tool performs fuzzy searches against names of definitions from the compiled CDS model (Core Schema Notation).
CDS compiles all your .cds files into a unified model representation that includes:
- All definitions and their relationships
- Annotations
- HTTP endpoints
The fuzzy search algorithm matches definition names and allows for partial matches, making it easy to find entities like "Books" even when searching for "book".
Support, Feedback, Contributing
This project is open to feature requests/suggestions, bug reports, and so on, via GitHub 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.
Security / Disclosure
If you find any bug that may be a security problem, please follow our instructions at in our security policy on how to report it. Please don't create GitHub issues for security-related doubts or problems.
Code of Conduct
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 at all times.
Licensing
Copyright 2025 SAP SE or an SAP affiliate company and @cap-js/cds-mcp contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.
Acknowledgments
- onnxruntime-web is used for creating embeddings locally.
- @huggingface/transformers.js is used to compare the output of the WordPiece tokenizer.
- @modelcontextprotocol/sdk provides the SDK for MCP.
History
Features 2, Changed 2, Fixes 1
Notes
Added
- Accept precomputed
canonicalChunksincreateEmbeddings, validated as an array at creation time - Export the default
MODELconstant fromcalculateEmbeddings
Changed
- Changed the default embedding model from
sentence-transformers/all-MiniLM-L6-v2toBAAI/bge-small-en-v1.5for improved retrieval quality - Clarified the
search_docstool and query parameter descriptions, guiding term choice toward specific concepts and away from corpus-wide terms
Fixed
- Bound all network requests with
AbortSignal.timeout(manifest 6 s, bundle download 10 s) so hung or slow upstream servers cannot block the server indefinitely
Features 3, Changed 1, Fixes 4
Notes
Added
- Hybrid search for
search_docs: semantic cosine similarity combined with BM25 keyword search (SQLite FTS5, with a pure-JS fallback when FTS5 is not compiled intonode:sqlite) via weighted Reciprocal Rank Fusion - Optional local cross-encoder reranking of
search_docsresults, opt-in viaRERANK_ENABLED - Fall back to the globally installed
cds-dk's@sap/cdsruntime version when the project provides no local CDS
Changed
- Skip the daily embeddings-bundle re-check when the local files are fresh (within one day), scoped to the detected runtime
Fixed
- Fall back to local embeddings when the bundle download fails due to a network error
- Read the RFC 9457
detailfield from non-OK bundle fetch responses for clearer error messages - Anchor the ONNX model cache to the package root instead of the caller's working directory
- Exclude OData-contained entities from the exposed model by computing the contained set from the compiled model (the runtime
_containedEntitiesgetter is absent on compiled definitions)
- Hybrid search for
Features 3, Changed 4, Fixes 6
Notes
Added
- Configurable embedding model per client via the
--model <name>CLI flag andCDS_MCP_MODELenvironment variable - Capire-versioned embeddings with local manifest resolution
- Per-chunk metadata in
searchMarkdownDocsoutput
Changed
- Changed the default embedding model from
Xenova/all-MiniLM-L6-v2tosentence-transformers/all-MiniLM-L6-v2 - Switched to CAP AI SQLite
VECTOR_EMBEDDING - Improved
search_docsquery param description - Replaced background model polling and
CDS_MCP_REFRESH_MSwith request-driven model and configuration refresh
Fixed
- Blank
Cache-Control/Pragmaso conditional GET can 304, avoiding a full re-download of the embeddings bundle on every startup - Isolated project model caches and CAP compiler/global state across requests
- Preserved transitive model imports for explicitly trusted direct CLI projects
- Prevented rejected MCP model compilations from exposing out-of-root diagnostics
- Refreshed cached models after changes to CAP project configuration
- Restricted MCP model access to advertised workspace roots, including symlink and resolved-source validation
- Configurable embedding model per client via the
Features 2
Notes
Added
- Support for MCP Bundles (Claude Desktop), Claude Code CLI plugin, and Claude Code MCP config
- Support for MCP Registry
Others providing
- capforgecapforgeAn MCP server that scaffolds CAP and CDS for a coding agent and then holds it to cds compile — the agent does not stop until the generated code builds clean.independent, capMCP server scaffolding CAP and CDS checked by cds compile
- @sap-ux/fiori-mcp-server@sap-ux/fiori-mcp-serverSAP's Fiori MCP server, run as fiori-mcp, letting a coding assistant create and edit Fiori applications directly rather than describing the steps.sap official, ui5MCP server for creating and editing Fiori applications
- @ui5/mcp-server@ui5/mcp-serverSAP's MCP server for UI5 development: ten tools that scaffold an app or a card, read the project in front of the agent, and run the linter and the manifest validator against it.sap official, ui5MCP server for UI5 development with ten tools
- mcp-sap-docsmcp-sap-docsAn MCP server over seventeen cloned SAP documentation repositories — ABAP keyword docs, capire, OpenUI5, Cloud SDK, BTP — searched with BM25 and prebuilt embeddings fused by reciprocal rank fusion.independent, capMCP server searching seventeen SAP documentation repositories
- @sap-ux/fiori-docs-embeddings@sap-ux/fiori-docs-embeddingsFiori documentation indexed as embeddings, which is what makes it searchable by something other than a person scrolling it.sap official, capFiori documentation indexed as embeddings
- Clean-Core.ioClean-Core.ioA free hosted workspace that reads one piece of custom ABAP, redraws its business process as BPMN with a line anchor on every element, grades the SAP objects it uses Level A–D and ends in a keep, rebuild, move-to-standard or retire decision.independent, abapHosted workspace redrawing custom ABAP as BPMN and grading it
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
Contributors
History in the atlas
- First seen.
For your agent
- Ref
artifact:cap-js-mcp-server- JSON
- /artifacts/cap-js-mcp-server.json
- MCP
- Connecting an agent