Overview
Context provides a remote MCP server that exposes the entire marketplace — Query, Execute, and Discover — through the Model Context Protocol. Any agent that supports Streamable HTTP MCP servers can connect in under a minute. Three tools are available:| Tool | What it does |
|---|---|
context_query | Run an agentic Q&A query against the marketplace and get a grounded answer with evidence |
context_execute | Call a specific marketplace tool method directly and get the structured result |
context_discover | Search the marketplace for available tools before querying or executing |
The MCP server wraps the same Query and Execute APIs that the TypeScript and Python SDKs use. Authentication is the same
sk_live_... API key you already have.Prerequisites
Before connecting, complete setup at ctxprotocol.com:Endpoint
Authorization: Bearer sk_live_... header on every request.
Setup by Agent
Cursor
Add to your project’s.cursor/mcp.json (or your global MCP settings):
Claude Code
OpenClaw / Claw Code
Add to your project’smcp.json or pass via CLI:
Any MCP Client (Generic)
Any client that supports Streamable HTTP transport can connect by pointing to:- URL:
https://www.ctxprotocol.com/api/mcp - Transport: Streamable HTTP
- Auth header:
Authorization: Bearer sk_live_YOUR_KEY
Mcp-Session-Id header after initialization. Clients that support session persistence should send it back on subsequent requests.
Tools Reference
context_query
Ask a natural-language question and get a grounded answer powered by the full marketplace.| Parameter | Type | Required | Description |
|---|---|---|---|
question | string | Yes | The question to answer (1–4000 chars) |
toolIds | string[] | No | Restrict query to specific tool UUIDs |
clarificationPolicy | "return" | "auto" | "error" | No | How to handle ambiguous queries |
queryDepth | "fast" | "auto" | "deep" | No | Controls how many tool calls the engine uses |
Use the context_query tool to answer: “What are the top Polymarket markets by volume right now?”The response includes the answer text, structured evidence, and metadata.
context_execute
Call a specific tool method with explicit arguments. Useful when your agent already knows which tool it wants.| Parameter | Type | Required | Description |
|---|---|---|---|
toolId | string (UUID) | Yes | The marketplace tool ID |
toolName | string | Yes | The method name to call |
args | object | No | Arguments for the method |
sessionId | string (UUID) | No | Execution session for spend tracking |
maxSpendUsd | string | No | Cap spend for this session |
closeSession | boolean | No | Close the execution session after this call |
context_discover
Search the marketplace to find tools before querying or executing.| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | No | Search term |
limit | number | No | Max results (1–20, default 10) |
mode | "query" | "execute" | No | Filter by mode |
Example Workflows
Simple Q&A (one tool call)
Tell your agent:Use context_query to find out which Kalshi markets have the highest open interest today.The engine discovers relevant tools, executes the agentic pipeline, and returns a complete answer.
Discovery → Execute (agent-driven loop)
For full control, your agent can:- Call
context_discoverwith a search query - Inspect the returned tools and methods
- Call
context_executewith the chosen tool and arguments - Synthesize the structured result into an answer
Pricing
MCP requests use the same pricing as the SDK:- Query: pay-per-response (varies by tools used)
- Execute: pay-per-call (method-level pricing set by tool builders)
- Discover: free
Troubleshooting
401 Unauthorized
401 Unauthorized
Tools not appearing in Cursor
Tools not appearing in Cursor
Check that
mcp.json is valid JSON and the url field points to https://www.ctxprotocol.com/api/mcp. Restart Cursor after saving.Session expired
Session expired
Sessions expire after 30 minutes of inactivity. Your MCP client will re-initialize automatically on the next request.
Query returns clarification_required
Query returns clarification_required
The query was ambiguous. Either rephrase or set
clarificationPolicy: "auto" to let the engine resolve it.
