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

# MCP Server

> Hosted Model Context Protocol server — connect Claude, Cursor, or any MCP client.

The Naive API v2 includes a **hosted MCP server** running on the same instance as the REST API. This means agents can connect directly without running any local processes.

## Architecture

```mermaid theme={"theme":"css-variables"}
flowchart LR
    Agent["AI Agent (Claude, Cursor)"] -->|"SSE + Bearer"| MCP["/mcp/sse"]
    MCP -->|"Internal"| API["API Services"]
    API --> DB[(Postgres)]
    API --> MediaGen["Image/Video Generation"]
    API --> EmailSvc["Email Service"]
```

Unlike the original Naive MCP (which ran as a local stdio subprocess), this is a **remote SSE server**. The agent connects over the network.

## Connection

```
SSE Endpoint: https://api.usenaive.ai/mcp/sse
Messages:     https://api.usenaive.ai/mcp/messages
Auth:         Authorization: Bearer nv_sk_live_...
```

## Claude Desktop Configuration

```json theme={"theme":"css-variables"}
{
  "mcpServers": {
    "naive": {
      "url": "https://api.usenaive.ai/mcp/sse",
      "headers": {
        "Authorization": "Bearer nv_sk_live_..."
      }
    }
  }
}
```

## Cursor Configuration

```json theme={"theme":"css-variables"}
{
  "mcpServers": {
    "naive": {
      "url": "https://api.usenaive.ai/mcp/sse",
      "headers": {
        "Authorization": "Bearer nv_sk_live_..."
      }
    }
  }
}
```

## How It Works

1. Agent opens SSE connection to `/mcp/sse` with Bearer auth
2. Server sends back session ID
3. Agent sends tool calls via `POST /mcp/messages?sessionId=...`
4. Server executes the tool using internal services and returns result
5. Connection stays open for the session duration

## Available Tools

All Phase 1 primitives are exposed as MCP tools. See the [full tool list](/docs/mcp/tools).
