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

# MCP Server

> Use Carboncopy from AI agents via the Model Context Protocol.

## Overview

The Carboncopy MCP server lets AI agents — like Claude, Cursor, or any MCP-compatible client — manage your Polymarket copy-trading portfolio through natural tool calls.

Install it with a single line. No code required.

***

## Quick Install

<CodeGroup>
  ```bash Claude Code theme={"theme":{"light":"github-light","dark":"github-dark"}}
  claude mcp add carboncopy -s user -e CARBONCOPY_API_KEY=cc_your_key -- npx -y @carbon-copy/mcp
  ```

  ```bash Codex CLI theme={"theme":{"light":"github-light","dark":"github-dark"}}
  codex mcp add carboncopy --env CARBONCOPY_API_KEY=cc_your_key -- npx -y @carbon-copy/mcp
  ```

  ```bash OpenCode (interactive) theme={"theme":{"light":"github-light","dark":"github-dark"}}
  opencode mcp add
  # Select "local", name "carboncopy", command: npx -y @carbon-copy/mcp
  ```
</CodeGroup>

Replace `cc_your_key` with your actual API key from [Settings](https://www.carboncopy.inc/settings).

***

## Manual Setup

### Claude Desktop

Add to your config (`~/Library/Application Support/Claude/claude_desktop_config.json`):

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "mcpServers": {
    "carboncopy": {
      "command": "npx",
      "args": ["-y", "@carbon-copy/mcp"],
      "env": {
        "CARBONCOPY_API_KEY": "cc_your_key_here"
      }
    }
  }
}
```

### Cursor

Add to `.cursor/mcp.json` in your project:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "mcpServers": {
    "carboncopy": {
      "command": "npx",
      "args": ["-y", "@carbon-copy/mcp"],
      "env": {
        "CARBONCOPY_API_KEY": "cc_your_key_here"
      }
    }
  }
}
```

### Any MCP client

The server uses **stdio transport** — any MCP-compatible client can run it:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
CARBONCOPY_API_KEY=cc_... npx @carbon-copy/mcp
```

***

## Available Tools

### Portfolio

| Tool                    | Description                                     |
| ----------------------- | ----------------------------------------------- |
| `get_portfolio`         | Portfolio summary — total value, P\&L, win rate |
| `get_portfolio_history` | Paginated trade history with date filtering     |
| `get_positions`         | Currently open positions                        |

### Trader Discovery

| Tool                     | Description                                                       |
| ------------------------ | ----------------------------------------------------------------- |
| `discover_traders`       | Search/filter traders by profit, ROI, win rate, volume, followers |
| `get_trader_performance` | Detailed performance analytics and P\&L history for any trader    |

### Follow Management

| Tool                   | Description                                        |
| ---------------------- | -------------------------------------------------- |
| `list_traders`         | All followed traders with copy settings and stats  |
| `follow_trader`        | Start following a new trader                       |
| `get_trader`           | Details for a single followed trader               |
| `update_trader`        | Change copy percentage, max amount, notifications  |
| `batch_update_traders` | Update up to 100 followed traders in one call      |
| `unfollow_trader`      | Stop following a trader                            |
| `pause_trader`         | Temporarily pause copy-trading without unfollowing |
| `resume_trader`        | Resume paused copy-trading                         |

### Orders & Account

| Tool          | Description                               |
| ------------- | ----------------------------------------- |
| `list_orders` | Paginated orders with status/date filters |
| `get_order`   | Single order by ID                        |
| `get_account` | Account information                       |
| `health`      | API health check                          |

***

## Resources

The MCP server also exposes two read-only resources that AI agents can pull for context without a tool call:

| URI                      | Description                |
| ------------------------ | -------------------------- |
| `carboncopy://portfolio` | Current portfolio snapshot |
| `carboncopy://traders`   | List of followed traders   |

***

## Authentication

Set the `CARBONCOPY_API_KEY` environment variable. The server passes it as a Bearer token on every API call.

Generate a key from [**Settings → API Keys**](https://www.carboncopy.inc/settings). For full agent access, grant `portfolio:read`, `traders:write`, `orders:read`, and `account:read`.

***

## Source Code

The MCP server is open source: [github.com/CarbonCopyInc/carboncopy-mcp](https://github.com/CarbonCopyInc/carboncopy-mcp)
