Spaces:
Running
Running
Merge pull request #24 from jlowin/readme
Browse files
README.md
CHANGED
|
@@ -7,11 +7,11 @@
|
|
| 7 |
[](https://github.com/jlowin/fastmcp/actions/workflows/run-tests.yml)
|
| 8 |
[](https://github.com/jlowin/fastmcp/blob/main/LICENSE)
|
| 9 |
|
| 10 |
-
A fast, Pythonic way to build Model Context Protocol servers
|
| 11 |
|
| 12 |
</div>
|
| 13 |
|
| 14 |
-
FastMCP makes building
|
| 15 |
|
| 16 |
```python
|
| 17 |
from fastmcp import FastMCP
|
|
@@ -26,15 +26,17 @@ def add(a: int, b: int) -> int:
|
|
| 26 |
|
| 27 |
That's it! 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.
|
| 28 |
|
| 29 |
-
🚨 🚧 🏗️ *FastMCP is under active development, as is the MCP specification itself. Core features are working but some advanced capabilities are still in progress.*
|
| 30 |
|
| 31 |
-
Key features:
|
| 32 |
* **Fast**: High-level interface means less code and faster development
|
| 33 |
* **Simple**: Build MCP servers with minimal boilerplate
|
| 34 |
* **Pythonic**: Feels natural to Python developers
|
| 35 |
* **Complete***: FastMCP aims to provide a full implementation of the core MCP specification
|
| 36 |
|
| 37 |
-
(\*emphasis on *aims*
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
<!-- omit in toc -->
|
| 40 |
## Table of Contents
|
|
@@ -107,19 +109,21 @@ fastmcp install server.py
|
|
| 107 |
fastmcp dev server.py
|
| 108 |
```
|
| 109 |
|
| 110 |
-
](https://modelcontextprotocol.io) lets you build servers that expose data and functionality to LLM applications in a secure, standardized way. Think of it like a web API, but specifically designed for LLM interactions. MCP servers can:
|
| 115 |
|
| 116 |
-
- Expose data through **Resources** (like GET endpoints)
|
| 117 |
-
- Provide functionality through **Tools** (like POST endpoints)
|
| 118 |
- Define interaction patterns through **Prompts** (reusable templates for LLM interactions)
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
## Core Concepts
|
| 121 |
|
| 122 |
-
*Note: All code examples below assume you've created a FastMCP server instance called `mcp`.*
|
| 123 |
|
| 124 |
### Server
|
| 125 |
|
|
@@ -134,6 +138,7 @@ mcp = FastMCP("My App")
|
|
| 134 |
# Configure host/port for HTTP transport (optional)
|
| 135 |
mcp = FastMCP("My App", host="localhost", port=8000)
|
| 136 |
```
|
|
|
|
| 137 |
|
| 138 |
### Resources
|
| 139 |
|
|
@@ -376,4 +381,4 @@ Schema:
|
|
| 376 |
{get_schema()}
|
| 377 |
|
| 378 |
What insights can you provide about the structure and relationships?"""
|
| 379 |
-
```
|
|
|
|
| 7 |
[](https://github.com/jlowin/fastmcp/actions/workflows/run-tests.yml)
|
| 8 |
[](https://github.com/jlowin/fastmcp/blob/main/LICENSE)
|
| 9 |
|
| 10 |
+
A fast, Pythonic way to build [Model Context Protocol (MCP)](https://modelcontextprotocol.io) servers
|
| 11 |
|
| 12 |
</div>
|
| 13 |
|
| 14 |
+
FastMCP makes building MCP servers simple and intuitive. Create tools, expose resources, and define prompts with clean, Pythonic code:
|
| 15 |
|
| 16 |
```python
|
| 17 |
from fastmcp import FastMCP
|
|
|
|
| 26 |
|
| 27 |
That's it! 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.
|
| 28 |
|
|
|
|
| 29 |
|
| 30 |
+
### Key features:
|
| 31 |
* **Fast**: High-level interface means less code and faster development
|
| 32 |
* **Simple**: Build MCP servers with minimal boilerplate
|
| 33 |
* **Pythonic**: Feels natural to Python developers
|
| 34 |
* **Complete***: FastMCP aims to provide a full implementation of the core MCP specification
|
| 35 |
|
| 36 |
+
(\*emphasis on *aims*)
|
| 37 |
+
|
| 38 |
+
🚨 🚧 🏗️ *FastMCP is under active development, as is the MCP specification itself. Core features are working but some advanced capabilities are still in progress.*
|
| 39 |
+
|
| 40 |
|
| 41 |
<!-- omit in toc -->
|
| 42 |
## Table of Contents
|
|
|
|
| 109 |
fastmcp dev server.py
|
| 110 |
```
|
| 111 |
|
| 112 |
+

|
| 113 |
|
| 114 |
## What is MCP?
|
| 115 |
|
| 116 |
The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) lets you build servers that expose data and functionality to LLM applications in a secure, standardized way. Think of it like a web API, but specifically designed for LLM interactions. MCP servers can:
|
| 117 |
|
| 118 |
+
- Expose data through **Resources** (think of these sort of like GET endpoints; they are used to load information into the LLM's context)
|
| 119 |
+
- Provide functionality through **Tools** (sort of like POST endpoints; they are used to execute code or otherwise produce a side effect)
|
| 120 |
- Define interaction patterns through **Prompts** (reusable templates for LLM interactions)
|
| 121 |
+
- And more!
|
| 122 |
+
|
| 123 |
+
There is a low-level [Python SDK](https://github.com/modelcontextprotocol/python-sdk) available for implementing the protocol directly, but FastMCP aims to make that easier by providing a high-level, Pythonic interface.
|
| 124 |
|
| 125 |
## Core Concepts
|
| 126 |
|
|
|
|
| 127 |
|
| 128 |
### Server
|
| 129 |
|
|
|
|
| 138 |
# Configure host/port for HTTP transport (optional)
|
| 139 |
mcp = FastMCP("My App", host="localhost", port=8000)
|
| 140 |
```
|
| 141 |
+
*Note: All of the following code examples assume you've created a FastMCP server instance called `mcp`, as shown above.*
|
| 142 |
|
| 143 |
### Resources
|
| 144 |
|
|
|
|
| 381 |
{get_schema()}
|
| 382 |
|
| 383 |
What insights can you provide about the structure and relationships?"""
|
| 384 |
+
```
|