-
Notifications
You must be signed in to change notification settings - Fork 3k
Rename FastMCP to MCPServer
#1951
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
base: main
Are you sure you want to change the base?
Conversation
| from mcp.server.mcpserver import MCPServer | ||
|
|
||
| # Transport params in constructor | ||
| mcp = FastMCP("Demo", json_response=True, stateless_http=True) | ||
| mcp = MCPServer("Demo", json_response=True, stateless_http=True) | ||
| mcp.run(transport="streamable-http") | ||
|
|
||
| # Or for SSE | ||
| mcp = FastMCP("Server", host="0.0.0.0", port=9000, sse_path="/events") | ||
| mcp = MCPServer("Server", host="0.0.0.0", port=9000, sse_path="/events") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| from mcp.server.mcpserver import MCPServer | |
| # Transport params in constructor | |
| mcp = FastMCP("Demo", json_response=True, stateless_http=True) | |
| mcp = MCPServer("Demo", json_response=True, stateless_http=True) | |
| mcp.run(transport="streamable-http") | |
| # Or for SSE | |
| mcp = FastMCP("Server", host="0.0.0.0", port=9000, sse_path="/events") | |
| mcp = MCPServer("Server", host="0.0.0.0", port=9000, sse_path="/events") | |
| from mcp.server.fastmcp import FastMCP | |
| # Transport params in constructor | |
| mcp = FastMCP("Demo", json_response=True, stateless_http=True) | |
| mcp.run(transport="streamable-http") | |
| # Or for SSE | |
| mcp = FastMCP("Server", host="0.0.0.0", port=9000, sse_path="/events") |
| @@ -1,8 +0,0 @@ | |||
| """FastMCP - A more ergonomic interface for MCP servers.""" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guessing we don't want a backwards compatible shim since we'll be making breaking changes anyway?
| ```python | ||
| # Before (v1) | ||
| mcp = FastMCP("App", json_response=True) | ||
| mcp = MCPServer("App", json_response=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| mcp = MCPServer("App", json_response=True) | |
| mcp = FastMCP("App", json_response=True) |
| ``` | ||
|
|
||
| ### `mount_path` parameter removed from FastMCP | ||
| ### `mount_path` parameter removed from MCPServer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a section for the rename
| """Convert a result to a sequence of content objects. | ||
| Note: This conversion logic comes from previous versions of FastMCP and is being | ||
| Note: This conversion logic comes from previous versions of MCPServer and is being |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Note: This conversion logic comes from previous versions of MCPServer and is being | |
| Note: This conversion logic comes from previous versions of MCPServer (previously called FastMCP) and is being |
very minor nit, probably easy to dismiss since we should remove this anyway
| ### Server | ||
|
|
||
| The FastMCP server is your core interface to the MCP protocol. It handles connection management, protocol compliance, and message routing: | ||
| The MCPServer server is your core interface to the MCP protocol. It handles connection management, protocol compliance, and message routing: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The MCPServer Server" is gonna get confusing.. didn't think about that before
| mcp = FastMCP( | ||
| title="FastMCP Server", | ||
| mcp = MCPServer( | ||
| title="MCPServer Server", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"MCPServer Server" not super nice :/
|
|
||
| model_config = SettingsConfigDict( | ||
| env_prefix="FASTMCP_", | ||
| env_prefix="MCP_", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth calling this out in migration docs
| """Create a FastMCP server for testing.""" | ||
| server = FastMCP("test") | ||
| def mcpserver_server() -> MCPServer: | ||
| """Create a MCPServer server for testing.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| """Create a MCPServer server for testing.""" | |
| """Create an MCPServer server for testing.""" |
Should be "an" because MCPServer starts with an "em" sound.
| """Create a FastMCP server for testing.""" | ||
| server = FastMCP("test") | ||
| def app() -> MCPServer: | ||
| """Create a MCPServer server for testing.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| """Create a MCPServer server for testing.""" | |
| """Create an MCPServer server for testing.""" |
No description provided.