Prerequisites
- A Context Company account with at least one project sending data
- An MCP-compatible IDE or tool (Cursor, Claude Code, Windsurf, or any client that supports MCP)
Setup
One-click install via OAuth — no API key needed. For CI, programmatic, or headless setups, see Advanced: API key.1
Install and sign in
- Cursor
- Claude Code
- Other platforms
Add the server to Cursor using the Access Data page in your dashboard (use the Add to Cursor button), or paste the config below into Settings > MCP Servers:After installing, click Connect next to
context-company in Cursor to sign in via OAuth.2
Try it out
Try this prompt:
Advanced: API key
For CI, programmatic, or headless setups where OAuth isn’t practical, you can authenticate with a read-only API key instead.1
Generate an API key
Go to the Access Data page in your dashboard and create a read-only API key.Keys are prefixed with
tcc_key and are read-only - they can only query your data, not ingest traces.When creating a key, choose an access scope:2
Add to your IDE
- Claude Code
- Other platforms
Run this in your terminal:
<your-api-key> with the key you generated.Available tools
For most questions,insight_search is the right choice — it’s a multi-step analytics agent with full SQL access to your telemetry and synthesizes evidence across runs, sessions, patterns, failures, and costs. The other tools fetch raw traces and lists, and are best used when you already have a specific ID or want a filtered list of runs/sessions.
insight_search
Ask natural-language questions about your production data including metrics, patterns, failures, sessions, costs, and more. See insight search for details and example queries.Insight search queries production data only and requires a Pro or Enterprise plan.
get_agent_runs
Fetch a filtered raw list of runs fordev or prod. A session/run matches when its run-level fields match the supplied filters.
summary (the default) returns compact runs with prompt/response previews and failed step/tool-call summaries. full_trace includes all steps and tool calls using preview text only.
get_agent_sessions
Fetch a filtered list of sessions fordev or prod. A session matches when any run in that session matches the time, metadata, errored-only, and run-level failure text filters.
get_agent_run
Fetch the full raw trace of a single run by ID, including all steps and tool calls. Use this only when you need the complete step-by-step trace of a specific run.get_agent_session
Fetch a specific production session by session ID.Example prompts
Frustration debuggingFind the biggest reason users have been frustrated in my runs this past week. Look at my codebase to find the root cause and fix it.Tool failure chains
Find runs where a tool call failed right after another tool succeeded. What’s the most common pattern, and what in my code is causing it?Cost optimization
Find my most expensive runs from the past week. Figure out which prompts or tool loops are driving up cost and suggest code changes to reduce token usage.Redundant tool loops
Find runs where my agent called the same tool more than 3 times in a row. Is there a loop in my code causing redundant calls? Fix it.Task failure improvement
Show me runs with task failure patterns. Compare what the user asked for vs what the agent did, and suggest how to improve my system prompt.
