feat: MCP server — expose session traces as queryable tools#79
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #64
Changes
agent-strace mcp— MCP server over stdioStarts 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
list_sessionsget_sessionsearch_eventsget_session_summaryexplain_session)diff_sessionsClaude Code config
{ "mcpServers": { "agent-trace": { "command": "agent-strace", "args": ["mcp"] } } }examples/ci/agent-eval.ymlGitHub Actions workflow for the eval CI gate (closes the remaining acceptance criterion from #69):
eval ciwith baseline comparison on PRs touching agent config filesupdate-baselinejob that saves a new baseline on every merge to mainTests
40 new tests in
tests/test_mcp_server.pycovering all 5 tools, JSON-RPC lifecycle, error paths, and thetools/calldispatch. 740 total, all passing.