Skip to content

MCP server factory + benchmark tool profile with report_done (#68) - #73

Merged
Santisoutoo merged 2 commits into
devfrom
feat/68-mcp-server-factory
Jul 23, 2026
Merged

MCP server factory + benchmark tool profile with report_done (#68)#73
Santisoutoo merged 2 commits into
devfrom
feat/68-mcp-server-factory

Conversation

@Santisoutoo

Copy link
Copy Markdown
Owner

Implements #68 (slice A of the Phase 5 epic #19).

What

  • mcp/a320_mcp/server.py: the server is now built by create_server(sim, *, instructions=None, profile="interactive") instead of module-level decorators. Tools are sync closures over the passed Sim (sync stays load-bearing: unsendable binding, D-010/D-015).
  • interactive profile (default): the 9-tool stdio surface, byte-for-byte the same behavior; main(), --start and the module-level mcp instance are unchanged.
  • benchmark profile: withholds inject_failure/clear_failure — the injected failure is the exam; an agent that can repair the fault (or break something else) is not flying the procedure — and adds report_done(diagnosis, actions_summary) as the explicit end-of-episode channel (and a scorable diagnosis artifact for EPIC: scoring metric + baselines/ablations #20).
  • INSTRUCTIONS becomes a registry (INSTRUCTIONS_PROFILES): the benchmark variant appends the report_done contract; explicit instructions= overrides the profile default (Phase 5 ablation axis).
  • _run_until renamed to public run_until; START_STATES stays public — both are reused by the Phase 5 episode runner.
  • mcp/README.md: documents the profile concept.

Tests

  • New: benchmark surface (exactly interactive − inject/clear + report_done, checked in-process against mcp 1.28.1's FastMCP.list_tools()/call_tool()), unknown profile fails loudly, instructions wiring (profile default vs explicit override).
  • python -m pytest mcp/tests -q: 11 passed (8 pre-existing stdio tests untouched and green — no behavior change on the interactive path).

🤖 Generated with Claude Code

https://claude.ai/code/session_014JCrwRbtN7UA5ijn13vPmm

create_server(sim, instructions=, profile=) builds the FastMCP over a given
Sim. The interactive profile is the stdio surface unchanged; the benchmark
profile withholds inject_failure/clear_failure (the injected failure is the
exam) and adds report_done as the explicit end-of-episode channel.
INSTRUCTIONS becomes a profile registry (Phase 5 ablation axis) and
run_until goes public for the benchmark runner.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014JCrwRbtN7UA5ijn13vPmm
…the runtime check

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014JCrwRbtN7UA5ijn13vPmm
@Santisoutoo
Santisoutoo merged commit d207979 into dev Jul 23, 2026
1 of 2 checks passed
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.

1 participant