Repository navigation
Description
Problem or Motivation
Part of #1330. The 2026-10-07 text asks for one decision: give outbound MCP a seam, or delete it (Q22). Outbound MCP means devops-cli as a client of another MCP server, by URL or script. A seam is built only if a caller exists. The caller search below finds none. This item deletes the code.
Caller search, at origin/main 29309f0. I searched src, tests, docs, the knowledge base, pyproject.toml and the entry points.
| Code | Callers in src |
Callers elsewhere |
|---|---|---|
create_mcp_toolset (ai/mcp/toolset.py:111) |
MCPToolset.to_native_toolset only (ai/agents/tools.py:249, :257) |
tests |
to_native_toolset, MCPToolset.from_config (ai/agents/tools.py) |
none | tests |
load_devops_mcp_toolsets, create_devops_mcp_toolset (ai/mcp/toolset.py) |
create_devops_mcp_toolset from get_devops_mcp_toolset only |
tests |
get_devops_mcp_toolset (ai/tools/mcp_bridge.py:35) |
none. It is only re-exported in ai/tools/__init__.py:50, :301 |
tests |
ai.agents.tools.MCPToolset |
none | two KB pages and tests |
Agent.set_mcp_sampling_model (ai/agents/agent.py:473) |
none | one KB example (libraries/pydantic_ai.md:118) |
- No command, setting, environment variable, tool or
[project.scripts]entry reads an MCP server address or script. The only MCP setting is the bearer token ofdevops mcp serve. - The class
MCPToolsetinai/agents/tools.pydoes not connect.closedoes nothing,get_toolsreturns the list passed in, andget_instructionsreturns a fixed sentence. It reports a connection that it never makes. docs/TESTING.md:68lists "outbound MCP servers" among the faked edges. No such edge exists insrc.- Not deleted, because it has callers:
get_mcp_agent_toolsinai/tools/mcp_bridge.py.get_default_toolsinai/tools/registry.py:61calls it, and it exposes the devops-cli server's own tools to the agents. - Related open items. refactor: Delete unused functions after manual caller check #1910 lists
set_mcp_sampling_modelamong names to check for callers. Whichever item lands first deletes it. feat(roadmap): let a job call the tools of the MCP server #3221 plans a job-side MCP client. It uses pydantic-ai's ownMCPToolsetand the pattern in the KB pagelibraries/pydantic_ai.md. It needs none of the code deleted here.
Proposed Solution & Architectural Design
Delete the code and its tests. Add no seam, no Protocol and no fake. If a real caller appears later, the item that adds it uses pydantic-ai's MCPToolset directly, with FastMCP's in-memory transport for its test. That item may then add a seam, with a caller to justify it.
The KB pages stay as the pattern for pydantic-ai's own client, which #3221 cites. Their examples must call that class and not the deleted wrapper. The installed class takes the client as its first argument (MCPToolset("http://localhost:8000/sse")) and has sampling_model, http_client and client_info parameters. The implementer checks each example against the installed package.
Acceptance criteria
-
src/devops_cli/ai/mcp/toolset.pydoes not exist. -
ai/agents/tools.pyhas no classMCPToolset, nofrom_config, noto_native_toolset, and no import that only they used.AgentSpecstays. -
Agent.set_mcp_sampling_modelis deleted fromai/agents/agent.py. -
ai/tools/mcp_bridge.pyhas noget_devops_mcp_toolsetand noTYPE_CHECKINGimport that only it used.ai/tools/__init__.pydoes not import or export it.get_mcp_agent_toolsstays. -
git grep -nE 'devops_cli\.ai\.agents\.tools import .*MCPToolset|ai\.mcp\.toolset|create_mcp_toolset|create_devops_mcp_toolset|load_devops_mcp_toolsets|get_devops_mcp_toolset|set_mcp_sampling_model' -- src docs tests ':!docs/agent/archive' ':!tests/fixtures'returns no line. A grep for the bare nameMCPToolsetis not used: pydantic-ai's own class has that name and stays in the KB. - The three KB examples (
libraries/pydantic_ai.mdlines 52-56 and 102-118, andpython_packages.mdlines 123-133) importMCPToolsetfrompydantic_ai.mcp. The line aboutdevops_cli.ai.agents.tools.MCPToolsetinpython_packages.mdis gone. Theset_mcp_sampling_modelline is gone. -
docs/TESTING.mdno longer lists "outbound MCP servers" among the faked edges. -
tests/ai/mcp/test_pydantic_ai_mcp.pyis deleted. Its two tests of live code,test_mcp_bridge_dynamic_discovery(without theget_devops_mcp_toolsetlines) andtest_mcp_derived_default_tools_match_published_fastmcp_schemas, move totests/ai/tools/test_default_tools_follow_the_mcp_server.py.test_mcp_toolsetis deleted fromtests/ai/agents/test_ai_agent_capabilities.py. - The two kept tests pass with no patch and no private import.
-
uv run devops docs checkanduv run devops cipass. The pull request body repeats the caller search with the commands used. - If a caller turns up that this search missed, stop. Return this item to
Newwith the call site as evidence.
Children A and D both edit test_mcp_toolset and test_pydantic_ai_mcp.py. Children B and D both edit the list of faked edges in docs/TESTING.md:68. The second to land rebases. If this child lands first, child A has two fewer files to change.
Target Subsystem
src/devops_cli/ai/mcp/toolset.py, src/devops_cli/ai/agents/tools.py, src/devops_cli/ai/agents/agent.py, src/devops_cli/ai/tools/ (mcp_bridge.py, __init__.py), src/devops_cli/ai/knowledge_base/devops_cli/ (python_packages.md, libraries/pydantic_ai.md), docs/TESTING.md, tests/ai/mcp/, tests/ai/tools/, tests/ai/agents/test_ai_agent_capabilities.py.
Existing Tool Considered
The open tool for outbound MCP is pydantic-ai's MCPToolset, which the deleted wrapper only re-exported. Nothing needs a wrapper today.
Cost to build a seam for a code path with no caller: about 60,000 tokens to build and 20,000 tokens a year to keep. It also takes one day of elapsed time. Cost of this deletion: no new code. The 155 lines of toolset.py, the class MCPToolset of about 130 lines and about 250 lines of tests leave the repository.
Activity
dan-petty commentedon Nov 6, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
refactorprefix of the title gives the type.(ai)scope of the title gives the scope.Dead code removal reduces confusion but does not block users or fix a defect.It removes misleading wrappers and shrinks the codebase, but no user-visible behaviour changes.The work is bounded deletion across a few files plus small KB edits, with clear acceptance criteria.Both concern the MCP client area, but #3221 adds a new job-side client while this item deletes dead code with no caller.devops-cli-service commentedon Nov 6, 2026
Released in v0.71.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.71.0
devops-cli-service commentedon Nov 6, 2026
Live since 2026-11-06 19:47 UTC