@cap-js/mcp-server

Searches a CAP project's compiled CDS model and the CAP documentation during development

Official · SAP Cloud Application Programming Model JavaScript Local · stdio Developer tools

72 popularity score ★ 118 ↓ 70k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add cap-js -- npx -y @cap-js/mcp-server
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "cap-js": {
      "command": "npx",
      "args": [
        "-y",
        "@cap-js/mcp-server"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "cap-js": {
      "command": "npx",
      "args": [
        "-y",
        "@cap-js/mcp-server"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "cap-js": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@cap-js/mcp-server"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.cap-js]
command = "npx"
args = ["-y", "@cap-js/mcp-server"]
Gemini CLITerminal
gemini mcp add --scope user cap-js npx -- -y @cap-js/mcp-server

Settings 7

CDS_MCP_OFFLINE Optional: Set to true to use the embeddings already downloaded and skip the update check (same as --offline). Default false.
CDS_MCP_MODEL Optional: Embedding model name, org/model (same as --model). Default BAAI/bge-small-en-v1.5. For search_docs.
Set together: rerank
RERANK_ENABLED Optional: Set to true to reorder docs results with a local cross-encoder model. Default false. For search_docs.
CDS_MCP_RERANK_MODEL Optional: Cross-encoder model used when RERANK_ENABLED is true. Default Xenova/ms-marco-MiniLM-L-6-v2. For search_docs.
CDS_MCP_RERANK_DTYPE Optional: Data type to load the rerank model with; fp32 for models without model_quantized.onnx. Default q8. For search_docs.
CDS_MCP_RERANK_EXTERNAL_DATA Optional: Set to true for rerank models whose weights sit in external .onnx_data files. For search_docs.
CDS_MCP_RERANK_BATCH_SIZE Optional: Number of results scored per rerank batch. Default 1. For search_docs.

What it does

This is SAP's own MCP server for building applications on the SAP Cloud Application Programming Model (CAP). It runs on your machine over stdio and gives a coding assistant two read-only lookups: one into the CDS model of the project you are working on, and one into the CAP documentation.

The model lookup compiles the project's .cds files and matches definition names loosely, so a query for "book" finds a Books entity. It can filter by kind (service, entity, action), return only names for an overview, and hands back the full definitions with elements, annotations, file locations and HTTP endpoints. It returns one match by default; topN raises that.

The documentation lookup searches capire, the CAP docs, covering CDS and both the Node.js and Java runtimes. In version 0.0.8 it is a hybrid search: embedding similarity combined with BM25 keyword matching (SQLite FTS5, or a JavaScript fallback), returning 5 chunks by default (maxResults changes it) (lib/embeddings.js, lib/tools.js). The query is embedded on your machine. The prebuilt embeddings are fetched from cap.cloud.sap for the runtime and CDS version the server detects in the project, and checked for updates at most once a day; --offline or CDS_MCP_OFFLINE=true uses the copy already downloaded. The embedding model defaults to BAAI/bge-small-en-v1.5 (--model or CDS_MCP_MODEL). With RERANK_ENABLED=true it fetches five times as many candidates and reorders them with a local cross-encoder, Xenova/ms-marco-MiniLM-L-6-v2 by default (lib/rerank.js, lib/searchMarkdownDocs.js).

The same package installs a cds-mcp command that runs either tool straight from a shell.

What it needs

RuntimeNode.js
Runs onmacOS, Windows, Linux
Also
  • A CAP project (.cds files) for the model search

Node.js with npx; @sap/cds 10.1 or later comes in as a dependency. Network access to cap.cloud.sap on first use to download the documentation embeddings, unless they were fetched earlier with cds-mcp --download.

Limits

  • Read only Two tools, both read-only: it cannot edit .cds files, run the project or deploy.
  • Not covered Over MCP, project paths must lie inside the workspace roots the client advertises; the cds-mcp command line trusts the path it is given (lib/run.js).
  • Limit In offline mode the docs search fails if no embeddings were downloaded earlier.
  • Limit The README lists CDS_MCP_GENERIC_EMBEDDINGS, CDS_MCP_MAX_RESULTS, CDS_MCP_MANIFEST_TIMEOUT and CDS_MCP_DOWNLOAD_TIMEOUT, but 0.0.8 does not read them; they are only on main.
  • Limit In 0.0.8 the embeddings download times out after 5 s for the manifest and 10 s for the bundle, fixed in code (lib/searchMarkdownDocs.js).
  • Early release The README says the tools are not a stable API; version 0.0.8 is pre-1.0.
  • Limit A global install pins npx to that version until it is updated with npm update -g @cap-js/mcp-server.

Only two tools, both read-only: it cannot edit .cds files, run the project or deploy. Over MCP, project paths are limited to the workspace roots the client advertises (lib/run.js); the cds-mcp command line trusts the path it is given. In offline mode the docs search fails if no embeddings were downloaded earlier. The README warns the tools are not a stable API, and that a global install pins npx to that version until updated with npm update -g. Version 0.0.8 is pre-1.0.

Who it suits

Developers writing CAP applications in Node.js or Java who want their assistant to look up the project's entities, services and endpoints and check CAP syntax against the official docs instead of guessing. It only reads and runs locally, with no sign-in, so it fits locked-down projects; offline mode keeps it off the network once embeddings are cached. It is not the server for exposing a CAP application's own services to agents at runtime: SAP's separate @cap-js/mcp protocol adapter, which we also list, does that.

Tools 2

2 only read. A ? marks an optional parameter.

search_model
Fuzzy-searches definition names in the project's compiled CDS model and returns the matching definitions or just their namesprojectPath: stringname?: stringkind?: stringtopN?: numbernamesOnly?: boolean
search_docs
Searches the CAP documentation by meaning and keywords and returns the closest chunksquery: stringmaxResults?: number

Similar servers