fastmcp 2.8.0__py3-none-any.whl → 2.8.1__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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastmcp
3
- Version: 2.8.0
3
+ Version: 2.8.1
4
4
  Summary: The fast, Pythonic way to build MCP servers.
5
5
  Project-URL: Homepage, https://gofastmcp.com
6
6
  Project-URL: Repository, https://github.com/jlowin/fastmcp
@@ -20,7 +20,7 @@ Requires-Python: >=3.10
20
20
  Requires-Dist: authlib>=1.5.2
21
21
  Requires-Dist: exceptiongroup>=1.2.2
22
22
  Requires-Dist: httpx>=0.28.1
23
- Requires-Dist: mcp<2.0.0,>=1.9.2
23
+ Requires-Dist: mcp<2.0.0,>=1.9.4
24
24
  Requires-Dist: openapi-pydantic>=0.5.1
25
25
  Requires-Dist: python-dotenv>=1.1.0
26
26
  Requires-Dist: rich>=13.9.4
@@ -33,6 +33,7 @@ Description-Content-Type: text/markdown
33
33
 
34
34
  <!-- omit in toc -->
35
35
  # FastMCP v2 🚀
36
+
36
37
  <strong>The fast, Pythonic way to build MCP servers and clients.</strong>
37
38
 
38
39
  *FastMCP is made with 💙 by [Prefect](https://www.prefect.io/)*
@@ -46,13 +47,16 @@ Description-Content-Type: text/markdown
46
47
  </div>
47
48
 
48
49
  > [!Note]
50
+ >
49
51
  > #### Beyond the Protocol
50
- >
51
- > FastMCP is the standard framework for working with the Model Context Protocol. FastMCP 1.0 was incorporated into the [official low-level Python SDK](https://github.com/modelcontextprotocol/python-sdk), and FastMCP 2.0 *(this project)* provides a complete toolkit for working with the MCP ecosystem.
52
52
  >
53
- > FastMCP has a comprehensive set of features that go far beyond the core MCP specification, all in service of providing **the simplest path to production**. These include client support, server composition, auth, automatic generation from OpenAPI specs, remote server proxying, built-in testing tools, integrations, and more.
53
+ > FastMCP is the standard framework for working with the Model Context Protocol. FastMCP 1.0 was incorporated into the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk) in 2024.
54
+ >
55
+ > This is FastMCP 2.0, the **actively maintained version** that provides a complete toolkit for working with the MCP ecosystem.
54
56
  >
55
- > Ready to upgrade or get started? Follow the [installation instructions](/getting-started/installation), which include specific steps for upgrading from the official MCP SDK.
57
+ > FastMCP 2.0 has a comprehensive set of features that go far beyond the core MCP specification, all in service of providing **the simplest path to production**. These include deployment, auth, clients, server proxying and composition, generating servers from REST APIs, dynamic tool rewriting, built-in testing tools, integrations, and more.
58
+ >
59
+ > Ready to upgrade or get started? Follow the [installation instructions](https://gofastmcp.com/getting-started/installation), which include steps for upgrading from the official MCP SDK.
56
60
 
57
61
  ---
58
62
 
@@ -74,6 +78,7 @@ if __name__ == "__main__":
74
78
  ```
75
79
 
76
80
  Run the server locally:
81
+
77
82
  ```bash
78
83
  fastmcp run server.py
79
84
  ```
@@ -82,9 +87,10 @@ fastmcp run server.py
82
87
 
83
88
  FastMCP's complete documentation is available at **[gofastmcp.com](https://gofastmcp.com)**, including detailed guides, API references, and advanced patterns. This readme provides only a high-level overview.
84
89
 
85
- Documentation is also available in [llms.txt format](https://llmstxt.org/), which is a simple markdown standard that LLMs can consume easily.
90
+ Documentation is also available in [llms.txt format](https://llmstxt.org/), which is a simple markdown standard that LLMs can consume easily.
86
91
 
87
92
  There are two ways to access the LLM-friendly documentation:
93
+
88
94
  - [`llms.txt`](https://gofastmcp.com/llms.txt) is essentially a sitemap, listing all the pages in the documentation.
89
95
  - [`llms-full.txt`](https://gofastmcp.com/llms-full.txt) contains the entire documentation. Note this may exceed the context window of your LLM.
90
96
 
@@ -174,7 +180,7 @@ Learn more in the [**FastMCP Server Documentation**](https://gofastmcp.com/serve
174
180
 
175
181
  ### Tools
176
182
 
177
- Tools allow LLMs to perform actions by executing your Python functions (sync or async). Ideal for computations, API calls, or side effects (like `POST`/`PUT`). FastMCP handles schema generation from type hints and docstrings. Tools can return various types, including text, JSON-serializable objects, and even images using the [`fastmcp.Image`](https://gofastmcp.com/servers/tools#return-values) helper.
183
+ Tools allow LLMs to perform actions by executing your Python functions (sync or async). Ideal for computations, API calls, or side effects (like `POST`/`PUT`). FastMCP handles schema generation from type hints and docstrings. Tools can return various types, including text, JSON-serializable objects, and even images or audio aided by the FastMCP media helper classes.
178
184
 
179
185
  ```python
180
186
  @mcp.tool
@@ -220,12 +226,13 @@ Learn more in the [**Prompts Documentation**](https://gofastmcp.com/servers/prom
220
226
  ### Context
221
227
 
222
228
  Access MCP session capabilities within your tools, resources, or prompts by adding a `ctx: Context` parameter. Context provides methods for:
223
- * **Logging:** Log messages to MCP clients with `ctx.info()`, `ctx.error()`, etc.
224
- * **LLM Sampling:** Use `ctx.sample()` to request completions from the client's LLM.
225
- * **HTTP Request:** Use `ctx.http_request()` to make HTTP requests to other servers.
226
- * **Resource Access:** Use `ctx.read_resource()` to access resources on the server
227
- * **Progress Reporting:** Use `ctx.report_progress()` to report progress to the client.
228
- * and more...
229
+
230
+ - **Logging:** Log messages to MCP clients with `ctx.info()`, `ctx.error()`, etc.
231
+ - **LLM Sampling:** Use `ctx.sample()` to request completions from the client's LLM.
232
+ - **HTTP Request:** Use `ctx.http_request()` to make HTTP requests to other servers.
233
+ - **Resource Access:** Use `ctx.read_resource()` to access resources on the server
234
+ - **Progress Reporting:** Use `ctx.report_progress()` to report progress to the client.
235
+ - and more...
229
236
 
230
237
  To access the context, add a parameter annotated as `Context` to any mcp-decorated function. FastMCP will automatically inject the correct context object when the function is called.
231
238
 
@@ -365,16 +372,19 @@ if __name__ == "__main__":
365
372
  FastMCP supports three transport protocols:
366
373
 
367
374
  **STDIO (Default)**: Best for local tools and command-line scripts.
375
+
368
376
  ```python
369
377
  mcp.run(transport="stdio") # Default, so transport argument is optional
370
378
  ```
371
379
 
372
380
  **Streamable HTTP**: Recommended for web deployments.
381
+
373
382
  ```python
374
383
  mcp.run(transport="streamable-http", host="127.0.0.1", port=8000, path="/mcp")
375
384
  ```
376
385
 
377
386
  **SSE**: For compatibility with existing SSE clients.
387
+
378
388
  ```python
379
389
  mcp.run(transport="sse", host="127.0.0.1", port=8000)
380
390
  ```
@@ -387,22 +397,26 @@ Contributions are the core of open source! We welcome improvements and features.
387
397
 
388
398
  ### Prerequisites
389
399
 
390
- * Python 3.10+
391
- * [uv](https://docs.astral.sh/uv/) (Recommended for environment management)
400
+ - Python 3.10+
401
+ - [uv](https://docs.astral.sh/uv/) (Recommended for environment management)
392
402
 
393
403
  ### Setup
394
404
 
395
- 1. Clone the repository:
405
+ 1. Clone the repository:
406
+
396
407
  ```bash
397
408
  git clone https://github.com/jlowin/fastmcp.git
398
409
  cd fastmcp
399
410
  ```
400
- 2. Create and sync the environment:
411
+
412
+ 2. Create and sync the environment:
413
+
401
414
  ```bash
402
415
  uv sync
403
416
  ```
417
+
404
418
  This installs all dependencies, including dev tools.
405
-
419
+
406
420
  3. Activate the virtual environment (e.g., `source .venv/bin/activate` or via your IDE).
407
421
 
408
422
  ### Unit Tests
@@ -410,10 +424,13 @@ Contributions are the core of open source! We welcome improvements and features.
410
424
  FastMCP has a comprehensive unit test suite. All PRs must introduce or update tests as appropriate and pass the full suite.
411
425
 
412
426
  Run tests using pytest:
427
+
413
428
  ```bash
414
429
  pytest
415
430
  ```
431
+
416
432
  or if you want an overview of the code coverage
433
+
417
434
  ```bash
418
435
  uv run pytest --cov=src --cov=examples --cov-report=html
419
436
  ```
@@ -423,10 +440,13 @@ uv run pytest --cov=src --cov=examples --cov-report=html
423
440
  FastMCP uses `pre-commit` for code formatting, linting, and type-checking. All PRs must pass these checks (they run automatically in CI).
424
441
 
425
442
  Install the hooks locally:
443
+
426
444
  ```bash
427
445
  uv run pre-commit install
428
446
  ```
447
+
429
448
  The hooks will now run automatically on `git commit`. You can also run them manually at any time:
449
+
430
450
  ```bash
431
451
  pre-commit run --all-files
432
452
  # or via uv
@@ -435,11 +455,11 @@ uv run pre-commit run --all-files
435
455
 
436
456
  ### Pull Requests
437
457
 
438
- 1. Fork the repository on GitHub.
439
- 2. Create a feature branch from `main`.
440
- 3. Make your changes, including tests and documentation updates.
441
- 4. Ensure tests and pre-commit hooks pass.
442
- 5. Commit your changes and push to your fork.
443
- 6. Open a pull request against the `main` branch of `jlowin/fastmcp`.
458
+ 1. Fork the repository on GitHub.
459
+ 2. Create a feature branch from `main`.
460
+ 3. Make your changes, including tests and documentation updates.
461
+ 4. Ensure tests and pre-commit hooks pass.
462
+ 5. Commit your changes and push to your fork.
463
+ 6. Open a pull request against the `main` branch of `jlowin/fastmcp`.
444
464
 
445
- Please open an issue or discussion for questions or suggestions before starting significant work!
465
+ Please open an issue or discussion for questions or suggestions before starting significant work!
@@ -1,19 +1,19 @@
1
- fastmcp/__init__.py,sha256=ihcFxrKjXfRor78fpuR9aUwFAK0rN9d-BBAlNXldacw,486
1
+ fastmcp/__init__.py,sha256=5ChT4kg3srdFl0-9dZekGqpzCESlpc6ohrfPbWf1aTo,1300
2
2
  fastmcp/exceptions.py,sha256=-krEavxwddQau6T7MESCR4VjKNLfP9KHJrU1p3y72FU,744
3
3
  fastmcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- fastmcp/settings.py,sha256=xJnbeE7hRLxpMbrr8ManYuuHFh3xECNyFjk4t4doGG0,8629
4
+ fastmcp/settings.py,sha256=DZU5tmyNz7bzc3jhxE4wOzsj_TcPhXiXF_-OPbfr4d0,9009
5
5
  fastmcp/cli/__init__.py,sha256=Ii284TNoG5lxTP40ETMGhHEq3lQZWxu9m9JuU57kUpQ,87
6
6
  fastmcp/cli/claude.py,sha256=IAlcZ4qZKBBj09jZUMEx7EANZE_IR3vcu7zOBJmMOuU,4567
7
7
  fastmcp/cli/cli.py,sha256=NQ_byPYUhJ8zyMW6VV2JlUlBH8xwB4tRejLK7n-yypc,12681
8
8
  fastmcp/cli/run.py,sha256=sGH7M3Yi8HGju4sPypKGk3P2cdZq1n3l-_CpJmdGvDc,6277
9
9
  fastmcp/client/__init__.py,sha256=kd2hhSuD8rZuF87c9zlPJP_icJ-Rx3exyNoK0EzfOtE,617
10
- fastmcp/client/client.py,sha256=Bq3Mncxj7dWjcKeDSez-lOF2h7Y9cGaSqZPb3Rkd7jI,24964
10
+ fastmcp/client/client.py,sha256=QrPWcf0mM5k32Sb8-SG8-3oua8-VxZwGg7egRWcBHho,24957
11
11
  fastmcp/client/logging.py,sha256=hOPRailZUp89RUck6V4HPaWVZinVrNY8HD4hD0dd-fE,822
12
12
  fastmcp/client/oauth_callback.py,sha256=ODAnVX-ettL82RuI5KpfkKf8iDtYMDue3Tnab5sjQtM,10071
13
13
  fastmcp/client/progress.py,sha256=WjLLDbUKMsx8DK-fqO7AGsXb83ak-6BMrLvzzznGmcI,1043
14
14
  fastmcp/client/roots.py,sha256=IxI_bHwHTmg6c2H-s1av1ZgrRnNDieHtYwdGFbzXT5c,2471
15
- fastmcp/client/sampling.py,sha256=UlDHxnd6k_HoU8RA3ob0g8-e6haJBc9u27N_v291QoI,1698
16
- fastmcp/client/transports.py,sha256=2h4Jhm60--uycQbz680jEya-3xAvEg-9d3yFalDpNDo,32845
15
+ fastmcp/client/sampling.py,sha256=Q8PzYCERa1W3xGGI9I9QOhhDM-M4i3P5lESb0cp2iI8,1595
16
+ fastmcp/client/transports.py,sha256=QdfWw2AQ6upx9pyInLaW14xcfzI9auA5G67Gy4aWeac,32930
17
17
  fastmcp/client/auth/__init__.py,sha256=4DNsfp4iaQeBcpds0JDdMn6Mmfud44stWLsret0sVKY,91
18
18
  fastmcp/client/auth/bearer.py,sha256=MFEFqcH6u_V86msYiOsEFKN5ks1V9BnBNiPsPLHUTqo,399
19
19
  fastmcp/client/auth/oauth.py,sha256=xiwLftGkadRNsB5eNPl7JtjOI936qgVjsogvOzoxdO0,14700
@@ -27,30 +27,30 @@ fastmcp/contrib/mcp_mixin/__init__.py,sha256=aw9IQ1ssNjCgws4ZNt8bkdpossAAGVAwwjB
27
27
  fastmcp/contrib/mcp_mixin/example.py,sha256=GnunkXmtG5hLLTUsM8aW5ZURU52Z8vI4tNLl-fK7Dg0,1228
28
28
  fastmcp/contrib/mcp_mixin/mcp_mixin.py,sha256=3e0wHlKI9OF12t-SbpRTL-TWjBBLw7T8ATjCdoDtX6k,8173
29
29
  fastmcp/prompts/__init__.py,sha256=An8uMBUh9Hrb7qqcn_5_Hent7IOeSh7EA2IUVsIrtHc,179
30
- fastmcp/prompts/prompt.py,sha256=8Iv16SUHoCFKfZLhb8itjU3qpMnAaek0nTECjEIFaCI,9122
31
- fastmcp/prompts/prompt_manager.py,sha256=uZUJI8V5avQv_Bq2NcvXM2hymFDXyHkDfAKOdtHXasg,4307
30
+ fastmcp/prompts/prompt.py,sha256=IZncQ5NrrAdbuQv9iMYGlBdkfteJpLdLGMK8cxVV3xw,9041
31
+ fastmcp/prompts/prompt_manager.py,sha256=TKFxndDH5mHzk2b35TlaNpMz0gRf2OV_17gH2bMKAcU,4369
32
32
  fastmcp/resources/__init__.py,sha256=y1iAuqx-GIrS1NqIYzKezIDiYyjNEzzHD35epHpMnXE,463
33
33
  fastmcp/resources/resource.py,sha256=CY7clkTrF1_3z1yT2HvkA7tGSX9uY0iyZ2AVAXreCCE,4980
34
- fastmcp/resources/resource_manager.py,sha256=M8R25SWHjzY6zYekgwnajeE8uGe4TYx1LfUJlWt9XjA,11827
34
+ fastmcp/resources/resource_manager.py,sha256=y7J8nnLbCPl_9IASYw2IzmUEwDhS56FWi0Dare9Uf2U,11951
35
35
  fastmcp/resources/template.py,sha256=ohbjlgMzkhVjmjhqa1Bkh5jzj6oWOHKwRxcneYZDt1Q,8415
36
36
  fastmcp/resources/types.py,sha256=SiYNLnpXT-mHgNUrzqKUvXYUsY-V3gwJIrYdJfFwDDo,4868
37
37
  fastmcp/server/__init__.py,sha256=bMD4aQD4yJqLz7-mudoNsyeV8UgQfRAg3PRwPvwTEds,119
38
- fastmcp/server/context.py,sha256=7r-gxMiCgDpd9AStTk0hwfme540H7S1dEcU0bjoerxU,10169
38
+ fastmcp/server/context.py,sha256=Ibn3nv2RpwttPzxElbAkZJNX_SiXrjCCjN5S0vwnGVY,10257
39
39
  fastmcp/server/dependencies.py,sha256=iKJdz1XsVJcrfHo_reXj9ZSldw-HeAwsp9S6lAgfGA8,2358
40
40
  fastmcp/server/http.py,sha256=2v4_N9piolv4z8Nbkn8K0TtHOZzs683mUNA81uGdDdY,11687
41
- fastmcp/server/openapi.py,sha256=ct2hTxhFzwtohmuO1iycZBhQ9iHmsQb3zcj8zF5fjIY,39329
42
- fastmcp/server/proxy.py,sha256=1IoQ4Yx7P7Z7blNsianM1ZwNW_TcIegRwdkqUx_pdl4,10124
43
- fastmcp/server/server.py,sha256=3tprt4gjRKj5WRhlZCzPL9pEOUxOiH4BYEXq4nVSmiM,72390
41
+ fastmcp/server/openapi.py,sha256=rF8umkOQGLejDVH7Ef36QdMmjv6zwPB5tmkgmQscM7A,39539
42
+ fastmcp/server/proxy.py,sha256=t0y3mw4X5yO084nevBL-a5mvrLyGc8491F0OTHeuUPQ,10030
43
+ fastmcp/server/server.py,sha256=Umn_yjPHcwmxu-PTQGCmuD3GTbWEY2BcUBVqq5ej2CQ,73895
44
44
  fastmcp/server/auth/__init__.py,sha256=doHCLwOIElvH1NrTdpeP9JKfnNf3MDYPSpQfdsQ-uI0,84
45
45
  fastmcp/server/auth/auth.py,sha256=kz02HGwXYU0N0clURZDjFNWdKSpTYmgmCnGJN-jSG3Y,1640
46
46
  fastmcp/server/auth/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  fastmcp/server/auth/providers/bearer.py,sha256=3pTKL3tEU7FlCD5yI81LTa2n0dBsM7GRpIIn30WCWsA,12679
48
48
  fastmcp/server/auth/providers/bearer_env.py,sha256=zHbJmzT6RhEW9tGG-_aRACQ_t0GwXCvKEAnKQLCO9mY,1892
49
- fastmcp/server/auth/providers/in_memory.py,sha256=sCRJambxXFZLg_EbJ5ma-aUZvtxuuKbGy7lTxIbzVb0,13772
49
+ fastmcp/server/auth/providers/in_memory.py,sha256=_8hRo6KZEVqsSSMNxpseJH48LZEywF4uZ687XuOmqYw,13772
50
50
  fastmcp/tools/__init__.py,sha256=vzqb-Y7Kf0d5T0aOsld-O-FA8kD7-4uFExChewFHEzY,201
51
- fastmcp/tools/tool.py,sha256=b9OuZne-iJC6217n9Vj6cWlLwwjy0UYLljpTmtRoZng,11243
52
- fastmcp/tools/tool_manager.py,sha256=Kj7YMaf_t_hKhr5CgthF9takB5AdS7bkG5Z8EPgL5Lo,4790
53
- fastmcp/tools/tool_transform.py,sha256=HkBl2xQFHGmYFgI6GHi2XflDgD6ypAa6FpVfxeOeIGs,27441
51
+ fastmcp/tools/tool.py,sha256=UoqX8Hv2FsYYQkP8dpPlvPoDZMMZf4VJagt6_76iqtE,11123
52
+ fastmcp/tools/tool_manager.py,sha256=gq7wYrj1EMjmqJgnJ_ozipEVWmnlSNjIe1zL0-OObss,4805
53
+ fastmcp/tools/tool_transform.py,sha256=pBRLu6qoXsdg1fwkV219PyJQy_Rp6fFCNOqFFbI4VOc,27612
54
54
  fastmcp/utilities/__init__.py,sha256=-imJ8S-rXmbXMWeDamldP-dHDqAPg_wwmPVz-LNX14E,31
55
55
  fastmcp/utilities/cache.py,sha256=aV3oZ-ZhMgLSM9iAotlUlEy5jFvGXrVo0Y5Bj4PBtqY,707
56
56
  fastmcp/utilities/components.py,sha256=NJXop6vn42DC2MyLtJRuJ7QEyac4T5WcOsYaClIog6E,1669
@@ -61,9 +61,9 @@ fastmcp/utilities/logging.py,sha256=B1WNO-ZWFjd9wiFSh13YtW1hAKaNmbpscDZleIAhr-g,
61
61
  fastmcp/utilities/mcp_config.py,sha256=kbmvpF5YE7eiDH68XObagFGPKw26SwuDchmH7pyFSD4,2519
62
62
  fastmcp/utilities/openapi.py,sha256=ctceiGb4jYgzZGSseMb-yZccEEXf41P-dhB3ae9lGdk,38992
63
63
  fastmcp/utilities/tests.py,sha256=72ryn-IyrvE9BKL_RPJ6T__qTcSRp8yzhOQSM6cdYpE,3903
64
- fastmcp/utilities/types.py,sha256=ZRCgFlCDMwbSxi6aYmlu5WN2nNS3jfjleLQnvHGUzzw,4262
65
- fastmcp-2.8.0.dist-info/METADATA,sha256=nGUf6asW4pGz2IjHG3iYmURX3ETy5F0wVBq9z4Sykqg,17754
66
- fastmcp-2.8.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
67
- fastmcp-2.8.0.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
68
- fastmcp-2.8.0.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
69
- fastmcp-2.8.0.dist-info/RECORD,,
64
+ fastmcp/utilities/types.py,sha256=Ro5UMB1K-uKtLgzbCCHAb_3ABh0v7QF5Or70_0Yyo00,6650
65
+ fastmcp-2.8.1.dist-info/METADATA,sha256=hJrGycsSOIR62GmBlTfYRS6GN7LjPa3eLsrpDO58HCM,17773
66
+ fastmcp-2.8.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
67
+ fastmcp-2.8.1.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
68
+ fastmcp-2.8.1.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
69
+ fastmcp-2.8.1.dist-info/RECORD,,