You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ebe8a6b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ci): import the tool surface late in the host verifier (#597)
The derivation at module scope pulled the MCP SDK through the registries,
and the mcp-host-config job installs the three host CLIs with no Python
dependencies: "ModuleNotFoundError: No module named 'mcp'" took the job
down, and CI Green with it. That job verifies lean profiles only, which
never need the bounds.
full_tool_bounds() moves to mcp_server/tool_surface.py, where the surface
knowledge already lives, and the verifier keeps a thin wrapper importing
it inside the function. The wrapper also keeps that script at 292 lines,
under the 300-line cap it would otherwise have crossed.
A new test imports the script with `mcp` blocked in sys.meta_path and
asserts it still imports; I reproduced the failing condition that way
before fixing it. ADR-1077 says why the late import is load-bearing.
Full suite: 8772 passed, 8 skipped. The verifier passes its six cases.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cz7A6goxVzfKL9NT7k4zDH
Copy file name to clipboardExpand all lines: docs/adr/ADR-1077-the-advertised-tool-count-is-read-from-the-registries.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ A literal that is right for a while, then wrong, and only caught when it drifts
26
26
27
27
`mcp_server/tool_surface.py` reads the surface from the registry modules themselves: `standalone_tool_names()` is the union of their `SCHEMAS` maps minus the three gated names, and `UPSTREAM_TOOL_NAMES` holds those three. It imports registries only, never the server, so a caller pays no MCP startup for a count.
28
28
29
-
`scripts/verify_mcp_hosts.py` derives its bounds from that module rather than stating them. The remaining copies are prose for humans, and the doc-claim gate already cross-checks them against the pinned test name.
29
+
`scripts/verify_mcp_hosts.py` derives its bounds from that module rather than stating them, through a thin `full_tool_bounds()` that imports it late. The late import is load-bearing: reading the registries pulls the MCP SDK, and the `mcp-host-config` CI job installs the three host CLIs with no Python dependencies and verifies lean profiles only. A module-scope import broke that job, and a test now imports the script with `mcp` blocked to keep it importable without the SDK. The remaining copies are prose for humans, and the doc-claim gate already cross-checks them against the pinned test name.
Copy file name to clipboardExpand all lines: wiki/adr/cortex/1077-the-advertised-tool-count-is-read-from-the-registries.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ A literal that is right for a while, then wrong, and only caught when it drifts
24
24
25
25
`mcp_server/tool_surface.py` reads the surface from the registry modules themselves: `standalone_tool_names()` is the union of their `SCHEMAS` maps minus the three gated names, and `UPSTREAM_TOOL_NAMES` holds those three. It imports registries only, never the server, so a caller pays no MCP startup for a count.
26
26
27
-
`scripts/verify_mcp_hosts.py` derives its bounds from that module rather than stating them. The remaining copies are prose for humans, and the doc-claim gate already cross-checks them against the pinned test name.
27
+
`scripts/verify_mcp_hosts.py` derives its bounds from that module rather than stating them, through a thin `full_tool_bounds()` that imports it late. The late import is load-bearing: reading the registries pulls the MCP SDK, and the `mcp-host-config` CI job installs the three host CLIs with no Python dependencies and verifies lean profiles only. A module-scope import broke that job, and a test now imports the script with `mcp` blocked to keep it importable without the SDK. The remaining copies are prose for humans, and the doc-claim gate already cross-checks them against the pinned test name.
0 commit comments