Conversation
list_mcps, search_mcp_tools, get_mcp_tool_schema, describe_mcp and call_mcp are now attached only when mcp_available is set on the prompt context, the same flag scope.jinja already gates its MCP guidance on. A run with no MCP configured no longer carries five tool schemas it cannot use; with MCP configured, the tool list stays the same regardless of how many connections exist.
tntrenjin
marked this pull request as ready for review
September 30, 2026 16:47
Contributor
|
register_agent_tools now checks _MCP_TOOLS too, so a name clash fails at registration instead of when a run with MCP configured builds its agents.
This branch has not been deployed
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.
Follow-up to #1175.
Summary
The five MCP tools (
list_mcps,search_mcp_tools,get_mcp_tool_schema,describe_mcp,call_mcp) are now attached only when the run has MCP configured (mcp_availableon the prompt context). A run with MCP configured gets the same tool list as before; a run without it gets none.Why
#1175 made the MCP toolset a fixed set of generic tools, so it no longer grows with the number of connected servers. The set lives in
_BASE_TOOLS, so every agent carries it even when no MCP server is configured: five tool schemas on every request that the model cannot use, while the prompt's MCP section inscope.jinjais already gated onmcp_available.docs/integrations/mcp.mdxalso already says "Without it, a run simply gets no MCP tools."Changes
strix/agents/factory.py: move the MCP tools out of_BASE_TOOLSinto_MCP_TOOLS, whichbuild_strix_agentadds only whenmcp_availableis set, the same flag the prompt uses.tests/test_mcp_client.py:test_agent_carries_exactly_the_generic_mcp_tools_regardless_of_connectionsnow builds its agents withmcp_available=True.tests/test_agent_factory_shell.py: root and child agents get none of the five tools without MCP configured and all five with it, with no carry-over into a later agent.tests/test_runner_root_prompt.py: the runner passesmcp_availableto the child agent factory as well as the root agent.Testing
pre-commiton the changed files is clean (ruff check,ruff format --check,mypy,bandit,pyupgrade).uv run pytest: 2162 passed, 1 failed (tests/test_pricing.py::test_resolves_common_bare_model_names:grok-4.5resolves toopenrouter/x-ai/grok-4.5). It is pre-existing onmain, so it is not caused by this change.