# CAPI Gateway

Turns an existing REST API into an MCP tool with no changes on the backend. Register the service in Consul and the agent sees its tools right away.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 10
- Author: surisoft-io
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/surisoft-io/capi-core
- Updated: 2026-10-13
- HTML: https://affpapa.org/en/nevibecode/mcp/capi-gateway

## What it does

CAPI Gateway is an API gateway built on Undertow's async proxy. Its MCP Gateway exposes services to LLM agents as tools, while your backends stay plain REST. CAPI reads the Consul metadata, builds the tool catalog, and translates a `tools/call` request into an HTTP call to your API. The reply comes back wrapped in MCP format.

Real MCP servers work too. Register one with `mcp-type: server`, and CAPI pulls its tools through `tools/list` and proxies calls to it. Both kinds of backend land under a single MCP endpoint. The MCP Gateway itself is marked experimental, same as the gRPC one.

You can run it from a JAR, Docker, or a Helm chart. The `CAPI_CONFIG_FILE` environment variable must point at a config file, otherwise the server won't start. The MCP port is 8383 (`capi.mcp.port`). Installing into an agent takes Docker, since the command launches the `docker.io/surisoft/capi-core:1.417.5` image interactively.

## Requirements
- Needs: Docker

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add capi-gateway -- docker run -i --rm docker.io/surisoft/capi-core:1.417.5
```

### Codex

**Platform CLI**
```bash
codex mcp add capi-gateway -- docker run -i --rm docker.io/surisoft/capi-core:1.417.5
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "capi-gateway": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "docker.io/surisoft/capi-core:1.417.5"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "capi-gateway": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "docker.io/surisoft/capi-core:1.417.5"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add capi-gateway docker run -i --rm docker.io/surisoft/capi-core:1.417.5
```

## When to use it
- expose an existing REST API to an agent without rewriting the backend
- build a tool catalog from services registered in Consul
- proxy MCP server calls through one shared endpoint
- inspect routes and metrics through the Admin API
- validate OAuth2/OIDC tokens before hitting the backend

## Example prompts
- List the tools CAPI Gateway exposes
- Call a tool through CAPI and show me the backend response
- Register a new service in Consul with MCP metadata

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [OpenWork MCP Gateway](https://affpapa.org/en/nevibecode/mcp/openwork-mcp-gateway.md) — MCP server · ★ 24242
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18727
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366
- [basebalance.cloud — x402 RPC & MCP gateway](https://affpapa.org/en/nevibecode/mcp/basebalancecloud-x402-rpc-mcp-gateway.md) — MCP server · ★ 7506

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
