# CAP Plugin for MCP server

> Exposes SAP Cloud Application Programming Model (CAP) services as tools for AI agents to consume via the Model Context Protocol.

- Repository: https://github.com/cap-js/mcp
- Page: https://hostedmcp.org/servers/cap-js/mcp
- Transport: stdio
- Stars: 22
- License: Apache-2.0

## Install

### Claude Code

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

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

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

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

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

### VS Code CLI

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

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

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

### Codex

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

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

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

### Gemini CLI

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

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

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

## FAQ

### How can I expose each action or function as a dedicated tool?

Set the `per_action_tool` flag to `true` in your `package.json` configuration under `cds.mcp`.

### Can I customize the instructions sent to the AI agent?

Yes, you can use the `@mcp.instructions` annotation in your CDS code to provide custom instructions or i18n references.

### What query formats are supported?

The server supports both CQL (default) and CQN (structured) input formats.

### How do I prevent tool name collisions when connecting multiple servers?

Enable the `prefix` flag to prefix tool names with the service name.
