fastmcp/tests/downstream
nate nowack 3ca425416e
ci: add langchain.mcp and a FastMCP proxy to the downstream smoke (#5222)
langchain 1.4.2 ships `langchain.mcp`, whose MCPAdapter wraps fastmcp.Client
and ClientGroup directly (resolve_tool, list_tools cache_mode, call_tool,
Client.new, elicitation callbacks, MCPConfig, legacy and auto modes). The
workflow now runs langchain's own MCP tests against the built wheels, and a
new smoke drives MCPAdapter in-process, over stdio, MCPConfig, HTTP, SSE, a
proxy, and a ClientGroup of a legacy HTTP server and a modern stdio server.

Every smoke also runs through a FastMCP proxy in front of a stdio server and
covers shapes this release cycle got wrong: `|` and non-ASCII template
literals, comma-joined and exploded list query params, a float schema count,
and a timed-out call followed by another on the same connection. Gaps the
proxy already had in 4.0.5 are reported as known gaps that fail the run once
they start passing. Server stderr goes to a log file, and the SDK's SSE
reader is quieted where a check cancels a call on purpose.

langchain-mcp-adapters' smoke is renamed smoke_langchain_mcp_adapters.py.


Claude-Session: https://claude.ai/code/session_01KfHgVhbYEhBCC5eSeqGiuG

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 16:48:28 -05:00
..
_harness.py ci: add langchain.mcp and a FastMCP proxy to the downstream smoke (#5222) 2026-09-22 16:48:28 -05:00
README.md ci: add langchain.mcp and a FastMCP proxy to the downstream smoke (#5222) 2026-09-22 16:48:28 -05:00
server.py ci: add langchain.mcp and a FastMCP proxy to the downstream smoke (#5222) 2026-09-22 16:48:28 -05:00
smoke_langchain_mcp.py ci: add langchain.mcp and a FastMCP proxy to the downstream smoke (#5222) 2026-09-22 16:48:28 -05:00
smoke_langchain_mcp_adapters.py ci: add langchain.mcp and a FastMCP proxy to the downstream smoke (#5222) 2026-09-22 16:48:28 -05:00
smoke_pydantic_ai.py ci: add langchain.mcp and a FastMCP proxy to the downstream smoke (#5222) 2026-09-22 16:48:28 -05:00

downstream smoke

Checks that FastMCP still works the way its consumers use it. The workflow builds FastMCP's wheels once, installs them where each consumer runs, and drives the consumer against servers started from the checkout.

job what it runs FastMCP install
pydantic-ai test suite pydantic-ai's own MCP tests at a pinned tag wheels overlaid on pydantic-ai's locked environment, as their FastMCP 4 job does
langchain test suite langchain.mcp's own unit and integration tests at a pinned tag wheels overlaid on langchain's locked test environment
pydantic-ai smoke smoke_pydantic_ai.py client-only fastmcp-slim[client], as pydantic-ai-slim[mcp] installs it
langchain.mcp smoke smoke_langchain_mcp.py, including a ClientGroup of a legacy HTTP server and a modern stdio server fastmcp, as langchain[mcp] installs it
langchain-mcp-adapters smoke smoke_langchain_mcp_adapters.py none: the adapters pin mcp<2, so they reach FastMCP over the wire

Each smoke runs its checks over stdio, streamable HTTP, SSE, and a FastMCP proxy in front of a stdio server, all with bearer auth where the transport allows it. The checks cover shapes past releases got wrong: template literals such as | and non-ASCII, comma-joined and exploded list query params, elicitation in both protocol eras, schema counts written as floats, and a timed-out call followed by another on the same connection.

Each smoke prints one line per check, writes a table to the job summary, and reports warnings raised in the consumer's process. A check listed in _harness.py's PROXY_GAPS or LEGACY_PROXY_GAPS is a gap the proxy already had in 4.0.5: it shows as ⚠ without failing the run, and fails the run if it starts passing so the entry gets removed.

Pushes and PRs test the versions pinned in the workflow. The nightly run, or a manual run with latest, tests each consumer's latest release.

running locally

uv sync
uv build --wheel --out-dir dist . fastmcp_slim
slim="fastmcp-slim @ file://$PWD/$(ls dist/fastmcp_slim-*.whl)"
full="fastmcp @ file://$PWD/$(ls dist/fastmcp-4*.whl)"

uv run --isolated --no-project --no-config \
    --with 'pydantic-ai-slim[mcp]' --with "${slim/fastmcp-slim/fastmcp-slim[client]}" \
    python tests/downstream/smoke_pydantic_ai.py

uv run --isolated --no-project --no-config \
    --with 'langchain[mcp]' --with "$full" --with "$slim" \
    python tests/downstream/smoke_langchain_mcp.py

uv run --isolated --no-project --no-config \
    --with langchain-mcp-adapters --with langchain \
    python tests/downstream/smoke_langchain_mcp_adapters.py