# SAP CAP MCP server

> Lets an AI client search CAP documentation and CDS model definitions to assist with developing CAP applications.

- Repository: https://github.com/cap-js/mcp-server
- Page: https://hostedmcp.org/servers/cap-js/mcp-server
- Transport: stdio
- Stars: 118
- License: Apache-2.0
- Latest version: 0.1.0

## Install

### Claude Code

```sh
claude mcp add mcp-server -- npx -y @cap-js/mcp-server
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@cap-js/mcp-server"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@cap-js/mcp-server"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp-server","type":"stdio","command":"npx","args":["-y","@cap-js/mcp-server"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@cap-js/mcp-server"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add mcp-server -- npx -y @cap-js/mcp-server
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp-server]
command = "npx"
args = ["-y", "@cap-js/mcp-server"]
```

### Gemini CLI

```sh
gemini mcp add -s user mcp-server npx -- -y @cap-js/mcp-server
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@cap-js/mcp-server"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `CDS_MCP_MODEL` | no | no |  |
| `CDS_MCP_OFFLINE` | no | no |  |
| `CDS_MCP_OFFLINE_DIR` | no | no |  |

## FAQ

### How do I add the CAP MCP server to Claude Code?

Run the claude mcp add command with npx -y @cap-js/mcp-server, optionally with --scope user or --scope project.

### What tools does the CAP MCP server provide?

It provides search_docs for semantic search over CAP documentation and search_model for fuzzy search of CDS model definitions.

### How does search_docs find relevant documentation?

It converts your query to an embedding vector and finds documentation chunks with the highest semantic similarity, all locally on your machine.

### Can I search CDS model definitions with fuzzy matching?

Yes, search_model matches definition names with partial matches, so searching "book" finds entities like "Books".

### Can I use the tools from the command line?

Yes, install the package globally and use the cds-mcp command to invoke search_docs or search_model directly.
