docs(mcp): add guide for exposing an agent as an MCP server#1981
Open
Cnashn wants to merge 1 commit into
Open
Conversation
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
What
Adds a documentation page, "Expose an ADK agent as an MCP server", covering the
to_mcp_serverfunction, and wires it into the MCP section of the site navigation.Why
to_mcp_serveris the MCP counterpart ofto_a2a: it turns a whole ADK agent into a standard MCP server so hosts like Claude Code or an IDE can drive it as a single tool. The A2A twin already has a full "exposing" quickstart on the site, but there was no page forto_mcp_server, so the feature was effectively undocumented for users who look at the docs site rather than the source tree.This addresses google/adk-python#6417 ("No proper documentation for agent to mcp with release 2.5.0").
Details
docs/mcp/expose-agent-as-mcp-server.md.mkdocs.yml.to_mcp_server(agent, *, name=None, instructions=None, runner=None) -> FastMCPand mirrors the existing in-repo guide atgoogle/adk-python:docs/guides/tools/mcp_tool/agent_to_mcp/index.md. It covers a runnable stdio example, how it works (Runner-backed handler, progress notifications, content mapping), session continuity, the configuration options, serving over streamable-http, and the current limitations.I do not have mkdocs installed locally, so I validated link targets and the nav entry by hand and am relying on CI for the strict build.