{"_id":"@carbon-copy/polymarket-mcp","_rev":"3-2240a55e31ee702dd3919a22b9723861","name":"@carbon-copy/polymarket-mcp","dist-tags":{"latest":"0.3.2"},"versions":{"0.1.0":{"name":"@carbon-copy/polymarket-mcp","version":"0.1.0","keywords":["mcp","model-context-protocol","polymarket","stdio","trading"],"license":"MIT","_id":"@carbon-copy/polymarket-mcp@0.1.0","maintainers":[{"name":"bencered","email":"bence@carboncopy.inc"}],"homepage":"https://github.com/CarbonCopyInc/polymarket-mcp#readme","bugs":{"url":"https://github.com/CarbonCopyInc/polymarket-mcp/issues"},"bin":{"polymarket-mcp":"dist/index.js"},"dist":{"shasum":"35bfe3e8fec483b767d50264be2f015ca6f1dbbc","tarball":"https://registry.npmjs.org/@carbon-copy/polymarket-mcp/-/polymarket-mcp-0.1.0.tgz","fileCount":78,"integrity":"sha512-KT4Awcy01akHaxlVMaJIwLRdapsYw40m0cYrjBN0e/ilIIdFFhJeFpW8XicCOaRZgla2V/jdBKC9HdGExsAnUA==","signatures":[{"sig":"MEQCIC3WbE17bpT64jtzY0/WgBoEnFks7CLo05DKmFHOFKp6AiAavOR8/DKjtMXsiDK8TuO3uNWV5SQXsB2LFjjaB3tpKw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":267294},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"1d342bc7e158dd9ee11a523fa81bab8fe494751c","scripts":{"dev":"tsx src/index.ts","test":"npm run build && node --test \"test/**/*.test.mjs\"","build":"tsc -p tsconfig.json","start":"node dist/index.js","prepublishOnly":"npm test"},"_npmUser":{"name":"bencered","email":"bence@carboncopy.inc"},"repository":{"url":"git+https://github.com/CarbonCopyInc/polymarket-mcp.git","type":"git"},"_npmVersion":"11.6.2","description":"Production-grade MCP stdio server for Polymarket APIs and trading workflows","directories":{},"_nodeVersion":"24.11.1","dependencies":{"zod":"^3.24.2","viem":"^2.47.6","@polymarket/sdk":"^8.0.1","@polymarket/clob-client":"^5.8.1","@modelcontextprotocol/sdk":"^1.28.0","@polymarket/relayer-client":"^4.1.0","@polymarket/builder-signing-sdk":"^0.0.8","@polymarket/builder-relayer-client":"^0.0.8"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.0","typescript":"^5.9.2","@types/node":"^24.4.0"},"_npmOperationalInternal":{"tmp":"tmp/polymarket-mcp_0.1.0_1775058905155_0.6468779114750076","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@carbon-copy/polymarket-mcp","version":"0.2.0","keywords":["mcp","model-context-protocol","polymarket","stdio","trading"],"license":"MIT","_id":"@carbon-copy/polymarket-mcp@0.2.0","maintainers":[{"name":"bencered","email":"bence@carboncopy.inc"}],"homepage":"https://github.com/CarbonCopyInc/polymarket-mcp#readme","bugs":{"url":"https://github.com/CarbonCopyInc/polymarket-mcp/issues"},"bin":{"polymarket-mcp":"dist/index.js"},"dist":{"shasum":"0dff62f8c979fe14428eefb6f57b95cbee0efdc1","tarball":"https://registry.npmjs.org/@carbon-copy/polymarket-mcp/-/polymarket-mcp-0.2.0.tgz","fileCount":78,"integrity":"sha512-Oiup8GBVe3KcgcxS7jUPs01JGPN6JPVJFWeDJRbvwGaKsyyQZ+35pHM+gLBSY5aDWfHm5jXpS7Tl4CefWoLQSQ==","signatures":[{"sig":"MEUCIQDgA84OYpRA3swUkPIUPqP8qwWi/o5C/fbnOfKqr/fyaAIgMVG1kXl+eZgQMno7A8EIPLpDQWUVFWk2Nf8xVsevXBQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":269585},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"7fb55a1545ce00259d845dfdae0ccdf709e66a16","scripts":{"dev":"tsx src/index.ts","test":"npm run build && node --test \"test/**/*.test.mjs\"","build":"tsc -p tsconfig.json","start":"node dist/index.js","prepublishOnly":"npm test"},"_npmUser":{"name":"bencered","email":"bence@carboncopy.inc"},"repository":{"url":"git+https://github.com/CarbonCopyInc/polymarket-mcp.git","type":"git"},"_npmVersion":"11.6.2","description":"Production-grade MCP server for Polymarket APIs and trading workflows","directories":{},"_nodeVersion":"24.11.1","dependencies":{"zod":"^3.24.2","viem":"^2.47.6","@polymarket/sdk":"^8.0.1","@polymarket/clob-client":"^5.8.1","@modelcontextprotocol/sdk":"^1.28.0","@polymarket/relayer-client":"^4.1.0","@polymarket/builder-signing-sdk":"^0.0.8","@polymarket/builder-relayer-client":"^0.0.8"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.0","typescript":"^5.9.2","@types/node":"^24.4.0"},"_npmOperationalInternal":{"tmp":"tmp/polymarket-mcp_0.2.0_1775325505994_0.7650988497562046","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@carbon-copy/polymarket-mcp","version":"0.3.2","description":"Production-grade MCP server for Polymarket APIs and trading workflows","type":"module","main":"dist/index.js","types":"dist/index.d.ts","bin":{"polymarket-mcp":"dist/index.js"},"repository":{"type":"git","url":"git+https://github.com/CarbonCopyInc/polymarket-mcp.git"},"homepage":"https://github.com/CarbonCopyInc/polymarket-mcp#readme","bugs":{"url":"https://github.com/CarbonCopyInc/polymarket-mcp/issues"},"keywords":["mcp","model-context-protocol","polymarket","stdio","trading"],"license":"MIT","scripts":{"build":"tsc -p tsconfig.json","start":"node dist/index.js","dev":"tsx src/index.ts","test":"npm run build && node --test \"test/**/*.test.mjs\"","prepublishOnly":"npm test"},"engines":{"node":">=20.0.0"},"dependencies":{"@modelcontextprotocol/sdk":"^1.28.0","@polymarket/builder-relayer-client":"^0.0.9","@polymarket/builder-signing-sdk":"^0.0.8","@polymarket/clob-client":"^5.8.1","@polymarket/sdk":"^8.0.1","viem":"^2.47.6","zod":"^3.24.2"},"devDependencies":{"@types/node":"^24.4.0","tsx":"^4.20.0","typescript":"^5.9.2"},"gitHead":"117b61718e4f423b78d1f0d4039ef423bec3beef","_id":"@carbon-copy/polymarket-mcp@0.3.2","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-SbU5JUUg6swzLfBNkT0RUDM4uexzoW86Nv9VKfRNSfdnqsrbA3OB7yJjA2ZkGsza68sZx1vNfQChPKC6OHypag==","shasum":"ba5eab0e8fca27e5eab3e6f32766e7874db0585b","tarball":"https://registry.npmjs.org/@carbon-copy/polymarket-mcp/-/polymarket-mcp-0.3.2.tgz","fileCount":78,"unpackedSize":270164,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC/c/sPs3a26SGPJ5VZ8vxaMhDGnw4/RTRB9CUjkerWMgIhANfCVx5XOcMP7bkyK0RxXXKJ3Y5K5pFCE/9YMPLVtteL"}]},"_npmUser":{"name":"bencered","email":"bence@carboncopy.inc"},"directories":{},"maintainers":[{"name":"bencered","email":"bence@carboncopy.inc"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/polymarket-mcp_0.3.2_1780181078865_0.31083189398481714"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-01T15:55:05.075Z","modified":"2026-05-30T22:44:39.153Z","0.1.0":"2026-04-01T15:55:05.300Z","0.2.0":"2026-04-04T17:58:26.153Z","0.3.2":"2026-05-30T22:44:39.014Z"},"bugs":{"url":"https://github.com/CarbonCopyInc/polymarket-mcp/issues"},"license":"MIT","homepage":"https://github.com/CarbonCopyInc/polymarket-mcp#readme","keywords":["mcp","model-context-protocol","polymarket","stdio","trading"],"repository":{"type":"git","url":"git+https://github.com/CarbonCopyInc/polymarket-mcp.git"},"description":"Production-grade MCP server for Polymarket APIs and trading workflows","maintainers":[{"name":"bencered","email":"bence@carboncopy.inc"}],"readme":"# polymarket-mcp\n\nThe leading MCP server for Polymarket APIs and trading/relayer workflows.\n\n## Features\n\n- MCP stdio server using `@modelcontextprotocol/sdk`.\n- Public discovery tools for markets/events/search (`list_markets`, `get_market`, `list_events`, `get_event`, `search`).\n- Batched market-data tools (`get_order_books`, `get_prices`, `get_midpoints`, `get_spreads`, `get_last_trade_prices`, `get_price_history`).\n- Canonical auth/trading wrappers (`ensure_api_key`, `prepare_order`, `place_order`, `cancel_orders`, rewards/account wrappers).\n- Relayer and builder-relayer execution tools.\n- Bridge tools and unified transaction builder (`build_transactions`).\n- Canonical wrappers expose rich `listTools()` schemas/descriptions so agents can discover required fields, auth level (L1 vs L2), and destructive confirmation guards from MCP introspection.\n- Safe, structured JSON tool envelopes.\n- Runtime resources (`polymarket://status`, `polymarket://contracts`, `polymarket://endpoints`) plus market resource templates.\n- Agent-ready prompts for market analysis, portfolio review, and execution checklist.\n- Multi-layer test matrix (smoke, integration, unit).\n\n## Install (published package)\n\nGlobal install:\n\n```bash\nnpm install -g @carbon-copy/polymarket-mcp\n```\n\nOne-off execution without global install:\n\n```bash\nnpx -y @carbon-copy/polymarket-mcp\n```\n\n## MCP client setup (recommended)\n\nClaude CLI one-command setup:\n\n```bash\nclaude mcp add polymarket -- npx -y @carbon-copy/polymarket-mcp\n```\n\nClaude Desktop MCP config (stdio via `npx`):\n\n```json\n{\n  \"mcpServers\": {\n    \"polymarket\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@carbon-copy/polymarket-mcp\"],\n      \"env\": {\n        \"POLYMARKET_CHAIN_ID\": \"137\"\n      }\n    }\n  }\n}\n```\n\nInstalled binary variant (after global install):\n\n```json\n{\n  \"mcpServers\": {\n    \"polymarket\": {\n      \"command\": \"polymarket-mcp\",\n      \"env\": {\n        \"POLYMARKET_CHAIN_ID\": \"137\"\n      }\n    }\n  }\n}\n```\n\n## Local development (run from source)\n\nUse repository checkout when developing or modifying the server:\n\n```bash\ngit clone https://github.com/CarbonCopyInc/polymarket-mcp.git\ncd polymarket-mcp\nnpm install\nnpm run build\nnode dist/index.js\n```\n\n## Build\n\n```bash\nnpm run build\n```\n\n## Test\n\n```bash\nnpm test\n```\n\n`npm test` runs `npm run build` and then executes all tests under `test/**/*.test.mjs`.\n\nTest layers:\n\n- `test/smoke/stdio.smoke.test.mjs`\n  - Top-level real-server MCP verification over stdio transport.\n  - Confirms only the canonical simplified tool inventory is exposed.\n  - Exercises representative public/auth/bridge/builder/relayer calls and destructive guardrails.\n- `test/integration/tool-flows.integration.test.mjs`\n  - Focused tool-layer integration with stubbed clients for mapper/guard/normalization behavior.\n  - Covers canonical order/reward/relayer/builder/tx-builder behavior.\n- `test/integration/clients.integration.test.mjs`\n  - Polymarket client integration around auth cache invalidation, builder-relayer tx type handling, and bridge base-url normalization.\n- `test/integration/live-env-gated.integration.test.mjs`\n  - External-network integration smoke for authenticated, relayer, and bridge flows.\n  - Assertions are env-gated and network-tolerant: missing credentials or transient network failures become diagnostics, not hard failures.\n- `test/unit/env-config.unit.test.mjs`\n- `test/unit/helpers.unit.test.mjs`\n- `test/unit/schemas-results.unit.test.mjs`\n  - Unit coverage for env/config normalization, canonical schema/result helpers, confirm guard logic, bigint parsing/stringification, and transaction-shape utilities.\n\n## Run the server (local repository workflow)\n\nRepo build output:\n\n```bash\nnpm run build\nnpm start\n```\n\nGlobal npm install:\n\n```bash\npolymarket-mcp\n```\n\nOne-off without global install:\n\n```bash\nnpx -y @carbon-copy/polymarket-mcp\n```\n\nAll commands above start the MCP server on stdio via `dist/index.js`.\n\n## Publish (maintainers)\n\n```bash\nnpm run build\nnpm test\nnpm publish\n```\n\nThe published package includes only `dist/`, `README.md`, and `LICENSE` (plus npm-required metadata files).\n\n## Environment variables\n\nCore runtime:\n\n- `POLYMARKET_RPC_URL` (optional)\n- `POLYMARKET_CHAIN_ID` (default: `137`, supports `80002`)\n- `POLYMARKET_SIGNATURE_TYPE` (default: `0`)\n- `POLYMARKET_RELAYER_URL` (default: `https://relayer-v2.polymarket.com`)\n- `POLYMARKET_RELAYER_TX_TYPE` (optional)\n- `POLYMARKET_CLOB_URL` (default: `https://clob.polymarket.com`)\n- `POLYMARKET_GAMMA_URL` (default: `https://gamma-api.polymarket.com`)\n- `POLYMARKET_BRIDGE_URL` (default: `https://bridge.polymarket.com`)\n\nAuth-related env names:\n\n- `POLYMARKET_ADDRESS`\n- `POLYMARKET_PRIVATE_KEY`\n- `POLYMARKET_FUNDER_ADDRESS`\n- `POLYMARKET_API_KEY`\n- `POLYMARKET_API_SECRET`\n- `POLYMARKET_API_PASSPHRASE`\n- `POLYMARKET_BUILDER_API_KEY`\n- `POLYMARKET_BUILDER_API_SECRET`\n- `POLYMARKET_BUILDER_API_PASSPHRASE`\n- `POLYMARKET_BUILDER_AUTH_HEADER`\n- `POLYMARKET_GEOBLOCK_TOKEN`\n- `POLYMARKET_USER_AGENT`\n\n## Operator notes\n\n- If auth env is absent, authenticated checks are intentionally skipped (with diagnostics) in smoke/integration tests.\n- If builder credentials are absent, builder-relayer live integration checks are skipped.\n- Live-network integration assertions are env-gated and external-dependency tolerant.\n- Public stdio smoke checks remain mandatory and are always executed.\n","readmeFilename":"README.md"}