Skip to content

Commit 661fccc

Browse files
committed
fix: preserve MCP tools when "default" tools preset is active without explicit tools list
When the "default" preset was used alone (no explicit --tools list), _apply_tool_filters built an allow_set containing only built-in tool names, silently stripping all mcp__ prefixed tools. This caused SDK agents using ToolsPreset to lose access to their registered MCP tools. Return the full tool list early when preset is "default" and no explicit tools_list is provided, matching the upstream behaviour where "default" resolves to the complete set of enabled tools.
1 parent ad70e86 commit 661fccc

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ripperdoc/protocol/stdio/handler_config.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,14 @@ def _apply_tool_filters(
102102
if tools_list is not None:
103103
allow_set = set(tools_list)
104104

105-
# "default" preset independently adds all built-in tools.
105+
# "default" preset adds all built-in tools to the allow set.
106+
# When no explicit tools_list is provided, preserve all registered
107+
# tools (built-in + MCP) so that MCP servers aren't silently stripped.
106108
if preset == "default":
109+
if allow_set is None:
110+
return tools
107111
builtin_names = {name for name in tool_names if not name.startswith("mcp__")}
108-
allow_set = builtin_names if allow_set is None else allow_set | builtin_names
112+
allow_set = allow_set | builtin_names
109113

110114
if allow_set is None:
111115
return tools

ripperdoc/utils/mcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ def format_mcp_instructions(servers: List[McpServerInfo]) -> str:
14881488
lines: List[str] = []
14891489
if connected_count > 0:
14901490
lines.append(
1491-
"Connected MCP servers are available. Call tools via CallMcpTool by specifying server, tool, and arguments."
1491+
"Connected MCP servers are available."
14921492
)
14931493
else:
14941494
lines.append(

0 commit comments

Comments
 (0)