Skip to content

feat: Integrate FastMCP #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Dec 23, 2024
Merged

feat: Integrate FastMCP #106

merged 20 commits into from
Dec 23, 2024

Conversation

dsp-ant
Copy link
Member

@dsp-ant dsp-ant commented Dec 18, 2024

Summary

  • Integrate FastMCP by Jeremiah Lowin into the official MCP Python SDK. FastMCP provides a high-level, Pythonic interface for building MCP servers.
  • We are moving fastmcp in as mcp.server.fastmcp and expose the FastMCP class directly as mcp.server.FastMCP.
  • We move all of the existing sdk into mcp.server.lowlevel but expose classes still via mcp.server to allow for backwards compatibilty. There is a low risk of BC breakage if people rely on re-exports particular imports from the current mcp.server.
  • We move in the fastmcp cli under mcp.cli and install it as an optional package mcp[cli]. The exeutable is now is called mcp

Compatibility

The change should be BC compatible. If not than it's a bug. We will release this as a minor version update, 1.2.0. In version 2.0.0 of the SDK, FastMCP will likely be renamed to Server and exposed as such directly from mcp.server, while the current SDK implementation will no longer be exposed via mcp.server, but only via mcp.server.lowlevel.

Modules Naming

I am not set on the names of the mdoules. Feel free to modify or suggest changes as you see fit.

Test plan

  • Test FastMCP examples
  • Test FastMCP tests

dsp-ant and others added 16 commits December 21, 2024 00:41
This commit integrates FastMCP, a high-level MCP server implementation originally written by Jeremiah Lowin,
into the official MCP SDK. It also updates dependencies and adds new dev dependencies.
It moves the existing SDK into a .lowlevel .
…erences with defaults

Pydantic now uses allOf to combine model references with default values in JSON schema output.
Update all FastMCP examples to use mcp.server.fastmcp instead of fastmcp.
Add tests to verify example servers work correctly.

Changes:
- Update import paths in all example files
- Create test_examples.py to verify functionality
- Fix test assertions to match actual response format
Update the README.md to include FastMCP as the recommended way to build MCP servers. FastMCP is a high-level, Pythonic interface that makes it easy to build MCP servers with minimal boilerplate. The low-level implementation is still available for more control.

🤖 Generated with Claude CLI.

Co-Authored-By: Claude <noreply@anthropic.com>
Add back sections on low-level server implementation, client usage, MCP primitives and server capabilities that were previously removed.
@dsp-ant dsp-ant force-pushed the davidsp/fastmcp branch 2 times, most recently from d10be7e to 9d58fed Compare December 21, 2024 00:52
@dsp-ant dsp-ant merged commit 59fff69 into main Dec 23, 2024
5 checks passed
@dsp-ant dsp-ant deleted the davidsp/fastmcp branch December 23, 2024 16:00
@Sillocan
Copy link

Sillocan commented May 6, 2025

This personally caused a ton of confusion with fastmcp in https://github.com/jlowin/fastmcp which is not compatible. You may want to add docs to indicate that these are in no way the same package.

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.

2 participants