Debug Traces from IDE
Connect the Future AGI MCP server to your IDE, then find, diagnose, and fix failing traces without leaving your editor.
Add the Future AGI MCP server to your IDE, sign in via OAuth, and ask your AI assistant questions like “what went wrong with the last failing trace in my support-bot project?” It pulls span data, runs error analysis, and proposes fixes, all in the same chat where you’re writing code.
| Time | Difficulty | Package |
|---|---|---|
| 20-25 min (first success at Step 3, ~10 min in) | Beginner | None (MCP server, no SDK install) |
- Future AGI account → app.futureagi.com
- A traced project with at least a few traces. If you don’t have one, follow Manual Tracing to instrument an agent first
- An MCP-capable IDE: Cursor, Claude Code, VS Code (with the MCP extension), Claude Desktop, or Windsurf
- Error Feed turned on for the project, so error clusters and error analysis have something to return: see Turn on Error Feed
- A groundedness annotation label already created on the project, for the scoring step: see Create a label
Tutorial
Connect the MCP server to your IDE
The MCP server lives at https://api.futureagi.com/mcp and authenticates over OAuth, so there are no API keys to copy around.
claude mcp add futureagi --transport http https://api.futureagi.com/mcp Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"futureagi": {
"url": "https://api.futureagi.com/mcp"
}
}
}Or use the one-click install link on the setup page.
Add to .vscode/settings.json:
{
"mcp.servers": {
"futureagi": {
"type": "http",
"url": "https://api.futureagi.com/mcp"
}
}
} Add to claude_desktop_config.json:
{
"mcpServers": {
"futureagi": {
"url": "https://api.futureagi.com/mcp"
}
}
} Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"futureagi": {
"serverUrl": "https://api.futureagi.com/mcp"
}
}
} Restart your IDE after editing the config.
You should see: for Claude Code, claude mcp list shows futureagi with ! Needs authentication. For the other IDEs, the assistant lists futureagi as an available MCP server once it reconnects. That’s expected. The OAuth handshake happens on the first tool call, in the next step.
Authorize via OAuth
Ask your assistant anything that needs Future AGI data, for example:
List my Future AGI projects.
This opens a browser to the consent screen. Review the permission groups and click Authorize.
You should see: the assistant returns your project list, and the browser tab confirms the connection. The token is cached, so you won’t see the consent screen again from this IDE.
Tip
You can revoke access anytime from Settings → MCP Server in the dashboard. That nav item is visible to Owners and Admins only.
Find failing traces from chat
Open your IDE’s chat panel and ask about your traces directly:
List the most recent traces in my support-bot project that have errors.
The assistant calls search_traces with has_error=True on that project.
You should see: a list of recent traces flagged as errored, with timestamps and a short description of each. If nothing comes back because the traces don’t carry a raw error flag, ask the assistant to try error clusters instead:
Show me error clusters for my support-bot project.
That routes to list_error_clusters, which surfaces AI-detected failure categories across the project, a signal that catches more than HTTP-level errors alone.
Inspect a trace and diagnose the failure
Pick a trace from the previous list and ask for detail:
Show me the span tree for the second trace from that list.
The assistant calls get_span_tree, which returns the parent span plus every nested LLM and tool call, with timing and inputs.
Then ask for a diagnosis:
Run error analysis on that trace.
This calls get_trace_error_analysis. You should see: a categorized finding (for example Language-only, Unsupported Claim, Tool Selection Errors, or Goal Deviation) with an impact rating (HIGH / MEDIUM / LOW) and a short quality scorecard across factual grounding, privacy and safety, instruction adherence, and optimal plan execution, explaining why the trace failed.
Analyze error patterns across the project
Zoom out from a single trace to the whole project:
Analyze all traces in my project from the last hour and group failures by category.
The assistant calls analyze_project_traces and list_error_clusters together.
You should see: a histogram of failure categories with counts, so you can tell whether the trace you just diagnosed is a one-off or part of a recurring pattern.
Tag and score traces from chat
Once you know what’s wrong, mark the affected traces so they’re easy to find later:
Add the tag
needs-policy-groundingto the failing traces, and score them on groundedness.
The assistant calls add_trace_tags to apply the tag, then create_score with the annotation_label_id of the groundedness label you created in the prerequisites to attach the score. Ask it to name the metric explicitly. submit_trace_scores is a different tool: it writes a full 1-5 quality scorecard (factual grounding, privacy and safety, instruction adherence, optimal plan execution, each with a reason) on a single trace, not a batch form of create_score.
You should see: the tag and score appear on the traces in the dashboard within a few seconds.
Patch the code and verify the fix
The same chat that read the trace can now read your code. Ask:
Based on the error analysis, draft a system-prompt patch that refuses to answer policy questions when no grounding tool is available. Show it as a diff against agent.py.
Your assistant has both the trace findings from MCP and the file from your editor, so it produces a paste-ready diff. Apply it, re-run a few queries through your agent, then ask:
Score the latest traces in my support-bot project on groundedness and tell me if they still show Unsupported Claim findings.
You should see: the assistant re-runs search_traces to pull the new traces, scores them with create_score the same way you did in the tagging step, and reports the new scores next to the ones you recorded earlier. Nothing re-scores traces automatically, and get_trace_error_analysis only returns something once Error Feed has sampled and analyzed the new traces, so treat the manual score comparison as your proof. That’s the full loop: detect, diagnose, fix, verify, all from one IDE chat thread.
You connected the Future AGI MCP server to your IDE, asked natural-language questions about your trace data, and ran an end-to-end debug loop without copying trace IDs or switching to the dashboard.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
claude mcp list still shows Needs authentication after you’ve been chatting | The OAuth handshake only fires on the first tool call, and a stale session can skip it | Ask a trivial question like “list my Future AGI projects” to force the handshake, then re-check claude mcp list |
| Assistant says it has no Future AGI tools available | The IDE loaded its MCP config before you added the futureagi server | Restart the IDE after editing the config file |
search_traces returns nothing even though the dashboard shows traces | The assistant defaulted to the wrong project or too narrow a time window | Name the project explicitly (“in my support-bot project”) and widen the range (“in the last 7 days”) |
search_traces with has_error comes back empty on a project with real failures | Not every failure sets a raw error flag on the span | Ask for error clusters instead: “show me error clusters for this project” |
| Tagging or scoring a trace from chat does nothing | create_score needs an existing annotation_label_id, and the assistant has no label to pass if none exists on the project | Create the annotation label first (see Create a label), then ask again to score with a named metric (“score this trace on groundedness”) |
| OAuth consent screen never opens | The default browser is blocked from launching by the OS or terminal sandbox | Copy the URL the CLI prints and open it manually |
For the full setup reference and one-click install links, see Use the MCP Server in your IDE.
Questions & Discussion