> ## Documentation Index
> Fetch the complete documentation index at: https://docs.curtly.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Model Context Protocol (MCP)

> Connect Curtly Governor to Cursor, Claude Code, Windsurf, OpenCode, and Antigravity via MCP.

Curtly provides an official **Model Context Protocol (MCP)** server, allowing AI coding assistants and agent environments to automatically compress workspace context, files, and multi-turn prompt buffers before making inference calls.

***

## 1-Click Client Configurations

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

Add the following to your Cursor MCP settings (`~/.cursor/mcp.json` or project-level `.cursor/mcp.json`):

```json theme={"dark"}
{
  "mcpServers": {
    "curtly": {
      "command": "npx",
      "args": ["-y", "@curtly/mcp"],
      "env": {
        "CURTLY_API_KEY": "ctly_live_YOUR_API_KEY",
        "CURTLY_MODE": "balanced"
      }
    }
  }
}
```

***

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

Add Curtly to your Claude configuration file:

```json theme={"dark"}
{
  "mcpServers": {
    "curtly-governor": {
      "command": "npx",
      "args": ["-y", "@curtly/mcp"],
      "env": {
        "CURTLY_API_KEY": "ctly_live_YOUR_API_KEY",
        "CURTLY_PONYTAIL": "full"
      }
    }
  }
}
```

***

### Windsurf & OpenCode

```json theme={"dark"}
{
  "mcpServers": {
    "curtly": {
      "command": "npx",
      "args": ["-y", "@curtly/mcp"],
      "env": {
        "CURTLY_API_KEY": "ctly_live_YOUR_API_KEY"
      }
    }
  }
}
```

***

## Available MCP Tools

When connected, the Curtly MCP server exposes the following tools to the LLM agent:

### 1. `curtly_compress`

Compresses any arbitrary text prompt or context block with deterministic AST Safe Vault code protection.

**Parameters:**

* `prompt` *(string, required)*: The raw prompt text to compress.
* `mode` *(string, optional)*: `'conservative'` | `'balanced'` (default) | `'aggressive'`.
* `protectCodeBlocks` *(boolean, optional, default: true)*: Locks code blocks into the Safe Vault.
* `protectJson` *(boolean, optional, default: true)*: Locks JSON schemas into the Safe Vault.

### 2. `curtly_get_metrics`

Returns real-time session telemetry including total input tokens saved, estimated output tokens saved, and net cost savings in USD.
