MCP Python SDK v2 Migration
This release upgrades the server's protocol dependency from the MCP Python SDK v1 to v2 (mcp 1.29.0 → 2.1.1). The external protocol surface — tool names, descriptions, input schemas, and runtime behavior — is unchanged. All existing client configurations work without modification.
Why v4.0.0?
The mcp v2 SDK removed mcp.server.fastmcp entirely. Code importing from that module raises ModuleNotFoundError under mcp 2.x. This is a hard protocol dependency break: environments pinned to mcp<2 cannot install this release alongside other mcp 2.x tools without isolating. The major version reflects that boundary, even though callers see identical behavior from the tools themselves.
What changed
Import updated (server.py): FastMCP is renamed MCPServer in mcp v2 and moved to mcp.server.mcpserver.
# v3.x
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("Doxygen")
# v4.0.0
from mcp.server.mcpserver import MCPServer
mcp = MCPServer("Doxygen")The @mcp.tool() decorator API and mcp.run() call site are unchanged. MCPServer is a drop-in rename with the same high-level interface.
Dependency bump (pyproject.toml): mcp>=1.0.0,<2.0.0 → mcp>=2.0.0,<3.0.0
Lock file (uv.lock): mcp 1.29.0 → 2.1.1. Transitive changes:
- Added:
httpx2,httpcore2,mcp-types,opentelemetry-api - Removed:
httpx-sse,pydantic-settings,python-dotenv
Spec: This migration was developed against specs/001-mcp-v2-migration/ (spec.md + plan.md), using the MCP Python SDK v1→v2 Migration Guide as the upstream reference.
What did not change
- All 7 tool names, descriptions, and input schemas
DoxygenConfigPydantic model andto_doxyfile()logicmcp.run()entry point (stdio transport, no arguments)__main__.pyand__init__.py- Test suite (14/14 pass, no new skips)
Verification
uv run python -c "from doxygen_mcp.server import mcp; print(type(mcp).__name__)"→MCPServeruv run pytest→ 14 passed, 0 faileduv run ruff check src/ tests/→ 0 errorshooks/ci-check.sh→ green