Conversation
- Tag error output blocks as ```text instead of ```python (anthropic, openai integration docs + v2 mirrors) - Quote unquoted URL in Descope config example (+ v2 mirror) - Fix GoogleGenAISamplingHandler → GoogleGenaiSamplingHandler casing in sampling docs - Fix import path: handlers.GoogleGenaiSamplingHandler → handlers.google_genai.GoogleGenaiSamplingHandler in v3-features 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- BearerTokenAuth → StaticTokenVerifier in deployment/http.mdx - providers.oauth → server.auth import in authentication.mdx - ListToolsNext → updated list_tools API in v3-features.mdx - OAuthClientProvider → OAuth in v2/storage-backends.mdx - Add test="skip" for upgrade guides, contrib placeholders, f-string backticks 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
All 1444 examples now pass syntax and import checks. 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Test Failure Analysis
Summary: All CI jobs fail because Root Cause: The new test file imports Suggested Solution: Add [dependency-groups]
dev = [
...
"pytest-examples>=0.0.13",
...
]Then run
Detailed AnalysisAll 6 jobs failed with the same error: This error occurs at collection time, so it blocks every test run even though the 5301 other tests pass fine. Current dev dependencies in Related Files
Posted by marvin (automated triage bot) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbd8f7c09d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| from pathlib import Path | ||
| from uuid import uuid4 | ||
|
|
||
| from pytest_examples import CodeExample |
There was a problem hiding this comment.
Add pytest-examples to dev dependencies
This test file introduces a hard dependency on pytest_examples, but the commit does not add pytest-examples to pyproject.toml (or lock it in uv.lock), so the required workflow (uv sync then uv run pytest) now fails during collection with ModuleNotFoundError before any tests run. Please declare this package in the dev dependency group (or gate the import) so CI and local test runs remain green.
Useful? React with 👍 / 👎.
| auth_token = os.environ.get("MCP_AUTH_TOKEN") | ||
| if auth_token: | ||
| auth = BearerTokenAuth(token=auth_token) | ||
| auth = StaticTokenVerifier(tokens={auth_token: {"sub": "admin"}}) |
There was a problem hiding this comment.
Include required client_id in static token example
StaticTokenVerifier requires each token payload to include client_id; this example only sets {"sub": "admin"}. When a request is authenticated with this token, verify_token reads token_data["client_id"] and raises KeyError, so the documented production snippet fails at runtime instead of authenticating requests.
Useful? React with 👍 / 👎.
…mple, commit missed openapi fixes - Add pytest-examples to dev dependencies (fixes CI ModuleNotFoundError) - Include required client_id in StaticTokenVerifier token payload - Commit previously unstaged HTTPRoute import fixes in openapi.mdx 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- fastmcp.server.openapi → fastmcp.server.providers.openapi - fastmcp.server.proxy → fastmcp.server.providers.proxy - fastmcp.server.apps → fastmcp.apps - Tag upgrade guide "Before" examples with test="skip" 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e517746b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| from fastmcp.server.auth import OAuthProvider | ||
|
|
||
| auth = MyOAuthProvider( |
There was a problem hiding this comment.
Align OAuth provider import with instantiated class
After this change, the snippet imports OAuthProvider but still instantiates MyOAuthProvider, so users who copy this example hit a NameError immediately when auth = MyOAuthProvider(...) runs. This block is presented as runnable Python (not skipped), so the import and constructor name need to be consistent (and the same mismatch is also present in the mirrored docs/v2/servers/auth/authentication.mdx section).
Useful? React with 👍 / 👎.
jlowin
left a comment
There was a problem hiding this comment.
Accurate mechanical fixes — wrong module paths, renamed classes, and retagged error-response code blocks. Good to see pytest-examples wiring in so these stay fixed.
Summary
Fixes 8 out of 26 broken code examples found by automated doc validation (pytest-examples scan of 1,448 Python code blocks across docs/).
Error output tagged as Python (4 files):
integrations/anthropic.mdxandintegrations/openai.mdx— API error responses were tagged as ```python instead of ```text. Users copy-pasting would get syntax errors.Unquoted URL (2 files):
integrations/descope.mdx—config_url=https://...missing quotes. Copy-paste producesSyntaxError.Wrong class name casing (1 file):
clients/sampling.mdx—GoogleGenAISamplingHandlershould beGoogleGenaiSamplingHandler(lowercaseai). Copy-paste producesImportError.Wrong import path (1 file):
development/v3-notes/v3-features.mdx—from fastmcp.client.sampling.handlers import GoogleGenaiSamplingHandlershould befrom fastmcp.client.sampling.handlers.google_genai import GoogleGenaiSamplingHandler.Remaining known issues (18, need more investigation)
The remaining failures involve renamed/removed APIs (
BearerTokenAuth,OAuthClientProvider,WSTransport,ListToolsNext) and wrong module paths that need example rewrites, not simple find-replace. Tracked separately.🤖 Generated with Claude Code