Skip to main content

MCP server

The Context MCP server gives AI agents direct access to prediction markets through the Model Context Protocol. Browse markets, read orderbooks, place trades, and manage portfolios — all through natural language.

25 tools

Market data, trading, portfolio, and account management

Zero-config read-only

Browse markets and get quotes without any API key

Any MCP client

Works with Claude, Cursor, VS Code, Windsurf, and more

Installation

claude mcp add context-markets -- npx context-markets-mcp
Credentials are stored in ~/.config/context/config.env and shared with the CLI. Run context setup to configure your wallet, or set CONTEXT_API_KEY and CONTEXT_PRIVATE_KEY as environment variables.

Getting started

Once the MCP server is installed, follow these steps to start trading:
  1. Generate a wallet — use context_generate_wallet to create or import a wallet. Keys are saved to the shared config automatically.
  2. Fund your wallet — send ETH on Base to your wallet address for gas fees.
  3. Approve contracts — run context_account_setup to approve the required contracts for trading.
  4. Deposit USDC — use context_deposit to deposit USDC into your trading account.
You can skip these steps and start with read-only access. Browse markets, view orderbooks, and get quotes without any wallet or API key.

API key setup

  • Read-only tools work without any API key — browse markets, get quotes, view orderbooks
  • Set CONTEXT_API_KEY for authenticated endpoints, or store it in ~/.config/context/config.env
  • Set CONTEXT_PRIVATE_KEY for trading (order placement, cancellation, deposits), or store it in the shared config
API keys are optional for read-only access. When you need to trade, the easiest way to configure credentials is by running context setup, which writes them to the shared config file (chmod 600).

Network

The MCP server defaults to mainnet. To use testnet, set the CONTEXT_CHAIN environment variable to "testnet" or add it to your ~/.config/context/config.env. See the Testnet guide.

Tool catalog

Browse all 25 available tools organized by category