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

# Polar over Model Context Protocol (MCP)

> Extend the capabilities of your AI agents with Polar's MCP Server

<img src="https://mintcdn.com/polar/0Af3hN6-oIM4IHT3/assets/integrate/mcp/mcp.png?fit=max&auto=format&n=0Af3hN6-oIM4IHT3&q=85&s=a6b10fbceef95c6f4a2c9793c9ee60fa" width="2676" height="1592" data-path="assets/integrate/mcp/mcp.png" />

Supercharge your AI agents with Polar as a Model Context Protocol (MCP) server.

## What is MCP?

MCP is a protocol for integrating tools with AI agents. It can greatly enhance the capabilities of your AI agents by providing them with real-time data and context.

Polar offers a remote MCP server that you can connect to from most AI clients.

## How does it work?

You need a MCP-capable agent environment to use Polar over MCP. A few of them are Claude Desktop and Cursor.

## Connecting to Polar MCP

Polar provides two MCP servers:

* **Production**: `https://mcp.polar.sh/mcp/polar-mcp` - Connect to your live Polar organization
* **Sandbox**: `https://mcp.polar.sh/mcp/polar-sandbox` - Connect to the Polar sandbox environment for testing

When you can specify a MCP URL, use one of the URLs above depending on your environment.

If you have to specify a command, use:

```json theme={null}
{
  "mcpServers": {
    "Polar": {
      "command": "npx",
      "args": ["mcp-remote", "https://mcp.polar.sh/mcp/polar-mcp"]
    }
  }
}
```

For sandbox:

```json theme={null}
{
  "mcpServers": {
    "Polar Sandbox": {
      "command": "npx",
      "args": ["mcp-remote", "https://mcp.polar.sh/mcp/polar-sandbox"]
    }
  }
}
```

### Cursor

In `.cursor/mcp.json`, add:

```json theme={null}
{
  "mcpServers": {
    "Polar": {
      "url": "https://mcp.polar.sh/mcp/polar-mcp"
    }
  }
}
```

For sandbox:

```json theme={null}
{
  "mcpServers": {
    "Polar Sandbox": {
      "url": "https://mcp.polar.sh/mcp/polar-sandbox"
    }
  }
}
```

### Windsurf

In `mcp_config.json`, add:

```json theme={null}
{
  "mcpServers": {
    "Polar": {
      "command": "npx",
      "args": ["mcp-remote", "https://mcp.polar.sh/mcp/polar-mcp"]
    }
  }
}
```

For sandbox:

```json theme={null}
{
  "mcpServers": {
    "Polar Sandbox": {
      "command": "npx",
      "args": ["mcp-remote", "https://mcp.polar.sh/mcp/polar-sandbox"]
    }
  }
}
```

### Codex

Add the following to your `~/.codex/config.toml`:

```toml theme={null}
[features]
rmcp_client = true

[mcp_servers.polar]
type = "http"
url = "https://mcp.polar.sh/mcp/polar-mcp"
```

Then run:

```sh theme={null}
codex mcp login polar
```

For sandbox:

```toml theme={null}
[features]
rmcp_client = true

[mcp_servers.polar_sandbox]
type = "http"
url = "https://mcp.polar.sh/mcp/polar-sandbox"
```

Then run:

```sh theme={null}
codex mcp login polar_sandbox
```

### Claude Code

Run the following command:

```
claude mcp add --transport http "Polar" "https://mcp.polar.sh/mcp/polar-mcp"
```

For sandbox:

```
claude mcp add --transport http "Polar-Sandbox" "https://mcp.polar.sh/mcp/polar-sandbox"
```

### OpenCode

In `opencode.jsonc`, add:

```jsonc theme={null}
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "Polar": {
      "type": "remote",
      "url": "https://mcp.polar.sh/mcp/polar-mcp"
    }
  }
}
```

For sandbox:

```jsonc theme={null}
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "Polar Sandbox": {
      "type": "remote",
      "url": "https://mcp.polar.sh/mcp/polar-sandbox"
    }
  }
}
```

### ChatGPT

MCP is only available for paid users in beta on ChatGPT web, by enabling Developer Mode.

Once Developer Mode is enabled, go to *Settings* → *Connectors* and add the MCP server using `https://mcp.polar.sh/mcp/polar-mcp`.

For sandbox, use `https://mcp.polar.sh/mcp/polar-sandbox` instead.

### Claude Desktop

Go to *Settings* → *Connectors* and click *Add custom connector*.

Name it "Polar" and add `https://mcp.polar.sh/mcp/polar-mcp` as the server URL.

For sandbox, use `https://mcp.polar.sh/mcp/polar-sandbox` as the server URL instead.

Save, and click *Connect* to connect to your Polar organization.
