# How to integrate Polymarket US MCP with Codex

```json
{
  "title": "How to integrate Polymarket US MCP with Codex",
  "toolkit": "Polymarket US",
  "toolkit_slug": "polymarket_us",
  "framework": "Codex",
  "framework_slug": "codex",
  "url": "https://composio.dev/toolkits/polymarket_us/framework/codex",
  "markdown_url": "https://composio.dev/toolkits/polymarket_us/framework/codex.md",
  "updated_at": "2026-06-18T09:59:57.249Z"
}
```

## Introduction

Codex is one of the most popular coding harnesses out there. And MCP makes the experience even better. With Polymarket US MCP integration, you can draft, triage, summarise emails, and much more, all without leaving the terminal or the app, whichever you prefer.

## Also integrate Polymarket US with

- [Claude Cowork](https://composio.dev/toolkits/polymarket_us/framework/claude-cowork)

## TL;DR

### Why use Composio?
Apart from a managed and hosted MCP server, you will get:
- CodeAct: A dedicated workbench that allows GPT to write its code to handle complex tool chaining. Reduces to-and-fro with LLMs for frequent tool calling.
- Large tool responses: Handle them to minimise context rot.
- Dynamic just-in-time access to 20,000 tools across 1000+ other Apps for cross-app workflows. It loads the tools you need, so GPTs aren't overwhelmed by tools you don't need.

## Connect Polymarket US to Codex

### How to install Polymarket US MCP in Codex
### Run the setup command
Run this command in your terminal to add the Composio MCP server to Codex.

```bash
codex mcp add composio --url https://connect.composio.dev/mcp
```

## What is the Polymarket US MCP server, and what's possible with it?

The Polymarket US MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Polymarket US account. It provides structured and secure access so your agent can perform Polymarket US operations on your behalf.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `POLYMARKET_US_CANCEL_ALL_OPEN_ORDERS` | Cancel All Open Orders | Cancel all authenticated Polymarket US open orders, optionally scoped to specific market slugs. This is broad and destructive for remaining open quantities; omit slugs only when the user clearly asks to cancel every open order. Already executed fills and positions remain, so verify open orders afterward when confirmation matters. |
| `POLYMARKET_US_CANCEL_MULTIPLE_ORDERS` | Cancel Multiple Orders | Cancel up to 20 Polymarket US open orders in one request. Use only when the user explicitly asks to cancel the batch. Cancellation removes remaining open quantity but does not undo fills or positions, and batch responses can require per-order follow-up reads to verify final state. |
| `POLYMARKET_US_CANCEL_ORDER` | Cancel Order | Cancel one Polymarket US open order by exchange-assigned order ID. This is a destructive mutation of the remaining open quantity and should only be used when the user explicitly asks to cancel. Already executed fills and resulting positions remain; confirm order state afterward when precision matters. |
| `POLYMARKET_US_CLOSE_POSITION_ORDER` | Close Position Order | Create a live Polymarket US order intended to close an existing position in one market. Use only when the user explicitly asks to close that position. This can trade immediately, leave residual exposure if not fully filled, or be rejected for market, liquidity, risk, or funding checks; inspect the returned order state before confirming the position is closed. |
| `POLYMARKET_US_CREATE_MULTIPLE_ORDERS` | Create Multiple Orders | Submit up to 20 live Polymarket US orders in one request. Use only after the user explicitly asks to place the batch and, when practical, after previewing the same orders. This mutating action can consume buying power and create exposure across multiple markets; read per-order statuses because a batch can contain accepted, filled, and rejected orders. |
| `POLYMARKET_US_CREATE_ORDER` | Create Order | Submit one live Polymarket US order. Use Preview Order first unless the user has already reviewed the exact order details. This mutating action can reserve buying power, fill immediately, or create real market exposure; the API may also reject the order for funding, price, market, or risk checks, so inspect the returned status before confirming placement. |
| `POLYMARKET_US_GET_ACCOUNT_BALANCES` | Get Account Balances | Get the authenticated user's Polymarket US account balances. Use this read-only action to inspect buying power, balances, pending credits, and funds reserved by open orders before previewing or placing orders. Requires Polymarket US signed authentication and returns only the signed-in account's balances. |
| `POLYMARKET_US_GET_ACTIVITIES` | Get Activities | Get authenticated Polymarket US portfolio activities such as trades, resolutions, deposits, withdrawals, referral bonuses, and transfers. Requires Polymarket US signed authentication and returns activity only for that account. Use type filters and sortOrder carefully when paging through history. |
| `POLYMARKET_US_GET_EVENT_BY_ID` | Get Event By ID | Get one Polymarket US event by numeric ID from the public gateway API. Use this after discovery when the caller already has the integer event ID and needs full event details or associated market references. Do not pass slugs here; use Get Event By Slug for slugs. This read-only action does not require API key authentication. |
| `POLYMARKET_US_GET_EVENT_BY_SLUG` | Get Event By Slug | Get one Polymarket US event by slug from the public gateway API. Use this after search/list discovery or when parsing a Polymarket event URL. Do not pass numeric IDs here; use Get Event By ID for integer IDs. This read-only action does not require API key authentication. |
| `POLYMARKET_US_GET_LEAGUE_BY_SLUG` | Get League By Slug | Get a current Polymarket US v2 league by slug. Use List Leagues or Get Sport By Slug first if the slug is unknown. This is useful for confirming league metadata before listing events for a league such as "nba" or "nfl". This action does not require API key authentication. |
| `POLYMARKET_US_GET_MARKET_BBO` | Get Market BBO | Get the best bid and offer for one Polymarket US market by slug. Use this lightweight top-of-book read before quoting, previewing, or explaining an order. If the agent needs depth or slippage context, use Get Market Book instead. The response is market data, not an order placement or order preview. This endpoint requires the market slug, not the numeric market ID, and does not require API key authentication. |
| `POLYMARKET_US_GET_MARKET_BOOK` | Get Market Book | Get the public order book for one Polymarket US market by slug. Use this before quoting, previewing, or explaining an order when the agent needs depth beyond the top of book. The response is market data, not an order placement or order preview. This endpoint requires the market slug, not the numeric market ID, and does not require API key authentication. |
| `POLYMARKET_US_GET_MARKET_BY_ID` | Get Market By ID | Get one Polymarket US market by numeric ID from the public gateway API. Use this after market discovery when the caller already has the integer market ID and needs full market metadata. Do not pass slugs here; use Get Market By Slug for slugs. For current pricing before an order, follow with Get Market BBO or Get Market Book. This read-only action does not require API key authentication. |
| `POLYMARKET_US_GET_MARKET_BY_SLUG` | Get Market By Slug | Get one Polymarket US market by slug from the public gateway API. Use this after search/list discovery or when parsing a Polymarket market URL. Do not pass numeric IDs here; use Get Market By ID for integer IDs. For current pricing before quoting, previewing, or placing an order, follow with Get Market BBO or Get Market Book. This read-only action does not require API key authentication. |
| `POLYMARKET_US_GET_MARKET_SETTLEMENT` | Get Market Settlement | Get settlement information for one Polymarket US market by slug. Use this only for resolved, closed, or historical market workflows where the caller needs public resolution or settlement details. It is not useful for discovering current markets or preparing trades on active markets. This endpoint requires the market slug, not the numeric market ID, and does not require API key authentication. |
| `POLYMARKET_US_GET_MARKETS_FOR_SUBJECT` | Get Markets For Subject | Discover Polymarket US markets associated with a subject ID. Use this action after List Subjects or Get Subject By ID identifies the team, person, candidate, player, nominee, or other entity the user cares about. This is a market discovery tool, not a subject metadata lookup. This action does not require API key authentication. |
| `POLYMARKET_US_GET_MARKETS_FOR_SUBJECT_BY_SLUG` | Get Markets For Subject By Slug | Discover Polymarket US markets associated with a subject slug. Use this action after List Subjects, Get Subject By Slug, or a Polymarket URL identifies the team, person, candidate, player, nominee, or other entity the user cares about. This is a market discovery tool, not a subject metadata lookup. This action does not require API key authentication. |
| `POLYMARKET_US_GET_OPEN_ORDERS` | Get Open Orders | Get all open orders for the authenticated Polymarket US user. Use this read-only action before modifying or canceling orders, or to inspect live order exposure. Requires signed authentication, supports optional market slug filters, and does not place, modify, or cancel orders. |
| `POLYMARKET_US_GET_ORDER` | Get Order | Get an authenticated user's Polymarket US order by exchange-assigned order ID. Requires signed authentication and returns order details available to that account. Use this read-only action to inspect order state after creating, modifying, or canceling an order. |
| `POLYMARKET_US_GET_SERIES_BY_ID` | Get Series By ID | Get a Polymarket US series by numeric ID. Series are recurring or grouped event collections. Use this action when an agent has a series ID and needs the slug, active status, recurrence, or other public metadata before fetching related events or markets. This action does not require API key authentication. |
| `POLYMARKET_US_GET_SPORT_BY_SLUG` | Get Sport By Slug | Get a current Polymarket US v2 sport by slug. Use List Sports first if the slug is unknown. The response includes the sport metadata and leagues attached to that sport, which helps agents move from broad sport browsing to league-specific event discovery. This action does not require API key authentication. |
| `POLYMARKET_US_GET_SUBJECT_BY_ID` | Get Subject By ID | Get a Polymarket US subject entity by numeric ID. Subjects represent teams, people, candidates, players, nominees, and other named entities attached to markets. Use this action when an agent already has a subject ID and needs its slug, type, or display metadata. This action does not require API key authentication. |
| `POLYMARKET_US_GET_SUBJECT_BY_SLUG` | Get Subject By Slug | Get a Polymarket US subject entity by slug. Subjects represent teams, people, candidates, players, nominees, and other named entities attached to markets. Use this action when an agent has a subject slug from a URL or search result and needs the subject ID or display metadata. This action does not require API key authentication. |
| `POLYMARKET_US_GET_TAG_BY_ID` | Get Tag By ID | Get a Polymarket US topic, sport, or league tag by numeric ID. Use this action after List Tags or a market/event response returns a tag ID and the agent needs the tag label, slug, hierarchy, or sport/league metadata for filtering or display. This action does not require API key authentication. |
| `POLYMARKET_US_GET_TAG_BY_SLUG` | Get Tag By Slug | Get a Polymarket US topic, sport, or league tag by slug. Use this action when an agent has a URL-safe tag slug, such as nba or sports, and needs the tag ID, label, hierarchy, or sport/league metadata for filtering or display. This action does not require API key authentication. |
| `POLYMARKET_US_GET_USER_POSITIONS` | Get User Positions | Get the authenticated user's Polymarket US trading positions across all markets or filtered by a specific market slug. Requires Polymarket US signed authentication and only returns positions for that account. Use this read-only action to verify API credentials and inspect current exposure. |
| `POLYMARKET_US_LIST_EVENTS` | List Events | Discover Polymarket US events from the public gateway API. Use this action before event-specific lookups when starting from a topic, category, tag, or broad filter set. Practical guidance for agents: - For currently relevant events, start with active=true, closed=false, and archived=false, then paginate with limit and offset. - Pass numeric event IDs in id and event slugs in slug; do not mix the two identifier types. - Events may contain related markets, but use market-specific actions for market details, order books, BBO, settlement, or order preparation. - This read-only discovery action does not require Polymarket API key auth. |
| `POLYMARKET_US_LIST_EVENTS_FOR_LEAGUE` | List Events For League | List Polymarket US events for a current v2 league slug such as "nba" or "nfl". Use List Leagues or Get Sport By Slug first if the slug is unknown. Supports limit/offset pagination, excludeEventId for de-duplicating already-seen events, and optional type/section filters. This action does not require API key authentication. |
| `POLYMARKET_US_LIST_EVENTS_FOR_SERIES` | List Events For Series | List Polymarket US sports events for a legacy v1 series ID. Prefer List Events For Sport or List Events For League for current v2 browsing. Use this action when an agent already has a series ID from a legacy sports workflow and needs related events. Supports limit/offset pagination, excludeEventId for de-duplicating already-seen events, and optional type/section filters. This action does not require API key authentication. |
| `POLYMARKET_US_LIST_EVENTS_FOR_SPORT` | List Events For Sport | List Polymarket US events for a current v2 sport slug such as "football" or "basketball". Use List Sports first if the slug is unknown. Supports limit/offset pagination, excludeEventId for de-duplicating already-seen events, and optional type/section filters. This action does not require API key authentication. |
| `POLYMARKET_US_LIST_FEATURED_TAGS` | List Featured Tags | List featured Polymarket US tag sections from the public gateway API. Featured tags are curated browse sections, often with subtags, intended for discovery UI and recommendation flows rather than exhaustive filtering. Use List Tags when the agent needs the full searchable tag set. This action does not require API key authentication. |
| `POLYMARKET_US_LIST_LEAGUES` | List Leagues | List current Polymarket US sports leagues from the v2 public gateway API. This is the preferred action for discovering league slugs such as "nfl" or "nba" before calling Get League By Slug or List Events For League. Supports limit/offset pagination with a maximum page size of 50. This action does not require API key authentication. |
| `POLYMARKET_US_LIST_MARKETS` | List Markets | Discover Polymarket US markets from the public gateway API. Use this action when an agent needs candidate market slugs or IDs before reading market details, order books, best bid/offer, or preparing orders. Practical guidance for agents: - For currently tradable candidates, start with active=true, closed=false, and archived=false, then paginate with limit and offset. - Pass numeric market IDs in id and market slugs in slug; do not mix the two identifier types. - Discovery results are not a substitute for live pricing. Before quoting, previewing, or placing an order, read Get Market BBO for top-of-book or Get Market Book for depth. - This read-only discovery action does not require Polymarket API key auth. |
| `POLYMARKET_US_LIST_SERIES` | List Series | List Polymarket US series from the public gateway API. Series are recurring or grouped event collections, such as seasonal or repeated sports event groupings. Use this action to discover a series ID or slug before fetching related events or markets with series-aware tools. This action does not require API key authentication. |
| `POLYMARKET_US_LIST_SPORTS` | List Sports | List Polymarket US sports from the current v2 public gateway API. Use this for sports browsing and for discovering sport slugs such as "football" or "basketball" before calling Get Sport By Slug or List Events For Sport. This action does not require API key authentication. |
| `POLYMARKET_US_LIST_SPORTS_TEAMS` | List Sports Teams | List Polymarket US sports teams from the legacy v1 public gateway API. Use this action when an agent needs team metadata for sports events or needs to filter teams by league, name, abbreviation, or Polymarket team ID. The Pydantic filter fields named filters_* are translated to the dotted API query names filters.league, filters.name, filters.abbreviation, and filters.id. This action does not require API key authentication. |
| `POLYMARKET_US_LIST_SPORTS_TEAMS_FOR_PROVIDER` | List Sports Teams For Provider | List Polymarket US legacy v1 sports team mappings for a data provider. Use this action when an agent needs provider-specific team IDs for SportsDataIO or Sportradar integrations. Pass provider as the enum value "PROVIDER_SPORTSDATAIO" or "PROVIDER_SPORTRADAR"; optionally narrow by Polymarket teamIds and league slug. This action does not require API key authentication. |
| `POLYMARKET_US_LIST_SUBJECTS` | List Subjects | List Polymarket US subject entities from the public gateway API. Subjects are teams, people, candidates, players, nominees, or other named entities that markets can be about. Use this action to discover the subject ID or slug before calling the subject market lookup tools. This action does not require API key authentication. |
| `POLYMARKET_US_LIST_TAGS` | List Tags | List ranked Polymarket US tags from the public gateway API. Tags are topic, sport, league, and browse filters that agents can use to narrow event or market discovery before calling event and market listing tools. Use parentSlug="sports" to discover sports and league tags. This action does not require API key authentication. |
| `POLYMARKET_US_MODIFY_MULTIPLE_ORDERS` | Modify Multiple Orders | Modify up to 20 Polymarket US open orders in one request. Use only when the user explicitly asks to change the batch. These live cancel-replace style mutations can change funding requirements, exposure, maker-only behavior, queue priority, and fill risk; the response can be partial, so confirm per-order state after modification when accuracy matters. |
| `POLYMARKET_US_MODIFY_ORDER` | Modify Order | Modify one existing Polymarket US open order. This is a live cancel-replace style mutation and should only be used when the user explicitly asks to change an order. It can alter exposure, required funds, queue priority, and fill behavior; verify the updated order state after the request when confirmation matters. |
| `POLYMARKET_US_PREVIEW_ORDER` | Preview Order | Preview a Polymarket US order without submitting it to the market. Use this signed, read-only action before live order creation to validate parameters and inspect the calculated order response. It requires Polymarket US signed authentication but does not create, modify, cancel, or reserve funds for an order. |
| `POLYMARKET_US_SEARCH_MARKETS_AND_EVENTS` | Search Markets And Events | Search public Polymarket US markets and events for discovery. Use this for natural-language discovery when an agent needs candidate market or event slugs/IDs before calling specific market/event endpoints. Search results should not be treated as live pricing or trading readiness: after selecting a market, read the market details and then Get Market BBO or Get Market Book before quoting, previewing, or placing an order. Use page and limit to paginate. This read-only action does not require API key authentication. |

## Supported Triggers

None listed.

## Creating MCP Server - Stand-alone vs Composio SDK

The Polymarket US MCP server provides comprehensive access to Polymarket US operations through Composio. Once connected, you can perform all major Polymarket US actions directly from Codex using natural language commands.

## Complete Code

None listed.

## Conclusion

### Conclusion
You've successfully integrated Polymarket US with Codex using Composio's MCP server. Now you can interact with Polymarket US directly from your terminal, VS Code, or the Codex App using natural language commands.
Key benefits of this setup:
- Seamless integration across CLI, VS Code, and standalone app
- Natural language commands for Polymarket US operations
- Managed authentication through Composio
- Access to 20,000+ tools across 1000+ apps for cross-app workflows
- CodeAct workbench for complex tool chaining
Next steps:
- Try asking Codex to perform various Polymarket US operations
- Explore cross-app workflows by connecting more toolkits
- Build automation scripts that leverage Codex's AI capabilities

## How to build Polymarket US MCP Agent with another framework

- [Claude Cowork](https://composio.dev/toolkits/polymarket_us/framework/claude-cowork)

## Related Toolkits

- [Stripe](https://composio.dev/toolkits/stripe) - Stripe is a global online payments platform offering APIs for managing payments, customers, and subscriptions. Trusted by businesses for secure, efficient, and scalable payment processing worldwide.
- [Alpaca](https://composio.dev/toolkits/alpaca) - Alpaca is a stock and crypto trading platform for commission-free trading, real-time market data, and algorithmic strategies. Use it to build brokerage apps, trading bots, and portfolio workflows with market connectivity.
- [Alpha vantage](https://composio.dev/toolkits/alpha_vantage) - Alpha Vantage is a financial data platform offering real-time and historical stock market APIs. Get instant, reliable access to equities, forex, and technical analysis data for smarter trading decisions.
- [Altoviz](https://composio.dev/toolkits/altoviz) - Altoviz is a cloud-based billing and invoicing platform for businesses. It streamlines online payments, expense tracking, and customizable invoice management.
- [Benzinga](https://composio.dev/toolkits/benzinga) - Benzinga provides real-time financial news and data APIs for market coverage. It helps you track breaking news and actionable market insights instantly.
- [Brex](https://composio.dev/toolkits/brex) - Brex provides corporate credit cards and spend management tailored for startups and tech businesses. It helps optimize company cash flow, streamline accounting, and accelerate business growth.
- [Chaser](https://composio.dev/toolkits/chaser) - Chaser is accounts receivable automation software that sends invoice reminders and helps businesses get paid faster. It streamlines the collections process to save time and improve cash flow.
- [Clientary](https://composio.dev/toolkits/clientary) - Clientary is a platform for managing clients, invoices, projects, proposals, and more. It streamlines client work and saves you serious admin time.
- [Coinbase](https://composio.dev/toolkits/coinbase) - Coinbase is a platform for buying, selling, and storing cryptocurrency. It makes exchanging and managing crypto simple and secure for everyone.
- [Coinranking](https://composio.dev/toolkits/coinranking) - Coinranking is a comprehensive cryptocurrency market data platform offering access to real-time coin prices, market caps, and historical data. Get accurate, up-to-date stats for thousands of digital assets in one place.
- [Coupa](https://composio.dev/toolkits/coupa) - Coupa is a business spend management platform for procurement, invoicing, and expenses. It helps organizations streamline purchasing, control costs, and gain complete visibility over financial operations.
- [CurrencyScoop](https://composio.dev/toolkits/currencyscoop) - CurrencyScoop is a developer-friendly API for real-time and historical currency exchange rates. Easily access fiat and crypto data for smart, up-to-date financial applications.
- [Daffy](https://composio.dev/toolkits/daffy) - Daffy is a modern charitable giving platform with a donor-advised fund. Easily set aside funds, grow them tax-free, and donate to over 1.7 million U.S. charities.
- [Eagle doc](https://composio.dev/toolkits/eagle_doc) - Eagle doc is an AI-powered OCR API for invoices and receipts. It delivers fast, reliable, and accurate document data extraction for seamless automation.
- [Elorus](https://composio.dev/toolkits/elorus) - Elorus is an online invoicing and time-tracking software for freelancers and small businesses. Easily manage finances, bill clients, and track work in one place.
- [Eodhd apis](https://composio.dev/toolkits/eodhd_apis) - Eodhd apis delivers comprehensive financial data, including live and historical stock prices, via robust APIs. Easily access reliable, up-to-date market insights to power your apps, dashboards, and analytics.
- [Fidel api](https://composio.dev/toolkits/fidel_api) - Fidel api is a secure platform for linking payment cards to web and mobile apps. It enables real-time card transaction monitoring and event-based automation for businesses.
- [Finage](https://composio.dev/toolkits/finage) - Finage is a secure API platform delivering real-time and historical financial data for stocks, forex, crypto, indices, and commodities. It empowers developers and businesses to access, analyze, and act on market data instantly.
- [Finmei](https://composio.dev/toolkits/finmei) - Finmei is an invoicing tool that simplifies billing, invoice management, and expense tracking. Ideal for automating and organizing your business finances in one place.
- [Fixer](https://composio.dev/toolkits/fixer) - Fixer is a currency data API offering real-time and historical exchange rates for 170 currencies. Instantly access accurate, up-to-date forex data for your applications and workflows.

## Frequently Asked Questions

### What are the differences in Tool Router MCP and Polymarket US MCP?

With a standalone Polymarket US MCP server, the agents and LLMs can only access a fixed set of Polymarket US tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Polymarket US and many other apps based on the task at hand, all through a single MCP endpoint.

### Can I use Tool Router MCP with Codex?

Yes, you can. Codex fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Polymarket US tools.

### Can I manage the permissions and scopes for Polymarket US while using Tool Router?

Yes, absolutely. You can configure which Polymarket US scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

### How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Polymarket US data and credentials are handled as safely as possible.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
