You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
Copy file name to clipboardExpand all lines: README.md
+26-9Lines changed: 26 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -71,18 +71,35 @@ Connections between clients and servers are established through transports like
71
71
72
72
## Quick Start
73
73
74
-
### Creating a Server
74
+
### FastMCP
75
75
76
-
MCP servers follow a decorator approach to register handlers for MCP primitives like resources, prompts, and tools. The goal is to provide a simple interface for exposing capabilities to LLM clients.
76
+
The fastest way to build MCP servers is with FastMCP, which provides a high-level, Pythonic interface:
77
77
78
-
**example_server.py**
78
+
```python
79
+
from fastmcp import FastMCP
80
+
81
+
mcp = FastMCP("Demo")
82
+
83
+
@mcp.tool()
84
+
defadd(a: int, b: int) -> int:
85
+
"""Add two numbers"""
86
+
return a + b
87
+
88
+
@mcp.resource("greeting://{name}")
89
+
defget_greeting(name: str) -> str:
90
+
"""Get a personalized greeting"""
91
+
returnf"Hello, {name}!"
92
+
```
93
+
94
+
FastMCP handles all the complex protocol details and server management, so you can focus on building great tools. It's designed to be high-level and Pythonic - in most cases, decorating a function is all you need.
95
+
96
+
For more information about FastMCP, see the [FastMCP documentation](https://github.com/jlowin/fastmcp).
97
+
98
+
### Low-Level Implementation
99
+
100
+
For more control, you can use the low-level MCP implementation directly. This gives you full access to the protocol and allows you to customize every aspect of your server:
79
101
80
102
```python
81
-
# /// script
82
-
# dependencies = [
83
-
# "mcp"
84
-
# ]
85
-
# ///
86
103
from mcp.server import Server, NotificationOptions
87
104
from mcp.server.models import InitializationOptions
88
105
import mcp.server.stdio
@@ -339,4 +356,4 @@ We are passionate about supporting contributors of all levels of experience and
339
356
340
357
## License
341
358
342
-
This project is licensed under the MIT License - see the LICENSE file for details.
359
+
This project is licensed under the MIT License - see the LICENSE file for details.
0 commit comments