Model Context Protocol in ADK-Rust

Model Context Protocol (MCP) is the boundary between an AI application and a separately owned capability. An MCP server can publish tools, readable resources, prompt templates, and argument completion. The client discovers that catalog and communicates through negotiated protocol methods rather than a private integration.

ADK-Rust 2 uses the official rmcp 2.2 SDK and MCP 2025-11-25 types.

Where ADK-Rust fits

Rendering architecture…

McpToolset adapts one initialized MCP client connection to ADK-Rust. McpServerManager owns a changing registry of local stdio child processes and aggregates their tools. Applications that publish capabilities can build MCP servers with adk_tool::mcp::rmcp, which is the exact SDK version used by the framework.

Choose the right surface

You need toUseOwnership
Connect one known local serverMcpToolset + TokioChildProcessThe application starts the child process
Connect one remote MCP serviceMcpHttpClientBuilderThe remote deployment owns availability
Change local server definitions at runtimeMcpServerManagerThe application owns a local registry and child processes
Publish an MCP serveradk_tool::mcp::rmcpYour service owns schemas, authorization, and side effects
Keep a deprecated sampling integration workingmcp-sampling featureCompatibility only under SEP-2577

Implemented capability map

CapabilityADK-Rust APIBehavior
Tool discovery and callsMcpToolset, ToolsetRaw schemas and multimodal results are preserved
Tool filteringwith_filter, with_toolsThe model sees only selected tools
Resources and templateslist_resources, list_resource_templates, read_resourceRead context through stable URIs
Promptslist_prompts, get_promptResolve reusable server-owned messages
Completioncomplete_prompt_argument, complete_resource_argumentAsk the server for argument suggestions
Resource subscriptionssubscribe_resource, unsubscribe_resourceCustom handlers receive update notifications
ElicitationElicitationHandlerForm and URL modes
TasksMcpTaskConfigNegotiated tool-call task creation, polling, result, and cancellation
Streamable HTTPMcpHttpClientBuilderTimeouts, headers, auth injection, expired-session recovery
Dynamic local registryMcpServerManagerAdd, update, enable, disable, remove, save, monitor, and restart
Advanced SDK workadk_tool::mcp::rmcpServer handlers, transports, notifications, and extension types

Documentation path

Important boundaries

  • Dynamic management currently targets local stdio child processes.
  • Manager health monitoring detects a closed MCP connection. It does not prove that the server's database or external API is healthy.
  • autoApprove is preserved for compatible configuration; ADK-Rust does not interpret it as authorization.
  • OAuth2Config performs a fixed client-credentials token request. It is not the complete MCP authorization discovery and browser-authorization flow.
  • Sampling, roots, and logging are deprecated upstream through SEP-2577.

These boundaries are part of the public contract and should be reflected in deployment design.