> ## 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.

# Polymarket MCP Quickstart

> Set up @carbon-copy/polymarket-mcp in an MCP client, connect over stdio, and configure runtime/auth environment variables.

## Recommended path: one-command MCP client setup

Use the published package `@carbon-copy/polymarket-mcp` as the default install path.

### Claude CLI

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
claude mcp add polymarket -- npx -y @carbon-copy/polymarket-mcp
```

### Claude Desktop config

Add a local stdio server entry to your Claude Desktop MCP config:

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

### Installed binary variant

If you prefer a globally installed executable:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
npm install -g @carbon-copy/polymarket-mcp
polymarket-mcp
```

Example config:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "mcpServers": {
    "polymarket": {
      "command": "polymarket-mcp",
      "env": {
        "POLYMARKET_CHAIN_ID": "137"
      }
    }
  }
}
```

## How the connection works

The package runs as a local MCP server over **stdio**.

Your MCP client launches one of these commands:

* `npx -y @carbon-copy/polymarket-mcp`
* `polymarket-mcp`

No HTTP server is required for normal client integration.

## Environment variables

`@carbon-copy/polymarket-mcp` can start with no secrets for public market discovery. Add credentials only for account, trading, rewards, relayer, or builder-relayer workflows.

### Required for basic startup

* None.

### Common runtime variables (optional)

| Variable                     | Default                             | Notes                                                        |
| ---------------------------- | ----------------------------------- | ------------------------------------------------------------ |
| `POLYMARKET_CHAIN_ID`        | `137`                               | Supports `137` (Polygon) and `80002` (Amoy).                 |
| `POLYMARKET_SIGNATURE_TYPE`  | `0` (`EOA`)                         | Accepts `EOA`, `POLY_PROXY`, `POLY_GNOSIS_SAFE`, or `0/1/2`. |
| `POLYMARKET_RPC_URL`         | none                                | Optional RPC override.                                       |
| `POLYMARKET_CLOB_URL`        | `https://clob.polymarket.com`       | CLOB REST base URL.                                          |
| `POLYMARKET_GAMMA_URL`       | `https://gamma-api.polymarket.com`  | Gamma REST base URL.                                         |
| `POLYMARKET_BRIDGE_URL`      | `https://bridge.polymarket.com`     | Bridge REST base URL.                                        |
| `POLYMARKET_RELAYER_URL`     | `https://relayer-v2.polymarket.com` | Relayer base URL.                                            |
| `POLYMARKET_RELAYER_TX_TYPE` | none                                | Optional relayer tx type override.                           |

### Auth variables (optional, feature-gated)

| Capability area           | Variables                                                                                                                                                                                  |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| L1 signing readiness      | `POLYMARKET_PRIVATE_KEY` (alias: `PRIVATE_KEY`)                                                                                                                                            |
| L2 API auth readiness     | `POLYMARKET_API_KEY`, `POLYMARKET_API_SECRET`, `POLYMARKET_API_PASSPHRASE`                                                                                                                 |
| Builder-relayer readiness | `POLYMARKET_BUILDER_API_KEY`, `POLYMARKET_BUILDER_API_SECRET`, `POLYMARKET_BUILDER_API_PASSPHRASE`                                                                                         |
| Optional extras           | `POLYMARKET_ADDRESS`, `POLYMARKET_FUNDER` (aliases: `FUNDER_ADDRESS`, `POLYMARKET_FUNDER_ADDRESS`), `POLYMARKET_BUILDER_AUTH_HEADER`, `POLYMARKET_GEOBLOCK_TOKEN`, `POLYMARKET_USER_AGENT` |

<Note>
  Public discovery tools work without auth. Auth-backed wrappers such as `ensure_api_key`, `get_open_orders`, `place_order`, `get_rewards`, and relayer execution flows require the relevant credentials.
</Note>

## Minimal smoke check

After connecting in your MCP client, run these in order:

1. `health_check`
2. `list_markets` with `{ "view": "simplified", "mode": "sampling" }`
3. `search` with `{ "q": "election", "limit": 5 }`
4. `get_prices` with `{ "items": [{ "token_id": "<token_id>", "side": "BUY" }] }`
5. read `polymarket://status` if your client supports resources

This verifies stdio transport, canonical market discovery, pluralized market-data tools, and runtime status visibility.

## Local development only: run from source

Use a source checkout only when you need to inspect or modify the server locally.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
git clone https://github.com/CarbonCopyInc/polymarket-mcp.git
cd polymarket-mcp
npm install
npm run build
node dist/index.js
```

For active development:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
npm run dev
```

Use source checkout for local iteration, not as the default end-user install path.

## Next steps

* [Polymarket MCP Overview](/polymarket-mcp/overview)
* [Capabilities Reference](/polymarket-mcp/capabilities-reference)
* [Workflow: Market Analysis](/polymarket-mcp/workflows-market-analysis)
