Skip to content

feat: MCP server — expose session traces as queryable tools#79

Merged
Siddhant-K-code merged 1 commit into
mainfrom
feat/mcp-server
May 17, 2026
Merged

feat: MCP server — expose session traces as queryable tools#79
Siddhant-K-code merged 1 commit into
mainfrom
feat/mcp-server

Conversation

@Siddhant-K-code
Copy link
Copy Markdown
Owner

Closes #64

Changes

agent-strace mcp — MCP server over stdio

Starts a JSON-RPC 2.0 MCP server that exposes the session store as five queryable tools. Any MCP-compatible client (Claude Code, Cursor, VS Code Copilot) can connect and query traces conversationally.

No external dependencies — implements the MCP protocol directly over stdio using stdlib only.

Five tools

Tool Description
list_sessions Sessions with metadata, cost estimate, agent name filter
get_session Full event stream with optional event type filter
search_events Cross-session filter by tool name, file path, exit code, error flag
get_session_summary Plain-English phase breakdown (wraps explain_session)
diff_sessions Tool call delta, file overlap, cost/token/error delta between two sessions

Claude Code config

{
  "mcpServers": {
    "agent-trace": {
      "command": "agent-strace",
      "args": ["mcp"]
    }
  }
}

examples/ci/agent-eval.yml

GitHub Actions workflow for the eval CI gate (closes the remaining acceptance criterion from #69):

  • Runs eval ci with baseline comparison on PRs touching agent config files
  • Posts the Markdown score summary as a PR comment
  • Optional update-baseline job that saves a new baseline on every merge to main

Tests

40 new tests in tests/test_mcp_server.py covering all 5 tools, JSON-RPC lifecycle, error paths, and the tools/call dispatch. 740 total, all passing.

Implements agent-strace mcp: a stdio JSON-RPC MCP server that lets any
MCP-compatible client (Claude Code, Cursor) query agent traces conversationally.

Five tools:
- list_sessions: sessions with metadata, cost estimate, agent filter
- get_session: full event stream with optional event type filter
- search_events: cross-session filter by tool name, file path, exit code, error flag
- get_session_summary: plain-English phase breakdown (wraps explain_session)
- diff_sessions: tool call delta, file overlap, cost/token/error delta

No external dependencies — implements MCP JSON-RPC 2.0 over stdio using stdlib only.

Also adds:
- examples/ci/agent-eval.yml: GitHub Actions workflow for eval CI gate with
  baseline comparison and PR comment posting
- README: Debug with MCP section with Claude Code / Cursor config examples

40 new tests; 740 total, all passing.

Co-authored-by: Ona <no-reply@ona.com>
@Siddhant-K-code Siddhant-K-code merged commit 00da58c into main May 17, 2026
4 checks passed
@Siddhant-K-code Siddhant-K-code deleted the feat/mcp-server branch May 17, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: expose traces as context for a debugging agent via MCP

1 participant