Skip to content

docs: fix MCP dependency for docs server setup - #2234

Merged
joefernandez merged 4 commits into
google:mainfrom
xblwh:docs/mcpdoc-compatible-dependency
Sep 19, 2026
Merged

joefernandez merged 4 commits into
google:mainfrom
xblwh:docs/mcpdoc-compatible-dependency

Conversation

@xblwh

@xblwh xblwh commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #2219.

Add --with "mcp<2" to the Antigravity, Claude Code, and Cursor setup examples, and explain the compatibility constraint. mcpdoc 0.0.10 allows MCP 2.x to be installed but still imports the MCP 1.x FastMCP API, causing startup to fail.

Validation

  • mkdocs build --strict passed with output directed outside the checkout.
  • Parsed both JSON configs and confirmed all three snippets produce the same uvx arguments.
  • Reproduced the original FastMCP import error; the constrained command starts successfully.
  • Verified MCP initialize and tools/list, including list_doc_sources and fetch_docs.
  • git diff --check passed.

@google-cla

google-cla Bot commented Sep 15, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@netlify

netlify Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for adk-docs-preview ready!

Name Link
🔨 Latest commit eab57f7
🔍 Latest deploy log https://app.netlify.com/projects/adk-docs-preview/deploys/6aadd1590a788b0007d6139c
😎 Deploy Preview https://deploy-preview-2234--adk-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread docs/tutorials/coding-with-ai.md
@joefernandez

Copy link
Copy Markdown
Collaborator

Technical review report

  • Review Score: 99
  • Overall assessment: 🟢 Low Risk
  • Summary reasoning: The change fixes a real, currently-reproducible breakage in the documented mcpdoc setup commands, and the fix is correct in all three places it appears. I reproduced both the failure and the fix locally. The only issue is the placement of the new explanatory sentence.
  • Recommended action: Approve with one optional change. The technical claim and the pin are verified correct; the only nit is that the explanatory sentence at line 46 appears before the reader has seen mcp<2 in any config block, so it reads as an unexplained forward reference.
  • Number of lines changed: XS, 9
  • Number of files changed: 1

Verification performed

The fix is correct and necessary. As of today, uvx --from mcpdoc mcpdoc ... — the command the docs shipped before this PR — fails outright:

File ".../mcpdoc/main.py", line 9, in <module>
    from mcp.server.fastmcp import FastMCP
ModuleNotFoundError: No module named 'mcp.server.fastmcp'. This is mcp 2.x, where FastMCP
was renamed to MCPServer ... or pin 'mcp<2' to keep running v1 code.

Root cause chain, all confirmed against upstream source:

  • mcpdoc 0.0.10 declares mcp[cli]>=1.4.1 with no upper bound — pyproject.toml:11, so uvx resolves the newest mcp (2.2.0, released 2026-09-07).
  • mcpdoc still imports the v1 API — mcpdoc/main.py:9: from mcp.server.fastmcp import FastMCP.
  • mcp 2.x turned that module into a tombstone that raises on import — src/mcp/server/fastmcp.py:16. The upstream error message itself recommends exactly the mcp<2 pin this PR adds.

With the PR's command, the server resolves mcp 1.30.0 and completes an MCP initialize handshake over stdio, returning "serverInfo":{"name":"llms-txt"}. So the claim at lines 46-47 — "keeps mcpdoc compatible with the MCP 1.x FastMCP API it currently uses" — is accurate, including the hedge "currently".

Other checks:

  • Argument ordering is valid uv syntax in all three spots: --with is a uvx option and correctly precedes the mcpdoc command token (L67-68, L86, L106-107).
  • The Claude Code one-liner correctly quotes "mcp<2"; unquoted it would be a shell redirection. The two JSON args arrays are not shell-parsed, so the bare "mcp<2" string there is right.
  • No mcpdoc references elsewhere in the repo were missed — it appears only in this file.
  • No ADK repository (adk-python, adk-js, adk-go, adk-java, adk-kotlin) surface is touched, so there is no unreleased-code exposure.

🟢 Low risk items

  • docs/tutorials/coding-with-ai.md:46-47: the sentence explaining mcp<2 sits directly under the "ADK Docs MCP Server" heading, before any config block containing mcp<2. A reader meets the justification before the thing being justified. Suggest making it a note that reads forward, so it works wherever the reader lands:

    ```suggestion
    !!! note "Why `mcp<2`?"
    
        The setup commands below pin `mcp<2`. The `mcpdoc` package still imports
        the MCP 1.x `FastMCP` API, which was renamed in MCP 2.x, so without the
        pin the server fails to start.

@joefernandez
joefernandez enabled auto-merge (squash) September 19, 2026 00:07

@joefernandez joefernandez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update!

@joefernandez
joefernandez merged commit 8392061 into google:main Sep 19, 2026
11 of 12 checks passed
zyantw pushed a commit to zyantw/adk-docs that referenced this pull request Sep 24, 2026
* docs: fix MCP dependency for docs server setup

* Apply suggestion from @joefernandez

* Update coding-with-ai.md

---------

Co-authored-by: Joe Fernandez <931947+joefernandez@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ADK Docs MCP Server snippets fail on fresh install: mcpdoc is incompatible with mcp 2.x

2 participants