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
tool/mcptoolset: support tool name prefixing across multiple servers (parity with adk-python tool_name_prefix) #1126
tool/mcptoolset exposes MCP tools under their raw server-side names, with no way to prefix or rename them. convertTool sets both the tool Name() and the genai.FunctionDeclaration.Name to t.Name verbatim, and Config offers no prefix/rename option (only Client, Transport, ToolFilter, RequireConfirmation, RequireConfirmationProvider).
For an agent connected to multiple MCP servers this causes two problems:
Hard collision: two servers exporting the same tool name (e.g. both a filesystem and a GitHub server exposing read_file) fail at request-packing time with duplicate tool: "read_file" (toolutils.PackTool).
Wrapper bypass for renaming layers: a user-side wrapper that exposes a prefixed Name() doesn't help, because each mcpTool implements ProcessRequest and packs itself under its bare name into LLMRequest.Tools — at dispatch time the model calls the bare name and the inner tool runs directly, skipping the wrapper. Host applications that key permission/approval policy on namespaced tool names (a common pattern) silently lose that scoping.
Precedent in adk-python
adk-python already solved this: BaseToolset.tool_name_prefix ("The prefix to prepend to the names of the tools returned by the toolset"), applied via get_tools_with_prefix() as {prefix}_{name} to both the tool name and its declaration, and passed through by MCPToolset since google/adk-python#2814 was fixed. adk-go has no equivalent.
Ecosystem context
Namespacing multi-server MCP tools client-side is the converged practice: Claude Code exposes mcp__<server>__<tool> and scopes permission rules on it; the MCP spec's namespace proposal (SEP-993) uses <namespace>__<tool>; LangChain's MCP adapters and the OpenAI Agents SDK both added opt-in server-name prefixing after collision bugs; FastMCP's proxy/mount composition auto-prefixes per server.
Proposed API
A Config option on mcptoolset, e.g.:
typeConfigstruct {
// ...// ToolNamePrefix, when non-empty, is prepended to each tool's exposed// name and function declaration (the MCP server is still called with// the original name).ToolNamePrefixstring
}
or the Python-parity route of a prefix concept on toolsets generally. The key requirement is that the rename applies to Name(), the FunctionDeclaration, and the name the tool packs itself under in ProcessRequest, while CallTool keeps using the original server-side name.
Happy to contribute a PR if the direction is acceptable.
Environment
google.golang.org/adk/v2 v2.0.0 (latest release at time of filing), github.com/modelcontextprotocol/go-sdk v1.6.1.
Hi @sanjay-sts Thank you for taking the time to suggest this feature, We will review the details and proceed accordingly, keeping you updated along the way.
Activity
indurireddy-TF commentedon Jul 7, 2026
Hi @sanjay-sts Thank you for taking the time to suggest this feature, We will review the details and proceed accordingly, keeping you updated along the way.
ktsoator commentedon Oct 12, 2026
HI, @wojtas000 :)
Following up from #1801 — I'd be happy to work on this. Is anyone already implementing it? If not, could you please assign it to me? Thanks!
wojtas000 commentedon Oct 12, 2026
You can work on it, I will assign
ktsoator commentedon Oct 12, 2026
Ty!