aws-samples / aws-samples/sample-spec-driven-presentation-maker
chore: migrate MCP servers to mcp SDK 2.0 (FastMCP removed)
- Dominant language
- Python
- Stars
- 128
- Forks
- 10
- Avg merge
- 4d 40m
- Merged PRs (30d)
- 8
Description
## Summary
`mcp` 2.0.0 removes `mcp.server.fastmcp` — both servers fail at import time:
```
File "servers/local/server.py", line 31
from mcp.server.fastmcp import FastMCP
ModuleNotFoundError: No module named 'mcp.server.fastmcp'
```
In 2.0 the server API lives in `mcp.server.mcpserver` (`MCPServer`), and the
old FastMCP class is gone (`mcp.server` now exposes `mcpserver`, `lowlevel`,
`apps`, ... — no `fastmcp`). This is not a drop-in bump; it needs a migration.
Dependabot PRs #295 (servers/local range widening to `<3`) and #297
(servers/remote `mcp==2.0.0`) were closed with this evidence. The `<2` upper
bound in both `pyproject.toml` files stays until this issue is done.
Verified locally: `uv pip install mcp[cli]==2.0.0` into the servers/local venv →
`import server` fails as above. With mcp 1.28/1.29 everything is green.
## Scope
- `servers/local/server.py` (+ `server_acp.py` if it touches mcp server APIs)
- `servers/remote/server.py`
- Both `pyproject.toml` bounds + `servers/remote/constraints.txt` (`make lock`)
- Check the FastMCP-specific surface we use: `mcp.tool()` registration,
instructions, streamable-HTTP transport wiring in remote, stdio in local
## Migration reference
- SDK v2 migration guide: https://github.com/modelcontextprotocol/python-sdk (2.0 release notes)
- New entry point: `mcp.server.mcpserver.MCPServer`
## Acceptance
- Both servers start and register all contract tools on mcp 2.x
- `make test` green; local stdio smoke test + remote container-deps resolve
- Dependabot upper bound relaxed to `<3`
Contributor guide
Research direction
Start with servers/local/server.py and servers/remote/server.py, checking server_acp.py if it uses MCP APIs, then read the SDK v2 migration guide. Review the FastMCP registration and transport usage, update both pyproject.toml bounds and servers/remote/constraints.txt with make lock, and run make test plus the local stdio and remote dependency checks. Done means both servers start, register all contract tools on MCP 2.x, and the upper bound is relaxed to <3.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100