test(mcp): Phase 4 — integration tests (stacked on #55)#56
Merged
Conversation
36799ec to
060dda4
Compare
Closes Phase 4 of docs/specs/mcp-server-scope/. Three new tests in
sidecar/tests/test_mcp_integration.py prove the MCP tool surface
stays in sync with the FastAPI routes on a shared isolated specs
root:
- 4.1 — gui_list_specs returns the same `specs` and `specs_roots`
lists as GET /api/cowork/specs
- 4.2 — gui_get_spec content matches disk bytes for every phase
file; the FastAPI listing agrees on most-advanced phase
and status
- Bonus — gui_set_spec_status round-trip: flip status via MCP,
FastAPI listing reflects the change immediately
(no cache between the two surfaces)
Implementation note — the spec's "test that starts the MCP server"
wording was reinterpreted as in-process dispatch via
`AttuneGuiMCPServer.call_tool(...)`. That's the same code path the
MCP SDK hits at runtime, so the surface-parity guarantee is identical,
but the test is significantly lighter than spawning a stdio
subprocess and wiring JSON-RPC framing. The choice is recorded in
tasks.md and in the test file's module docstring.
This stacks on top of #55 (Phase 3 — gui_set_spec_status) so the
round-trip test can exercise the write tool. Merge order: #55 first,
then this PR.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Auto-regen triggered by the new sidecar/tests/test_mcp_integration.py file. source_hash drift only. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
060dda4 to
7e01b1a
Compare
This was referenced May 24, 2026
silversurfer562
added a commit
that referenced
this pull request
May 25, 2026
attune-rag 0.2.0 shipped 2026-05-25 as the first SemVer-binding cut — purely additive (new measure_corpus module + alias-file helpers; no breaking API changes). The current core pin caps at <0.2, silently locking fresh installs to attune-rag 0.1.23 even when 0.2.x is available. Widen the cap to <0.3 to unblock attune-rag 0.2.x installs. The cap widen is the trigger for promoting the pending [Unreleased] content to a real release. That content has been queued on `main` since v0.7.1 (2026-05-22): - MCP server Phases 1-5 (PRs #49-#56) — new attune-gui-mcp console script with 6 tools (5 read-mostly + gui_set_spec_status write); 30+ tests across test_mcp_tools.py and test_mcp_integration.py - **Status:** parser fix (PR #57) - Living-docs regen automation Phase 1 (PRs #60-#63) - Home interpreter snapshot (PR #59) - Stacked-rebase README note (PR #58) Bumped 0.7.1 → 0.8.0 (minor) for the new MCP tool surface. Local smoke (python 3.10, fresh venv): pip install -e .[dev] → attune-gui 0.8.0, attune-rag 0.2.0 545/545 sidecar tests pass (1 playwright skip, unrelated).
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.
Summary
Closes Phase 4 (tasks 4.1, 4.2) of docs/specs/mcp-server-scope/. With this merged, the whole MCP spec is shipped end-to-end (Phases 1–5).
gui_set_spec_status. Merge order: #55 first, then this PR. After #55 merges, this branch may need a no-op rebase but the diff is clean.Tests added —
sidecar/tests/test_mcp_integration.py(3 tests)test_gui_list_specs_matches_fastapi_routegui_list_specsreturns the samespecsandspecs_rootslists asGET /api/cowork/specson the same isolated roottest_gui_get_spec_returns_disk_truthgui_get_speccontent matches disk byte-for-byte for every phase file; the FastAPI listing agrees on most-advanced phase + statustest_set_spec_status_round_trips_to_fastapi_routeImplementation note
The spec's "test that starts the MCP server" wording was reinterpreted as in-process dispatch via
AttuneGuiMCPServer.call_tool(...). That's the same code path the MCP SDK hits at runtime, so the surface-parity guarantee is identical, but the test is significantly lighter than spawning a stdio subprocess and wiring JSON-RPC framing.Recorded in tasks.md and the test file's module docstring.
Test plan
pytest sidecar/tests/test_mcp_integration.py— 3/3 greenversion == 'dev'in worktree env)ruff check sidecar/— clean🤖 Generated with Claude Code