fastmcp 2.4.0__tar.gz → 2.5.0__tar.gz

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.
Files changed (201) hide show
  1. {fastmcp-2.4.0 → fastmcp-2.5.0}/PKG-INFO +4 -4
  2. {fastmcp-2.4.0 → fastmcp-2.5.0}/README.md +3 -3
  3. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/clients/client.mdx +2 -2
  4. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/clients/transports.mdx +3 -3
  5. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/docs.json +1 -2
  6. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/getting-started/installation.mdx +14 -0
  7. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/getting-started/welcome.mdx +4 -8
  8. fastmcp-2.5.0/docs/patterns/fastapi.mdx +47 -0
  9. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/composition.mdx +3 -1
  10. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/context.mdx +4 -3
  11. fastmcp-2.5.0/docs/servers/openapi.mdx +469 -0
  12. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/proxy.mdx +1 -1
  13. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/resources.mdx +15 -6
  14. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/tools.mdx +20 -8
  15. fastmcp-2.5.0/examples/tags_example.py +141 -0
  16. {fastmcp-2.4.0 → fastmcp-2.5.0}/pyproject.toml +6 -0
  17. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/client.py +23 -1
  18. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/transports.py +68 -18
  19. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/prompts/prompt.py +11 -4
  20. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/prompts/prompt_manager.py +25 -5
  21. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/resources/resource_manager.py +31 -5
  22. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/resources/template.py +10 -5
  23. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/context.py +46 -0
  24. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/http.py +2 -0
  25. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/openapi.py +324 -64
  26. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/server.py +101 -49
  27. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/settings.py +30 -1
  28. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/tools/tool.py +5 -1
  29. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/tools/tool_manager.py +9 -2
  30. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/logging.py +6 -1
  31. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/mcp_config.py +4 -3
  32. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_client.py +85 -5
  33. fastmcp-2.5.0/tests/client/test_openapi.py +192 -0
  34. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/contrib/test_bulk_tool_caller.py +3 -1
  35. fastmcp-2.5.0/tests/deprecated/test_route_type_ignore.py +113 -0
  36. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/prompts/test_prompt.py +24 -0
  37. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/prompts/test_prompt_manager.py +46 -2
  38. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/resources/test_resource_manager.py +38 -35
  39. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/resources/test_resource_template.py +25 -0
  40. fastmcp-2.5.0/tests/server/http/test_custom_routes.py +105 -0
  41. fastmcp-2.5.0/tests/server/http/test_http_dependencies.py +168 -0
  42. {fastmcp-2.4.0/tests/server → fastmcp-2.5.0/tests/server/openapi}/test_openapi.py +469 -223
  43. {fastmcp-2.4.0/tests/server → fastmcp-2.5.0/tests/server/openapi}/test_openapi_path_parameters.py +7 -9
  44. fastmcp-2.5.0/tests/server/openapi/test_route_map_fn.py +377 -0
  45. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_context.py +29 -0
  46. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_server_interactions.py +46 -0
  47. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/tools/test_tool.py +31 -0
  48. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/tools/test_tool_manager.py +111 -5
  49. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/openapi/test_openapi_fastapi.py +9 -9
  50. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_mcp_config.py +2 -2
  51. fastmcp-2.5.0/tests/utilities/test_tests.py +10 -0
  52. {fastmcp-2.4.0 → fastmcp-2.5.0}/uv.lock +17 -2
  53. fastmcp-2.4.0/docs/patterns/fastapi.mdx +0 -144
  54. fastmcp-2.4.0/docs/patterns/openapi.mdx +0 -263
  55. fastmcp-2.4.0/tests/server/test_http_dependencies.py +0 -102
  56. fastmcp-2.4.0/tests/utilities/test_tests.py +0 -9
  57. {fastmcp-2.4.0 → fastmcp-2.5.0}/.cursor/rules/core-mcp-objects.mdc +0 -0
  58. {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/ISSUE_TEMPLATE/bug.yml +0 -0
  59. {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  60. {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/ISSUE_TEMPLATE/enhancement.yml +0 -0
  61. {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/labeler.yml +0 -0
  62. {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/release.yml +0 -0
  63. {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/workflows/labeler.yml +0 -0
  64. {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/workflows/publish.yml +0 -0
  65. {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/workflows/run-static.yml +0 -0
  66. {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/workflows/run-tests.yml +0 -0
  67. {fastmcp-2.4.0 → fastmcp-2.5.0}/.gitignore +0 -0
  68. {fastmcp-2.4.0 → fastmcp-2.5.0}/.pre-commit-config.yaml +0 -0
  69. {fastmcp-2.4.0 → fastmcp-2.5.0}/AGENTS.md +0 -0
  70. {fastmcp-2.4.0 → fastmcp-2.5.0}/LICENSE +0 -0
  71. {fastmcp-2.4.0 → fastmcp-2.5.0}/Windows_Notes.md +0 -0
  72. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/assets/demo-inspector.png +0 -0
  73. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/clients/advanced-features.mdx +0 -0
  74. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/deployment/asgi.mdx +0 -0
  75. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/deployment/authentication.mdx +0 -0
  76. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/deployment/cli.mdx +0 -0
  77. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/deployment/running-server.mdx +0 -0
  78. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/getting-started/quickstart.mdx +0 -0
  79. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/patterns/contrib.mdx +0 -0
  80. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/patterns/decorating-methods.mdx +0 -0
  81. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/patterns/http-requests.mdx +0 -0
  82. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/patterns/testing.mdx +0 -0
  83. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/fastmcp.mdx +0 -0
  84. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/prompts.mdx +0 -0
  85. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/snippets/version-badge.mdx +0 -0
  86. {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/style.css +0 -0
  87. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/complex_inputs.py +0 -0
  88. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/desktop.py +0 -0
  89. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/echo.py +0 -0
  90. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/in_memory_proxy_example.py +0 -0
  91. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/memory.py +0 -0
  92. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/mount_example.py +0 -0
  93. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/sampling.py +0 -0
  94. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/screenshot.py +0 -0
  95. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/serializer.py +0 -0
  96. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/simple_echo.py +0 -0
  97. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/README.md +0 -0
  98. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/pyproject.toml +0 -0
  99. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/__init__.py +0 -0
  100. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/__main__.py +0 -0
  101. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/hub.py +0 -0
  102. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/lights/__init__.py +0 -0
  103. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/lights/hue_utils.py +0 -0
  104. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/lights/server.py +0 -0
  105. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/py.typed +0 -0
  106. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/settings.py +0 -0
  107. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/uv.lock +0 -0
  108. {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/text_me.py +0 -0
  109. {fastmcp-2.4.0 → fastmcp-2.5.0}/justfile +0 -0
  110. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/__init__.py +0 -0
  111. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/cli/__init__.py +0 -0
  112. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/cli/claude.py +0 -0
  113. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/cli/cli.py +0 -0
  114. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/cli/run.py +0 -0
  115. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/__init__.py +0 -0
  116. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/base.py +0 -0
  117. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/logging.py +0 -0
  118. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/progress.py +0 -0
  119. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/roots.py +0 -0
  120. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/sampling.py +0 -0
  121. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/README.md +0 -0
  122. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/bulk_tool_caller/README.md +0 -0
  123. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/bulk_tool_caller/__init__.py +0 -0
  124. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/bulk_tool_caller/bulk_tool_caller.py +0 -0
  125. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/bulk_tool_caller/example.py +0 -0
  126. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/mcp_mixin/README.md +0 -0
  127. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/mcp_mixin/__init__.py +0 -0
  128. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/mcp_mixin/example.py +0 -0
  129. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/mcp_mixin/mcp_mixin.py +0 -0
  130. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/exceptions.py +0 -0
  131. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/low_level/README.md +0 -0
  132. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/low_level/__init__.py +0 -0
  133. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/prompts/__init__.py +0 -0
  134. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/py.typed +0 -0
  135. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/resources/__init__.py +0 -0
  136. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/resources/resource.py +0 -0
  137. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/resources/types.py +0 -0
  138. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/__init__.py +0 -0
  139. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/dependencies.py +0 -0
  140. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/proxy.py +0 -0
  141. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/tools/__init__.py +0 -0
  142. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/__init__.py +0 -0
  143. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/cache.py +0 -0
  144. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/decorators.py +0 -0
  145. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/exceptions.py +0 -0
  146. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/json_schema.py +0 -0
  147. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/openapi.py +0 -0
  148. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/tests.py +0 -0
  149. {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/types.py +0 -0
  150. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/__init__.py +0 -0
  151. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/cli/test_cli.py +0 -0
  152. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/cli/test_run.py +0 -0
  153. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/__init__.py +0 -0
  154. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_logs.py +0 -0
  155. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_progress.py +0 -0
  156. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_roots.py +0 -0
  157. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_sampling.py +0 -0
  158. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_sse.py +0 -0
  159. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_streamable_http.py +0 -0
  160. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/conftest.py +0 -0
  161. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/contrib/__init__.py +0 -0
  162. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/contrib/test_mcp_mixin.py +0 -0
  163. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/deprecated/__init__.py +0 -0
  164. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/deprecated/test_deprecated.py +0 -0
  165. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/deprecated/test_mount_separators.py +0 -0
  166. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/deprecated/test_resource_prefixes.py +0 -0
  167. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/prompts/__init__.py +0 -0
  168. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/resources/__init__.py +0 -0
  169. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/resources/test_file_resources.py +0 -0
  170. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/resources/test_function_resources.py +0 -0
  171. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/resources/test_resources.py +0 -0
  172. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/__init__.py +0 -0
  173. {fastmcp-2.4.0/tests/server → fastmcp-2.5.0/tests/server/http}/test_http_middleware.py +0 -0
  174. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_app_state.py +0 -0
  175. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_auth_integration.py +0 -0
  176. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_file_server.py +0 -0
  177. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_import_server.py +0 -0
  178. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_lifespan.py +0 -0
  179. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_logging.py +0 -0
  180. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_mount.py +0 -0
  181. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_proxy.py +0 -0
  182. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_resource_prefix_formats.py +0 -0
  183. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_run_server.py +0 -0
  184. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_server.py +0 -0
  185. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_tool_annotations.py +0 -0
  186. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/test_examples.py +0 -0
  187. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/test_servers/fastmcp_server.py +0 -0
  188. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/test_servers/sse.py +0 -0
  189. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/test_servers/stdio.py +0 -0
  190. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/tools/__init__.py +0 -0
  191. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/__init__.py +0 -0
  192. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/openapi/__init__.py +0 -0
  193. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/openapi/conftest.py +0 -0
  194. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/openapi/test_openapi.py +0 -0
  195. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/openapi/test_openapi_advanced.py +0 -0
  196. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_cache.py +0 -0
  197. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_decorated_function.py +0 -0
  198. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_json_schema.py +0 -0
  199. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_logging.py +0 -0
  200. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_typeadapter.py +0 -0
  201. {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastmcp
3
- Version: 2.4.0
3
+ Version: 2.5.0
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
@@ -44,11 +44,11 @@ Description-Content-Type: text/markdown
44
44
  > [!NOTE]
45
45
  > #### FastMCP 2.0 & The Official MCP SDK
46
46
  >
47
- > Recognize the `FastMCP` name? You might have seen the version that was contributed to the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk), which was based on **FastMCP 1.0**.
47
+ > FastMCP is the standard framework for building MCP servers and clients. FastMCP 1.0 was incorporated into the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk).
48
48
  >
49
- > **Welcome to FastMCP 2.0!** This is the actively developed successor, and it significantly expands on 1.0 by introducing powerful client capabilities, server proxying & composition, OpenAPI/FastAPI integration, and more advanced features.
49
+ > **This is FastMCP 2.0,** the actively maintained version that significantly expands on 1.0's basic server-building capabilities by introducing full client support, server composition, OpenAPI/FastAPI integration, remote server proxying, built-in testing tools, and more.
50
50
  >
51
- > FastMCP 2.0 is the recommended path for building modern, powerful MCP applications. Ready to upgrade or get started? Follow the [installation instructions](https://gofastmcp.com/getting-started/installation), which include specific steps for upgrading from the official MCP SDK.
51
+ > FastMCP 2.0 is the complete toolkit for modern AI applications. Ready to upgrade or get started? Follow the [installation instructions](https://gofastmcp.com/getting-started/installation), which include specific steps for upgrading from the official MCP SDK.
52
52
 
53
53
  ---
54
54
 
@@ -15,11 +15,11 @@
15
15
  > [!NOTE]
16
16
  > #### FastMCP 2.0 & The Official MCP SDK
17
17
  >
18
- > Recognize the `FastMCP` name? You might have seen the version that was contributed to the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk), which was based on **FastMCP 1.0**.
18
+ > FastMCP is the standard framework for building MCP servers and clients. FastMCP 1.0 was incorporated into the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk).
19
19
  >
20
- > **Welcome to FastMCP 2.0!** This is the actively developed successor, and it significantly expands on 1.0 by introducing powerful client capabilities, server proxying & composition, OpenAPI/FastAPI integration, and more advanced features.
20
+ > **This is FastMCP 2.0,** the actively maintained version that significantly expands on 1.0's basic server-building capabilities by introducing full client support, server composition, OpenAPI/FastAPI integration, remote server proxying, built-in testing tools, and more.
21
21
  >
22
- > FastMCP 2.0 is the recommended path for building modern, powerful MCP applications. Ready to upgrade or get started? Follow the [installation instructions](https://gofastmcp.com/getting-started/installation), which include specific steps for upgrading from the official MCP SDK.
22
+ > FastMCP 2.0 is the complete toolkit for modern AI applications. Ready to upgrade or get started? Follow the [installation instructions](https://gofastmcp.com/getting-started/installation), which include specific steps for upgrading from the official MCP SDK.
23
23
 
24
24
  ---
25
25
 
@@ -37,7 +37,7 @@ Clients must be initialized with a `transport`. You can either provide an alread
37
37
  The following inference rules are used to determine the appropriate `ClientTransport` based on the input type:
38
38
 
39
39
  1. **`ClientTransport` Instance**: If you provide an already instantiated transport object, it's used directly.
40
- 2. **`FastMCP` Instance**: Creates a `FastMCPTransport` for efficient in-memory communication (ideal for testing).
40
+ 2. **`FastMCP` Instance**: Creates a `FastMCPTransport` for efficient in-memory communication (ideal for testing). This also works with a **FastMCP 1.0 server** created via `mcp.server.fastmcp.FastMCP`.
41
41
  3. **`Path` or `str` pointing to an existing file**:
42
42
  * If it ends with `.py`: Creates a `PythonStdioTransport` to run the script using `python`.
43
43
  * If it ends with `.js`: Creates a `NodeStdioTransport` to run the script using `node`.
@@ -91,7 +91,7 @@ For more control over connection details (like headers for SSE, environment vari
91
91
 
92
92
  ### Multi-Server Clients
93
93
 
94
- <VersionBadge version="2.3.6" />
94
+ <VersionBadge version="2.4.0" />
95
95
 
96
96
  FastMCP supports creating clients that connect to multiple MCP servers through a single client interface using a standard MCP configuration format (`MCPConfig`). This configuration approach makes it easy to connect to multiple specialized servers or create composable systems with a simple, declarative syntax.
97
97
 
@@ -290,8 +290,8 @@ asyncio.run(main())
290
290
  ### FastMCP Transport
291
291
 
292
292
  - **Class:** `fastmcp.client.transports.FastMCPTransport`
293
- - **Inferred From:** An instance of `fastmcp.server.FastMCP`
294
- - **Use Case:** Connecting directly to a `FastMCP` server instance in the same Python process
293
+ - **Inferred From:** An instance of `fastmcp.server.FastMCP` or a **FastMCP 1.0 server** (`mcp.server.fastmcp.FastMCP`)
294
+ - **Use Case:** Connecting directly to a FastMCP server instance in the same Python process
295
295
 
296
296
  This is extremely useful for testing your FastMCP servers.
297
297
 
@@ -323,7 +323,7 @@ Communication happens through efficient in-memory queues, making it very fast an
323
323
 
324
324
  ### MCPConfig Transport
325
325
 
326
- <VersionBadge version="2.3.6" />
326
+ <VersionBadge version="2.4.0" />
327
327
 
328
328
  - **Class:** `fastmcp.client.transports.MCPConfigTransport`
329
329
  - **Inferred From:** An instance of `MCPConfig` or a dictionary matching the MCPConfig schema
@@ -50,6 +50,7 @@
50
50
  "servers/resources",
51
51
  "servers/prompts",
52
52
  "servers/context",
53
+ "servers/openapi",
53
54
  "servers/proxy",
54
55
  "servers/composition"
55
56
  ]
@@ -76,8 +77,6 @@
76
77
  "pages": [
77
78
  "patterns/decorating-methods",
78
79
  "patterns/http-requests",
79
- "patterns/openapi",
80
- "patterns/fastapi",
81
80
  "patterns/contrib",
82
81
  "patterns/testing"
83
82
  ]
@@ -60,6 +60,20 @@ mcp = FastMCP("My MCP Server")
60
60
  Prior to `fastmcp==2.3.0` and `mcp==1.8.0`, the 2.x API always mirrored the 1.0 API. However, as the projects diverge, this can not be guaranteed. You may see deprecation warnings if you attempt to use 1.0 APIs in FastMCP 2.x. Please refer to this documentation for details on new capabilities.
61
61
  </Warning>
62
62
 
63
+ ## Versioning and Breaking Changes
64
+
65
+ While we make every effort not to introduce backwards-incompatible changes to our public APIs and behavior, FastMCP exists in a rapidly evolving MCP landscape. We're committed to bringing the most cutting-edge features to our users, which occasionally necessitates changes to existing functionality.
66
+
67
+ As a practice, breaking changes will only occur on minor version changes (e.g., 2.3.x to 2.4.0). A minor version change indicates either:
68
+ - A significant new feature set that warrants a new minor version
69
+ - Introducing breaking changes that may affect behavior on upgrade
70
+
71
+ For users concerned about stability in production environments, we recommend pinning FastMCP to a specific version in your dependencies.
72
+
73
+ Whenever possible, FastMCP will issue deprecation warnings when users attempt to use APIs that are either deprecated or destined for future removal. These warnings will be maintained for at least 1 minor version release, and may be maintained longer.
74
+
75
+ Note that the "public API" includes the core functionality of the `FastMCP` server and its methods. It does not include private methods or objects that are stored as private attributes, as we do not expect users to rely on those implementation details.
76
+
63
77
  ## Installing for Development
64
78
 
65
79
  If you plan to contribute to FastMCP, you should begin by cloning the repository and using uv to install all dependencies (development dependencies are installed automatically):
@@ -24,17 +24,13 @@ if __name__ == "__main__":
24
24
  ```
25
25
 
26
26
 
27
- ## FastMCP 2.0 and the Official MCP SDK
27
+ ## FastMCP and the Official MCP SDK
28
28
 
29
- <Tip>
30
- Recognize the `FastMCP` name? You might have seen the version that was contributed to the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk), which was based on **FastMCP 1.0**.
29
+ FastMCP is the standard framework for building MCP servers and clients. FastMCP 1.0 was incorporated into the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk).
31
30
 
31
+ **This is FastMCP 2.0,** the [actively maintained version](https://github.com/jlowin/fastmcp) that significantly expands on 1.0's basic server-building capabilities by introducing full client support, server composition, OpenAPI/FastAPI integration, remote server proxying, built-in testing tools, and more.
32
32
 
33
- **Welcome to FastMCP 2.0!** This is the [actively developed successor](https://github.com/jlowin/fastmcp), and it significantly expands on 1.0 by introducing powerful client capabilities, server proxying & composition, OpenAPI/FastAPI integration, and more advanced features.
34
-
35
- FastMCP 2.0 is the recommended path for building modern, powerful MCP applications. Ready to upgrade or get started? Follow the [installation instructions](/getting-started/installation), which include specific steps for upgrading.
36
- </Tip>
37
-
33
+ FastMCP 2.0 is the complete toolkit for modern AI applications. Ready to upgrade or get started? Follow the [installation instructions](/getting-started/installation), which include specific steps for upgrading from the official MCP SDK.
38
34
 
39
35
 
40
36
  ## What is MCP?
@@ -0,0 +1,47 @@
1
+ ---
2
+ title: FastAPI Integration
3
+ sidebarTitle: FastAPI
4
+ description: Generate MCP servers from FastAPI apps
5
+ icon: square-bolt
6
+ ---
7
+ import { VersionBadge } from '/snippets/version-badge.mdx'
8
+
9
+ <VersionBadge version="2.0.0" />
10
+
11
+ <Note>
12
+ **Documentation Moved**: The comprehensive FastAPI integration documentation has been moved to the [OpenAPI Integration](/patterns/openapi#fastapi-integration) page, where it's covered alongside all other OpenAPI features including route mapping and tags support.
13
+ </Note>
14
+
15
+ ## Quick Start
16
+
17
+ FastMCP can automatically convert FastAPI applications into MCP servers:
18
+
19
+ ```python
20
+ from fastapi import FastAPI
21
+ from fastmcp import FastMCP
22
+
23
+ # A FastAPI app
24
+ app = FastAPI()
25
+
26
+ @app.get("/items")
27
+ def list_items():
28
+ return [{"id": 1, "name": "Item 1"}, {"id": 2, "name": "Item 2"}]
29
+
30
+ @app.get("/items/{item_id}")
31
+ def get_item(item_id: int):
32
+ return {"id": item_id, "name": f"Item {item_id}"}
33
+
34
+ @app.post("/items")
35
+ def create_item(name: str):
36
+ return {"id": 3, "name": name}
37
+
38
+ # Create an MCP server from your FastAPI app
39
+ mcp = FastMCP.from_fastapi(app=app)
40
+
41
+ if __name__ == "__main__":
42
+ mcp.run() # Start the MCP server
43
+ ```
44
+
45
+ <Tip>
46
+ For complete documentation including tag-based routing, route mapping configuration, timeout settings, authentication examples, and advanced configuration options, see the comprehensive [OpenAPI Integration documentation](/patterns/openapi#fastapi-integration).
47
+ </Tip>
@@ -35,7 +35,7 @@ The choice of importing or mounting depends on your use case and requirements.
35
35
 
36
36
  FastMCP supports [MCP proxying](/patterns/proxy), which allows you to mirror a local or remote server in a local FastMCP instance. Proxies are fully compatible with both importing and mounting.
37
37
 
38
- <VersionBadge version="2.3.6" />
38
+ <VersionBadge version="2.4.0" />
39
39
 
40
40
  You can also create proxies from configuration dictionaries that follow the MCPConfig schema, which is useful for quickly connecting to one or more remote servers. See the [Proxy Servers documentation](/servers/proxy#configuration-based-proxies) for details on configuration-based proxying. Note that MCPConfig follows an emerging standard and its format may evolve over time.
41
41
 
@@ -185,6 +185,8 @@ main_server.mount("remote", remote_proxy)
185
185
 
186
186
  ## Resource Prefix Formats
187
187
 
188
+ <VersionBadge version="2.4.0" />
189
+
188
190
  When mounting or importing servers, resource URIs are usually prefixed to avoid naming conflicts. FastMCP supports two different formats for resource prefixes:
189
191
 
190
192
  ### Path Format (Default)
@@ -228,8 +228,8 @@ async def analyze_sentiment(text: str, ctx: Context) -> dict:
228
228
  # Create a sampling prompt asking for sentiment analysis
229
229
  prompt = f"Analyze the sentiment of the following text as positive, negative, or neutral. Just output a single word - 'positive', 'negative', or 'neutral'. Text to analyze: {text}"
230
230
 
231
- # Send the sampling request to the client's LLM
232
- response = await ctx.sample(prompt)
231
+ # Send the sampling request to the client's LLM (provide a hint for the model you want to use)
232
+ response = await ctx.sample(prompt, model_preferences="claude-3-sonnet")
233
233
 
234
234
  # Process the LLM's response
235
235
  sentiment = response.text.strip().lower()
@@ -247,11 +247,12 @@ async def analyze_sentiment(text: str, ctx: Context) -> dict:
247
247
 
248
248
  **Method signature:**
249
249
 
250
- - **`ctx.sample(messages: str | list[str | SamplingMessage], system_prompt: str | None = None, temperature: float | None = None, max_tokens: int | None = None) -> TextContent | ImageContent`**
250
+ - **`ctx.sample(messages: str | list[str | SamplingMessage], system_prompt: str | None = None, temperature: float | None = None, max_tokens: int | None = None, model_preferences: ModelPreferences | str | list[str] | None = None) -> TextContent | ImageContent`**
251
251
  - `messages`: A string or list of strings/message objects to send to the LLM
252
252
  - `system_prompt`: Optional system prompt to guide the LLM's behavior
253
253
  - `temperature`: Optional sampling temperature (controls randomness)
254
254
  - `max_tokens`: Optional maximum number of tokens to generate (defaults to 512)
255
+ - `model_preferences`: Optional model selection preferences (e.g., a model hint string, list of hints, or a ModelPreferences object)
255
256
  - Returns the LLM's response as TextContent or ImageContent
256
257
 
257
258
  When providing a simple string, it's treated as a user message. For more complex scenarios, you can provide a list of messages with different roles.