File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -135,19 +135,19 @@ uv run mcp
135135
136136Let's create a simple MCP server that exposes a calculator tool and some data:
137137
138- <!-- snippet-source examples/snippets/servers/fastmcp_quickstart .py -->
138+ <!-- snippet-source examples/snippets/servers/mcpserver_quickstart .py -->
139139``` python
140140"""
141- FastMCP quickstart example.
141+ MCPServer quickstart example.
142142
143143Run from the repository root:
144- uv run examples/snippets/servers/fastmcp_quickstart .py
144+ uv run examples/snippets/servers/mcpserver_quickstart .py
145145"""
146146
147- from mcp.server.fastmcp import FastMCP
147+ from mcp.server.mcpserver import MCPServer
148148
149149# Create an MCP server
150- mcp = FastMCP (" Demo" , json_response = True )
150+ mcp = MCPServer (" Demo" )
151151
152152
153153# Add an addition tool
@@ -179,10 +179,10 @@ def greet_user(name: str, style: str = "friendly") -> str:
179179
180180# Run with streamable HTTP transport
181181if __name__ == " __main__" :
182- mcp.run(transport = " streamable-http" )
182+ mcp.run(transport = " streamable-http" , json_response = True )
183183```
184184
185- _ Full example: [ examples/snippets/servers/fastmcp_quickstart .py] ( https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/fastmcp_quickstart .py ) _
185+ _ Full example: [ examples/snippets/servers/mcpserver_quickstart .py] ( https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/mcpserver_quickstart .py ) _
186186<!-- /snippet-source -->
187187
188188You can install this server in [ Claude Code] ( https://docs.claude.com/en/docs/claude-code/mcp ) and interact with it right away. First, run the server:
You can’t perform that action at this time.
0 commit comments