test_the_sdk_still_offers_the_deprecated_roots_route

Tests › tests/test_mcp_server.py

passed Passed in the packaged run.

What this test is for

Why it exists

TRIPWIRE. Fails the day mcp removes `ServerSession.list_roots`, which is the day resolution link (3) stops existing.

Verifies REQ-DDB-MCP-001 REQ-DDB-MCP-003 REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009

Given

  1. —
→

When

  1. surface = st.server_request_surface()
→

Then

  1. ✓ callable(getattr(ServerSession, "list_roots", None)) holds
  2. ✓ getattr(ServerSession.list_roots, "__deprecated__", "") contains st.ROOTS_DEPRECATION_SEP
  3. ✓ issubclass(MCPDeprecationWarning, Warning) holds
  4. ✓ surface is not None
  5. ✓ any(method == st.TARGET_SOURCE_ROOTS for method, _version in surface) holds

tests/test_mcp_server.py:2713 · its file's page

What it checks (5)

  1. assert callable(getattr(ServerSession, "list_roots", None)), ( "mcp removed ServerSession.list_roots — resolution link (3) is gone; " "delete the roots path rather than migrating it (there is no successor request)" ) not attributed
  2. assert st.ROOTS_DEPRECATION_SEP in getattr(ServerSession.list_roots, "__deprecated__", ""), ( "the deprecation notice on list_roots changed shape; re-read it before trusting " f"{st.ROOTS_DEPRECATION_SEP} facts recorded in state.py" ) not attributed
  3. assert issubclass(MCPDeprecationWarning, Warning), "the silenced category must stay a Warning" not attributed
  4. assert surface is not None, ( "the SDK's server-request map moved; roots_request_supported now fails open" ) observes server_request_surface via surface
  5. assert any(method == st.TARGET_SOURCE_ROOTS for method, _version in surface), ( f"no protocol revision carries a standalone {st.TARGET_SOURCE_ROOTS} request any more" ) observes server_request_surface via surface

Where the product reaches it

  • index → _index_action → read_comments → ensure_target → _target_from_roots → _roots → _roots_askable → roots_request_supported → server_request_surface (flow)

Call flow

test_the_sdk_still_offers_the_deprecated_roots_route→server_request_surface

What it reaches

Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.

Requirements it verifies (5)

requirementlinked byimplementers exercised
REQ-DDB-MCP-001catalogunknown
REQ-DDB-MCP-003catalogunknown
REQ-DDB-QUERY-006catalogunknown
REQ-DDB-QUERY-008catalogunknown
REQ-DDB-QUERY-009catalogunknown