# MCP Server

> The constant-k MCP server for AI agents: docs search, and read-only Solana calls with an API key.

Source: https://docs.constant-k.com/get-started/mcp-server/

The constant-k MCP server lets an AI agent search these docs and read Solana data.

## Endpoint

* URL: `https://mcp.constant-k.com/mcp`
* Transport: Streamable HTTP
* API key: the `x-api-key` header, or `Authorization: Bearer`

Docs search works without an API key. Solana calls need the key from [My Account](https://www.constant-k.com/my-account/). A key in the URL is refused.

## Tools

| Tool          | Result                                                | API key    |
| :------------ | :---------------------------------------------------- | :--------- |
| `search_docs` | The docs sections that match a question               | Not needed |
| `read_doc`    | One docs page, or one section of it                   | Not needed |
| `solana_rpc`  | The reply to one read-only [Solana RPC method](https://docs.constant-k.com/rpc/) | Required   |

## Client setup

**Claude Code**

```bash
claude mcp add --transport http --scope user constant-k \
  https://mcp.constant-k.com/mcp --header "x-api-key: YOUR_API_KEY"
```

**Claude**

1. Open **Customize**, then **Connectors**.
2. Select **+ Add**, then **Add custom connector**.
3. Enter the name `constant-k` and the URL `https://mcp.constant-k.com/mcp`, then select **Continue**.
4. Under **Authentication**, choose **No sign in**.
5. Under **Request headers**, choose `x-api-key` and enter your API key.
6. Select **Add**.

**Cursor**

File: `~/.cursor/mcp.json`

```json
{
  "mcpServers": {
    "constant-k": {
      "url": "https://mcp.constant-k.com/mcp",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}
```

Other clients that support Streamable HTTP and custom headers use the same URL and header.

## Limits

* Each `solana_rpc` call counts as one request on your plan. The [plan limits](https://docs.constant-k.com/get-started/plans-and-limits/) are the same as for a direct call.
* The server only reads. `sendTransaction` and `sendBundle` are refused.
* A reply over 80,000 characters is cut, and the reply says so. Filters, `limit` and `dataSlice` make it smaller.
* A call ends after 60 seconds.
