fastmcp 2.1.0__py3-none-any.whl → 2.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,21 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastmcp
3
- Version: 2.1.0
4
- Summary: An ergonomic MCP interface
3
+ Version: 2.1.2
4
+ Summary: The fast, Pythonic way to build MCP servers.
5
+ Project-URL: Homepage, https://gofastmcp.com
6
+ Project-URL: Repository, https://github.com/jlowin/fastmcp
7
+ Project-URL: Documentation, https://gofastmcp.com
5
8
  Author: Jeremiah Lowin
6
- License: Apache-2.0
9
+ License-Expression: Apache-2.0
7
10
  License-File: LICENSE
11
+ Keywords: agent,fastmcp,llm,mcp,mcp client,mcp server,model context protocol
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
+ Classifier: Typing :: Typed
8
19
  Requires-Python: >=3.10
9
20
  Requires-Dist: dotenv>=0.9.9
10
21
  Requires-Dist: fastapi>=0.115.12
@@ -19,15 +30,17 @@ Description-Content-Type: text/markdown
19
30
 
20
31
  <!-- omit in toc -->
21
32
  # FastMCP v2 🚀
22
- <strong>The fast, Pythonic way to build MCP servers.</strong>
33
+ <strong>The fast, Pythonic way to build MCP servers and clients.</strong>
23
34
 
35
+ [![Docs](https://img.shields.io/badge/docs-gofastmcp.com-blue)](https://gofastmcp.com)
24
36
  [![PyPI - Version](https://img.shields.io/pypi/v/fastmcp.svg)](https://pypi.org/project/fastmcp)
25
37
  [![Tests](https://github.com/jlowin/fastmcp/actions/workflows/run-tests.yml/badge.svg)](https://github.com/jlowin/fastmcp/actions/workflows/run-tests.yml)
26
38
  [![License](https://img.shields.io/github/license/jlowin/fastmcp.svg)](https://github.com/jlowin/fastmcp/blob/main/LICENSE)
27
39
 
40
+ <a href="https://trendshift.io/repositories/13266" target="_blank"><img src="https://trendshift.io/api/badge/repositories/13266" alt="jlowin%2Ffastmcp | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
28
41
  </div>
29
42
 
30
- [Model Context Protocol (MCP)](https://modelcontextprotocol.io) servers are a standardized way to provide context and tools to your LLMs, and FastMCP makes building *and interacting with* them simple and intuitive. Create tools, expose resources, define prompts, and connect components with clean, Pythonic code.
43
+ The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) is a new, standardized way to provide context and tools to your LLMs, and FastMCP makes building MCP servers and clients simple and intuitive. Create tools, expose resources, define prompts, and connect components with clean, Pythonic code.
31
44
 
32
45
  ```python
33
46
  # server.py
@@ -44,48 +57,27 @@ if __name__ == "__main__":
44
57
  mcp.run()
45
58
  ```
46
59
 
47
- Run it locally for testing:
48
- ```bash
49
- fastmcp dev server.py
50
- ```
51
60
 
52
- Install it for use with Claude Desktop:
61
+ Run the server locally:
53
62
  ```bash
54
- fastmcp install server.py
63
+ fastmcp run server.py
55
64
  ```
56
65
 
57
66
  FastMCP handles the complex protocol details and server management, letting you focus on building great tools and applications. It's designed to feel natural to Python developers.
58
67
 
59
- ## Key Features:
60
-
61
- * **Simple Server Creation:** Build MCP servers with minimal boilerplate using intuitive decorators (`@tool`, `@resource`, `@prompt`).
62
- * **Proxy MCP Servers:** Create proxy servers to expose existing MCP servers or clients with modifications, or convert between transport protocols (e.g., expose a Stdio server via SSE for web access).
63
- * **Compose MCP Servers:** Compose complex applications by mounting multiple FastMCP servers together.
64
- * **API Generation:** Automatically create MCP servers from existing **OpenAPI specifications** or **FastAPI applications**.
65
- * **Powerful Clients:** Programmatically interact with *any* MCP server, regardless of how it was built.
66
- * **LLM Sampling:** Request completions from client LLMs directly within your MCP tools.
67
- * **Pythonic Interface:** Designed with familiar Python patterns like decorators and type hints.
68
- * **Context Injection:** Easily access core MCP capabilities like sampling, logging, and progress reporting within your functions.
69
-
70
- ---
71
-
72
- ### What's New in v2?
73
-
74
- FastMCP 1.0 made it so easy to build MCP servers that it's now part of the [official Model Context Protocol Python SDK](https://github.com/modelcontextprotocol/python-sdk)! For basic use cases, you can use the upstream version by importing `mcp.server.fastmcp.FastMCP` (or installing `fastmcp=1.0`).
75
-
76
- Based on how the MCP ecosystem is evolving, FastMCP 2.0 builds on that foundation to introduce a variety of new features (and more experimental ideas). It adds advanced features like proxying and composing MCP servers, as well as automatically generating them from OpenAPI specs or FastAPI objects. FastMCP 2.0 also introduces new client-side functionality like LLM sampling.
77
-
78
-
79
- ---
80
68
 
81
69
  <!-- omit in toc -->
82
70
  ## Table of Contents
83
71
 
84
- - [Key Features:](#key-features)
85
- - [What's New in v2?](#whats-new-in-v2)
86
- - [Installation](#installation)
87
- - [Quickstart](#quickstart)
88
72
  - [What is MCP?](#what-is-mcp)
73
+ - [Why FastMCP?](#why-fastmcp)
74
+ - [Key Features](#key-features)
75
+ - [Servers](#servers)
76
+ - [Clients](#clients)
77
+ - [What's New in v2?](#whats-new-in-v2)
78
+ - [Documentation](#documentation)
79
+ - [Installation](#installation)
80
+ - [Quickstart](#quickstart)
89
81
  - [Core Concepts](#core-concepts)
90
82
  - [The `FastMCP` Server](#the-fastmcp-server)
91
83
  - [Tools](#tools)
@@ -115,7 +107,62 @@ Based on how the MCP ecosystem is evolving, FastMCP 2.0 builds on that foundatio
115
107
  - [Formatting \& Linting](#formatting--linting)
116
108
  - [Pull Requests](#pull-requests)
117
109
 
118
- ## Installation
110
+
111
+ ## What is MCP?
112
+
113
+ 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:
114
+
115
+ - Expose data through **Resources** (think GET endpoints; load info into context)
116
+ - Provide functionality through **Tools** (think POST/PUT endpoints; execute actions)
117
+ - Define interaction patterns through **Prompts** (reusable templates)
118
+ - And more!
119
+
120
+ FastMCP provides a high-level, Pythonic interface for building and interacting with these servers.
121
+
122
+ ## Why FastMCP?
123
+
124
+ The MCP protocol is powerful but implementing it involves a lot of boilerplate - server setup, protocol handlers, content types, error management. 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.
125
+
126
+ FastMCP aims to be:
127
+
128
+
129
+ 🚀 **Fast:** High-level interface means less code and faster development
130
+
131
+ 🍀 **Simple:** Build MCP servers with minimal boilerplate
132
+
133
+ 🐍 **Pythonic:** Feels natural to Python developers
134
+
135
+ 🔍 **Complete:** FastMCP aims to provide a full implementation of the core MCP specification for both servers and clients
136
+
137
+ ## Key Features
138
+
139
+ ### Servers
140
+ - **Create** servers with minimal boilerplate using intuitive decorators
141
+ - **Proxy** existing servers to modify configuration or transport
142
+ - **Compose** servers by into complex applications
143
+ - **Generate** servers from OpenAPI specs or FastAPI objects
144
+
145
+ ### Clients
146
+ - **Interact** with MCP servers programmatically
147
+ - **Connect** to any MCP server using any transport
148
+ - **Test** your servers without manual intervention
149
+ - **Innovate** with core MCP capabilities like LLM sampling
150
+
151
+
152
+ ## What's New in v2?
153
+
154
+ FastMCP 1.0 made it so easy to build MCP servers that it's now part of the [official Model Context Protocol Python SDK](https://github.com/modelcontextprotocol/python-sdk)! For basic use cases, you can use the upstream version by importing `mcp.server.fastmcp.FastMCP` (or installing `fastmcp=1.0`).
155
+
156
+ Based on how the MCP ecosystem is evolving, FastMCP 2.0 builds on that foundation to introduce a variety of new features (and more experimental ideas). It adds advanced features like proxying and composing MCP servers, as well as automatically generating them from OpenAPI specs or FastAPI objects. FastMCP 2.0 also introduces new client-side functionality like LLM sampling.
157
+
158
+
159
+ ## Documentation
160
+
161
+ 📚 FastMCP's documentation is available at [gofastmcp.com](https://gofastmcp.com).
162
+
163
+ ---
164
+
165
+ ### Installation
119
166
 
120
167
  We strongly recommend installing FastMCP with [uv](https://docs.astral.sh/uv/), as it is required for deploying servers via the CLI:
121
168
 
@@ -134,7 +181,7 @@ cd fastmcp
134
181
  uv sync
135
182
  ```
136
183
 
137
- ## Quickstart
184
+ ### Quickstart
138
185
 
139
186
  Let's create a simple MCP server that exposes a calculator tool and some data:
140
187
 
@@ -163,23 +210,8 @@ You can install this server in [Claude Desktop](https://claude.ai/download) and
163
210
  fastmcp install server.py
164
211
  ```
165
212
 
166
- Alternatively, you can test it with the MCP Inspector:
167
- ```bash
168
- fastmcp dev server.py
169
- ```
170
-
171
213
  ![MCP Inspector](/docs/assets/demo-inspector.png)
172
214
 
173
- ## What is MCP?
174
-
175
- 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:
176
-
177
- - Expose data through **Resources** (think GET endpoints; load info into context)
178
- - Provide functionality through **Tools** (think POST/PUT endpoints; execute actions)
179
- - Define interaction patterns through **Prompts** (reusable templates)
180
- - And more!
181
-
182
- FastMCP provides a high-level, Pythonic interface for building and interacting with these servers.
183
215
 
184
216
  ## Core Concepts
185
217
 
@@ -767,4 +799,4 @@ We use `ruff` via `pre-commit`.
767
799
 
768
800
  Please open an issue or discussion for questions or suggestions!
769
801
 
770
- </details>
802
+ </details>
@@ -0,0 +1,40 @@
1
+ fastmcp/__init__.py,sha256=2bwhjiyLJisyobp1O9tVYMjriHZAx_f4bIKJYOL-Rpk,399
2
+ fastmcp/exceptions.py,sha256=9_KfANmugNdfZTCSZrohSeVmFmILZX5zz1LXI3wr_pw,508
3
+ fastmcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ fastmcp/settings.py,sha256=r5LT5yAZmwS1Lppro_fzdrCUJ0otnAmgtjsNgDdQIvs,1980
5
+ fastmcp/cli/__init__.py,sha256=Ii284TNoG5lxTP40ETMGhHEq3lQZWxu9m9JuU57kUpQ,87
6
+ fastmcp/cli/claude.py,sha256=IAlcZ4qZKBBj09jZUMEx7EANZE_IR3vcu7zOBJmMOuU,4567
7
+ fastmcp/cli/cli.py,sha256=M3BAkCjtnoGbyorUgaiqmCVSQg7S7_uEXerY-pqnOhk,13997
8
+ fastmcp/client/__init__.py,sha256=BXO9NUhntZ5GnUACfaRCzDJ5IzxqFJs8qKG-CRMSco4,490
9
+ fastmcp/client/base.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
10
+ fastmcp/client/client.py,sha256=OMJ1FzrlcRRYKQg3DFxiQpaNDo4uYK3Acs23rxPyE-g,7941
11
+ fastmcp/client/roots.py,sha256=IxI_bHwHTmg6c2H-s1av1ZgrRnNDieHtYwdGFbzXT5c,2471
12
+ fastmcp/client/sampling.py,sha256=WdRhIZbWv54rXYI8lWHv0thXmGCloZYPFpwJK9El_sQ,1613
13
+ fastmcp/client/transports.py,sha256=WVChsDV1UF0I3reiefsT3dipIh-P_K262TXpucwH-YY,14602
14
+ fastmcp/prompts/__init__.py,sha256=LtPAv2JKIu54AwUd3iwv-HUd4DPcwgEqy6itEd3BH_E,194
15
+ fastmcp/prompts/prompt.py,sha256=TCjIn0RyYsKDKjBYMuzSvmZPzigw4Y05EOvM0u_WBuk,5992
16
+ fastmcp/prompts/prompt_manager.py,sha256=fX8Ckha0byC2VEgwRoM8_w8orNAkcdxEZRCd6oRtvo4,3533
17
+ fastmcp/resources/__init__.py,sha256=t0x1j8lc74rjUKtXe9H5Gs4fpQt82K4NgBK6Y7A0xTg,467
18
+ fastmcp/resources/resource.py,sha256=qTAj6v_NrOhI_Hd1Mc6VfsmgSNFAxsBdCJTF9W-nU_s,1755
19
+ fastmcp/resources/resource_manager.py,sha256=Ei1QthTUgjvSXIN-qXQeBd7aQiBNNsv0SY_lMtV9tfw,10997
20
+ fastmcp/resources/template.py,sha256=_4JaMeYqtQYs1IO-lgBehaHJqp16G1pQ1Qe1f9YYoNg,3455
21
+ fastmcp/resources/types.py,sha256=tigil7z-SUJMakGXzDLIGSqTepPrAsRpwqwtBA4yoUY,6168
22
+ fastmcp/server/__init__.py,sha256=pdkghG11VLMZiluQ-4_rl2JK1LMWmV003m9dDRUN8W4,92
23
+ fastmcp/server/context.py,sha256=s1885AZRipKB3VltfaO3VEtMxGefKs8fdZByj-4tbNI,7120
24
+ fastmcp/server/openapi.py,sha256=J7HrAlRziaB2a6pwB0wStbjRJ1E5Lf818yMqD762s5U,22693
25
+ fastmcp/server/proxy.py,sha256=gYcoQFDIBraqWMOpWSsZLqefKjL_v0v74juLW1SU1AU,8058
26
+ fastmcp/server/server.py,sha256=ryN7o7G1gNFE1NsAuZVc3WpcmsBtcKOo-mXACN5NCoc,28814
27
+ fastmcp/tools/__init__.py,sha256=ocw-SFTtN6vQ8fgnlF8iNAOflRmh79xS1xdO0Bc3QPE,96
28
+ fastmcp/tools/tool.py,sha256=pD3xOtryldu6lYsM5cOHnS05tJq9EwmQaoNUCZzLcoY,3598
29
+ fastmcp/tools/tool_manager.py,sha256=p-L1KK8ecwP2psoyrcaSwHmeUKQZf-2pLPv6S_qgIcM,3525
30
+ fastmcp/utilities/__init__.py,sha256=-imJ8S-rXmbXMWeDamldP-dHDqAPg_wwmPVz-LNX14E,31
31
+ fastmcp/utilities/decorators.py,sha256=AjhjsetQZF4YOPV5MTZmIxO21iFp_4fDIS3O2_KNCEg,2990
32
+ fastmcp/utilities/func_metadata.py,sha256=uh-u3gAjLD4kCcGf0ZkZZwBTTl-84JuANZTnDqP5ztI,7841
33
+ fastmcp/utilities/logging.py,sha256=zav8pnFxG_fvGJHUV2XpobmT9WVrmv1mlQBSCz-CPx4,1159
34
+ fastmcp/utilities/openapi.py,sha256=PrH3usbTblaVC6jIH1UGiPEfgB2sSCLj33zA5dH7o_s,45193
35
+ fastmcp/utilities/types.py,sha256=m2rPYMzO-ZFvvZ46N-1-Xqyw693K7yq9Z2xR4pVELyk,2091
36
+ fastmcp-2.1.2.dist-info/METADATA,sha256=I3ePFWEbVbqKFh3UG6bnScng4t5WEhpbq3YNR-VET34,27467
37
+ fastmcp-2.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
38
+ fastmcp-2.1.2.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
39
+ fastmcp-2.1.2.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
40
+ fastmcp-2.1.2.dist-info/RECORD,,
@@ -1,39 +0,0 @@
1
- fastmcp/__init__.py,sha256=2bwhjiyLJisyobp1O9tVYMjriHZAx_f4bIKJYOL-Rpk,399
2
- fastmcp/exceptions.py,sha256=q9djUDmpwmGEWcHI8q4UzJBtf7s7UtgL--OB7OaGzyQ,435
3
- fastmcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- fastmcp/settings.py,sha256=r5LT5yAZmwS1Lppro_fzdrCUJ0otnAmgtjsNgDdQIvs,1980
5
- fastmcp/cli/__init__.py,sha256=Ii284TNoG5lxTP40ETMGhHEq3lQZWxu9m9JuU57kUpQ,87
6
- fastmcp/cli/claude.py,sha256=IAlcZ4qZKBBj09jZUMEx7EANZE_IR3vcu7zOBJmMOuU,4567
7
- fastmcp/cli/cli.py,sha256=L1git_8u-OvVCSEtwztHhmJ6WwlFhlvK4gEIAWgrMMM,13933
8
- fastmcp/client/__init__.py,sha256=BXO9NUhntZ5GnUACfaRCzDJ5IzxqFJs8qKG-CRMSco4,490
9
- fastmcp/client/base.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
10
- fastmcp/client/client.py,sha256=OMJ1FzrlcRRYKQg3DFxiQpaNDo4uYK3Acs23rxPyE-g,7941
11
- fastmcp/client/roots.py,sha256=IxI_bHwHTmg6c2H-s1av1ZgrRnNDieHtYwdGFbzXT5c,2471
12
- fastmcp/client/sampling.py,sha256=WdRhIZbWv54rXYI8lWHv0thXmGCloZYPFpwJK9El_sQ,1613
13
- fastmcp/client/transports.py,sha256=gA_aGjgPY2q_PqaURkes_vUKtuUicViTHYEe4TAkDmU,13864
14
- fastmcp/prompts/__init__.py,sha256=wTtTHaYiH-IArcumPSxM1-8V2EGzClVVIP76vwcWsFQ,108
15
- fastmcp/prompts/prompt.py,sha256=br_o7eaLg9j04jqCKxRwnrzkcNxe7rtsScB2qUSh_a8,6445
16
- fastmcp/prompts/prompt_manager.py,sha256=1kWgdTH7WE36F5j-B7cP3q81XxguXiOxpNIi9FANUIg,3461
17
- fastmcp/resources/__init__.py,sha256=ImyPi5xICGW8nN634fP82PzU0SsKCPeJXU-WopVOu6Y,467
18
- fastmcp/resources/resource.py,sha256=MrfRdLA2FEglvRJP7KgduG7na_qgkBo-_iXTzRbil6c,2038
19
- fastmcp/resources/resource_manager.py,sha256=AsK3hxorGbWC04fWGTH0QMqQvOLJDauWdckZiA-DC1E,7849
20
- fastmcp/resources/template.py,sha256=Fpjb51_ktWFpS1aQ5CFCt1SFuPe6S7CPuyzQCz7c3Mg,3742
21
- fastmcp/resources/types.py,sha256=tigil7z-SUJMakGXzDLIGSqTepPrAsRpwqwtBA4yoUY,6168
22
- fastmcp/server/__init__.py,sha256=pdkghG11VLMZiluQ-4_rl2JK1LMWmV003m9dDRUN8W4,92
23
- fastmcp/server/context.py,sha256=SPYr3KUBG9MmKRh6Y6tfzPNgdxR5TmPGfnVwcEMqwMM,7115
24
- fastmcp/server/openapi.py,sha256=J7HrAlRziaB2a6pwB0wStbjRJ1E5Lf818yMqD762s5U,22693
25
- fastmcp/server/proxy.py,sha256=YKSPG2uwmUwHxw9brHmKD-i8noxq0FG4Loln7WGflgc,8019
26
- fastmcp/server/server.py,sha256=B9swucn_1H5Z8Gd_JMG8fvcF8hb5r4C3Kpp7bXoY9LI,26328
27
- fastmcp/tools/__init__.py,sha256=ocw-SFTtN6vQ8fgnlF8iNAOflRmh79xS1xdO0Bc3QPE,96
28
- fastmcp/tools/tool.py,sha256=_BN0ZIMP0NKkRD_9_t_eNWHP6xRfEoSSl-9ZI3V337k,3753
29
- fastmcp/tools/tool_manager.py,sha256=oUT8ExxIKKpJnFxCUDwThRxdK7WADD40e6yjGBYDPmI,3498
30
- fastmcp/utilities/__init__.py,sha256=-imJ8S-rXmbXMWeDamldP-dHDqAPg_wwmPVz-LNX14E,31
31
- fastmcp/utilities/func_metadata.py,sha256=ODD9ds7bGXED27rx4MiMim1EBPnjNHIcXabJhynVKBA,7739
32
- fastmcp/utilities/logging.py,sha256=1ipiOXzgWUp3Vih_JtEiLX7aAFmrUDZNr4KrZbofZTM,818
33
- fastmcp/utilities/openapi.py,sha256=yl83QsOcLZc00vScdL2LpEopzVCv32gDpC5da9NGkTM,30351
34
- fastmcp/utilities/types.py,sha256=m2rPYMzO-ZFvvZ46N-1-Xqyw693K7yq9Z2xR4pVELyk,2091
35
- fastmcp-2.1.0.dist-info/METADATA,sha256=hNrhsqF-IhAt5ExONGcyXbgFTCRV8aVqzVtJl0hTeeA,26270
36
- fastmcp-2.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
37
- fastmcp-2.1.0.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
38
- fastmcp-2.1.0.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
39
- fastmcp-2.1.0.dist-info/RECORD,,