fastmcp 2.6.0__tar.gz → 2.7.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 (226) hide show
  1. {fastmcp-2.6.0 → fastmcp-2.7.0}/.github/workflows/labeler.yml +1 -0
  2. {fastmcp-2.6.0 → fastmcp-2.7.0}/PKG-INFO +29 -17
  3. {fastmcp-2.6.0 → fastmcp-2.7.0}/README.md +26 -15
  4. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/clients/auth/bearer.mdx +2 -1
  5. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/clients/auth/oauth.mdx +4 -3
  6. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/clients/transports.mdx +1 -1
  7. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/deployment/asgi.mdx +1 -1
  8. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/deployment/running-server.mdx +14 -3
  9. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/docs.json +16 -3
  10. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/getting-started/quickstart.mdx +3 -3
  11. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/getting-started/welcome.mdx +2 -3
  12. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/integrations/anthropic.mdx +10 -3
  13. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/integrations/claude-desktop.mdx +2 -2
  14. fastmcp-2.7.0/docs/integrations/gemini.mdx +109 -0
  15. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/integrations/openai.mdx +11 -4
  16. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/patterns/cli.mdx +1 -1
  17. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/patterns/decorating-methods.mdx +73 -49
  18. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/patterns/http-requests.mdx +2 -2
  19. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/patterns/testing.mdx +1 -1
  20. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/servers/auth/bearer.mdx +8 -3
  21. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/servers/composition.mdx +4 -4
  22. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/servers/context.mdx +11 -11
  23. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/servers/fastmcp.mdx +8 -34
  24. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/servers/prompts.mdx +10 -10
  25. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/servers/proxy.mdx +1 -1
  26. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/servers/tools.mdx +29 -29
  27. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/snippets/version-badge.mdx +3 -4
  28. fastmcp-2.7.0/docs/style.css +119 -0
  29. fastmcp-2.7.0/docs/updates.mdx +21 -0
  30. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/complex_inputs.py +1 -1
  31. fastmcp-2.7.0/examples/config_server.py +46 -0
  32. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/desktop.py +1 -1
  33. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/echo.py +1 -1
  34. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/memory.py +2 -2
  35. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/mount_example.py +3 -3
  36. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/sampling.py +1 -1
  37. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/screenshot.py +1 -1
  38. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/serializer.py +1 -1
  39. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/simple_echo.py +1 -1
  40. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/smart_home/src/smart_home/hub.py +1 -1
  41. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/smart_home/src/smart_home/lights/server.py +9 -9
  42. {fastmcp-2.6.0 → fastmcp-2.7.0}/pyproject.toml +4 -2
  43. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/cli/cli.py +9 -1
  44. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/cli/run.py +32 -1
  45. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/client/auth/oauth.py +0 -3
  46. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/client/transports.py +13 -4
  47. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/contrib/bulk_tool_caller/example.py +1 -1
  48. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/contrib/mcp_mixin/mcp_mixin.py +10 -3
  49. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/prompts/prompt.py +65 -27
  50. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/prompts/prompt_manager.py +13 -6
  51. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/resources/__init__.py +1 -2
  52. fastmcp-2.7.0/src/fastmcp/resources/resource.py +169 -0
  53. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/resources/resource_manager.py +17 -6
  54. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/resources/template.py +90 -56
  55. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/resources/types.py +0 -44
  56. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/server/auth/providers/in_memory.py +1 -6
  57. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/server/context.py +1 -1
  58. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/server/openapi.py +17 -32
  59. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/server/proxy.py +5 -8
  60. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/server/server.py +274 -100
  61. fastmcp-2.7.0/src/fastmcp/tools/__init__.py +4 -0
  62. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/tools/tool.py +59 -19
  63. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/tools/tool_manager.py +9 -3
  64. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/utilities/mcp_config.py +6 -4
  65. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/utilities/openapi.py +56 -32
  66. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/utilities/types.py +7 -1
  67. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/auth/providers/test_bearer.py +1 -1
  68. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/auth/test_oauth_client.py +1 -1
  69. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/cli/test_cli.py +25 -0
  70. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/cli/test_run.py +36 -0
  71. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/client/test_client.py +8 -8
  72. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/client/test_logs.py +2 -2
  73. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/client/test_progress.py +1 -1
  74. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/client/test_roots.py +1 -1
  75. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/client/test_sampling.py +3 -3
  76. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/client/test_sse.py +4 -4
  77. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/client/test_stdio.py +1 -1
  78. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/client/test_streamable_http.py +4 -4
  79. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/contrib/test_bulk_tool_caller.py +4 -3
  80. fastmcp-2.7.0/tests/deprecated/__init__.py +4 -0
  81. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/deprecated/test_deprecated.py +4 -14
  82. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/deprecated/test_mount_separators.py +5 -2
  83. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/deprecated/test_resource_prefixes.py +5 -0
  84. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/deprecated/test_route_type_ignore.py +3 -0
  85. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/prompts/test_prompt_manager.py +4 -1
  86. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/resources/test_function_resources.py +1 -1
  87. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/resources/test_resource_manager.py +1 -1
  88. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/resources/test_resource_template.py +8 -7
  89. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/resources/test_resources.py +2 -1
  90. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/http/test_http_dependencies.py +2 -2
  91. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/openapi/test_openapi_path_parameters.py +7 -7
  92. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_auth_integration.py +1 -1
  93. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_file_server.py +1 -1
  94. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_import_server.py +19 -15
  95. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_mount.py +19 -19
  96. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_proxy.py +15 -8
  97. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_run_server.py +4 -4
  98. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_server.py +254 -41
  99. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_server_interactions.py +68 -110
  100. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_tool_annotations.py +6 -2
  101. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_tool_exclude_args.py +13 -2
  102. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/test_servers/fastmcp_server.py +4 -4
  103. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/tools/test_tool.py +236 -8
  104. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/tools/test_tool_manager.py +123 -69
  105. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/utilities/openapi/test_openapi.py +111 -1
  106. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/utilities/test_mcp_config.py +1 -1
  107. {fastmcp-2.6.0 → fastmcp-2.7.0}/uv.lock +6 -1
  108. fastmcp-2.6.0/docs/style.css +0 -50
  109. fastmcp-2.6.0/server.py +0 -26
  110. fastmcp-2.6.0/src/fastmcp/resources/resource.py +0 -83
  111. fastmcp-2.6.0/src/fastmcp/tools/__init__.py +0 -4
  112. fastmcp-2.6.0/src/fastmcp/utilities/decorators.py +0 -101
  113. fastmcp-2.6.0/tests/utilities/test_decorated_function.py +0 -222
  114. {fastmcp-2.6.0 → fastmcp-2.7.0}/.cursor/rules/core-mcp-objects.mdc +0 -0
  115. {fastmcp-2.6.0 → fastmcp-2.7.0}/.github/ISSUE_TEMPLATE/bug.yml +0 -0
  116. {fastmcp-2.6.0 → fastmcp-2.7.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  117. {fastmcp-2.6.0 → fastmcp-2.7.0}/.github/ISSUE_TEMPLATE/enhancement.yml +0 -0
  118. {fastmcp-2.6.0 → fastmcp-2.7.0}/.github/labeler.yml +0 -0
  119. {fastmcp-2.6.0 → fastmcp-2.7.0}/.github/release.yml +0 -0
  120. {fastmcp-2.6.0 → fastmcp-2.7.0}/.github/workflows/publish.yml +0 -0
  121. {fastmcp-2.6.0 → fastmcp-2.7.0}/.github/workflows/run-static.yml +0 -0
  122. {fastmcp-2.6.0 → fastmcp-2.7.0}/.github/workflows/run-tests.yml +0 -0
  123. {fastmcp-2.6.0 → fastmcp-2.7.0}/.gitignore +0 -0
  124. {fastmcp-2.6.0 → fastmcp-2.7.0}/.pre-commit-config.yaml +0 -0
  125. {fastmcp-2.6.0 → fastmcp-2.7.0}/AGENTS.md +0 -0
  126. {fastmcp-2.6.0 → fastmcp-2.7.0}/LICENSE +0 -0
  127. {fastmcp-2.6.0 → fastmcp-2.7.0}/Windows_Notes.md +0 -0
  128. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/assets/demo-inspector.png +0 -0
  129. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/assets/favicon.ico +0 -0
  130. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/assets/logo.png +0 -0
  131. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/clients/advanced-features.mdx +0 -0
  132. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/clients/client.mdx +0 -0
  133. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/getting-started/installation.mdx +0 -0
  134. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/integrations/contrib.mdx +0 -0
  135. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/servers/openapi.mdx +0 -0
  136. {fastmcp-2.6.0 → fastmcp-2.7.0}/docs/servers/resources.mdx +0 -0
  137. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/in_memory_proxy_example.py +0 -0
  138. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/smart_home/README.md +0 -0
  139. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/smart_home/pyproject.toml +0 -0
  140. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/smart_home/src/smart_home/__init__.py +0 -0
  141. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/smart_home/src/smart_home/__main__.py +0 -0
  142. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/smart_home/src/smart_home/lights/__init__.py +0 -0
  143. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/smart_home/src/smart_home/lights/hue_utils.py +0 -0
  144. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/smart_home/src/smart_home/py.typed +0 -0
  145. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/smart_home/src/smart_home/settings.py +0 -0
  146. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/smart_home/uv.lock +0 -0
  147. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/tags_example.py +0 -0
  148. {fastmcp-2.6.0 → fastmcp-2.7.0}/examples/text_me.py +0 -0
  149. {fastmcp-2.6.0 → fastmcp-2.7.0}/justfile +0 -0
  150. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/__init__.py +0 -0
  151. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/cli/__init__.py +0 -0
  152. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/cli/claude.py +0 -0
  153. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/client/__init__.py +0 -0
  154. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/client/auth/__init__.py +0 -0
  155. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/client/auth/bearer.py +0 -0
  156. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/client/client.py +0 -0
  157. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/client/logging.py +0 -0
  158. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/client/oauth_callback.py +0 -0
  159. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/client/progress.py +0 -0
  160. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/client/roots.py +0 -0
  161. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/client/sampling.py +0 -0
  162. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/contrib/README.md +0 -0
  163. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/contrib/bulk_tool_caller/README.md +0 -0
  164. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/contrib/bulk_tool_caller/__init__.py +0 -0
  165. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/contrib/bulk_tool_caller/bulk_tool_caller.py +0 -0
  166. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/contrib/mcp_mixin/README.md +0 -0
  167. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/contrib/mcp_mixin/__init__.py +0 -0
  168. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/contrib/mcp_mixin/example.py +0 -0
  169. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/exceptions.py +0 -0
  170. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/prompts/__init__.py +0 -0
  171. /fastmcp-2.6.0/src/fastmcp/server/auth/providers/__init__.py → /fastmcp-2.7.0/src/fastmcp/py.typed +0 -0
  172. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/server/__init__.py +0 -0
  173. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/server/auth/__init__.py +0 -0
  174. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/server/auth/auth.py +0 -0
  175. {fastmcp-2.6.0/tests → fastmcp-2.7.0/src/fastmcp/server/auth/providers}/__init__.py +0 -0
  176. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/server/auth/providers/bearer.py +0 -0
  177. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/server/auth/providers/bearer_env.py +0 -0
  178. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/server/dependencies.py +0 -0
  179. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/server/http.py +0 -0
  180. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/settings.py +0 -0
  181. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/utilities/__init__.py +0 -0
  182. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/utilities/cache.py +0 -0
  183. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/utilities/exceptions.py +0 -0
  184. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/utilities/http.py +0 -0
  185. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/utilities/json_schema.py +0 -0
  186. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/utilities/logging.py +0 -0
  187. {fastmcp-2.6.0 → fastmcp-2.7.0}/src/fastmcp/utilities/tests.py +0 -0
  188. {fastmcp-2.6.0/tests/auth → fastmcp-2.7.0/tests}/__init__.py +0 -0
  189. {fastmcp-2.6.0/tests/cli → fastmcp-2.7.0/tests/auth}/__init__.py +0 -0
  190. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/auth/providers/test_bearer_env.py +0 -0
  191. {fastmcp-2.6.0/tests/client → fastmcp-2.7.0/tests/cli}/__init__.py +0 -0
  192. {fastmcp-2.6.0/tests/deprecated → fastmcp-2.7.0/tests/client}/__init__.py +0 -0
  193. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/client/test_openapi.py +0 -0
  194. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/conftest.py +0 -0
  195. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/contrib/__init__.py +0 -0
  196. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/contrib/test_mcp_mixin.py +0 -0
  197. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/prompts/__init__.py +0 -0
  198. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/prompts/test_prompt.py +0 -0
  199. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/resources/__init__.py +0 -0
  200. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/resources/test_file_resources.py +0 -0
  201. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/__init__.py +0 -0
  202. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/http/__init__.py +0 -0
  203. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/http/test_custom_routes.py +0 -0
  204. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/http/test_http_middleware.py +0 -0
  205. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/openapi/__init__.py +0 -0
  206. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/openapi/test_openapi.py +0 -0
  207. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/openapi/test_route_map_fn.py +0 -0
  208. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_app_state.py +0 -0
  209. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_context.py +0 -0
  210. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_logging.py +0 -0
  211. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/server/test_resource_prefix_formats.py +0 -0
  212. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/test_examples.py +0 -0
  213. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/test_servers/sse.py +0 -0
  214. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/test_servers/stdio.py +0 -0
  215. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/tools/__init__.py +0 -0
  216. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/utilities/__init__.py +0 -0
  217. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/utilities/openapi/__init__.py +0 -0
  218. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/utilities/openapi/conftest.py +0 -0
  219. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/utilities/openapi/test_openapi_advanced.py +0 -0
  220. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/utilities/openapi/test_openapi_fastapi.py +0 -0
  221. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/utilities/test_cache.py +0 -0
  222. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/utilities/test_json_schema.py +0 -0
  223. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/utilities/test_logging.py +0 -0
  224. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/utilities/test_tests.py +0 -0
  225. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/utilities/test_typeadapter.py +0 -0
  226. {fastmcp-2.6.0 → fastmcp-2.7.0}/tests/utilities/test_types.py +0 -0
@@ -7,6 +7,7 @@ jobs:
7
7
  permissions:
8
8
  contents: read
9
9
  pull-requests: write
10
+ issues: write
10
11
  runs-on: ubuntu-latest
11
12
  steps:
12
13
  - uses: actions/labeler@v5
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastmcp
3
- Version: 2.6.0
3
+ Version: 2.7.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
@@ -25,7 +25,8 @@ Requires-Dist: openapi-pydantic>=0.5.1
25
25
  Requires-Dist: python-dotenv>=1.1.0
26
26
  Requires-Dist: rich>=13.9.4
27
27
  Requires-Dist: typer>=0.15.2
28
- Requires-Dist: websockets>=14.0
28
+ Provides-Extra: websockets
29
+ Requires-Dist: websockets>=15.0.1; extra == 'websockets'
29
30
  Description-Content-Type: text/markdown
30
31
 
31
32
  <div align="center">
@@ -61,7 +62,7 @@ from fastmcp import FastMCP
61
62
 
62
63
  mcp = FastMCP("Demo 🚀")
63
64
 
64
- @mcp.tool()
65
+ @mcp.tool
65
66
  def add(a: int, b: int) -> int:
66
67
  """Add two numbers"""
67
68
  return a + b
@@ -104,6 +105,7 @@ There are two ways to access the LLM-friendly documentation:
104
105
  - [Proxy Servers](#proxy-servers)
105
106
  - [Composing MCP Servers](#composing-mcp-servers)
106
107
  - [OpenAPI \& FastAPI Generation](#openapi--fastapi-generation)
108
+ - [Authentication \& Security](#authentication--security)
107
109
  - [Running Your Server](#running-your-server)
108
110
  - [Contributing](#contributing)
109
111
  - [Prerequisites](#prerequisites)
@@ -116,20 +118,20 @@ There are two ways to access the LLM-friendly documentation:
116
118
 
117
119
  ## What is MCP?
118
120
 
119
- 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:
121
+ 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. It is often described as "the USB-C port for AI", providing a uniform way to connect LLMs to resources they can use. It may be easier to think of it as an API, but specifically designed for LLM interactions. MCP servers can:
120
122
 
121
- - Expose data through **Resources** (similar to `GET` requests; load info into context)
122
- - Provide functionality through **Tools** (similar to `POST`/`PUT` requests; execute actions)
123
- - Define interaction patterns through **Prompts** (reusable templates)
123
+ - Expose data through **Resources** (think of these sort of like GET endpoints; they are used to load information into the LLM's context)
124
+ - Provide functionality through **Tools** (sort of like POST endpoints; they are used to execute code or otherwise produce a side effect)
125
+ - Define interaction patterns through **Prompts** (reusable templates for LLM interactions)
124
126
  - And more!
125
127
 
126
- FastMCP provides a high-level, Pythonic interface for building and interacting with these servers.
128
+ FastMCP provides a high-level, Pythonic interface for building, managing, and interacting with these servers.
127
129
 
128
130
  ## Why FastMCP?
129
131
 
130
132
  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.
131
133
 
132
- While the core server concepts of FastMCP 1.0 laid the groundwork and were contributed to the official MCP SDK, **FastMCP 2.0 (this project) is the actively developed successor**, adding significant enhancements and entirely new capabilities like a powerful **client library**, server **proxying**, **composition** patterns, **OpenAPI/FastAPI integration**, and much more.
134
+ FastMCP 2.0 has evolved into a comprehensive platform that goes far beyond basic protocol implementation. While 1.0 provided server-building capabilities (and is now part of the official MCP SDK), 2.0 offers a complete ecosystem including client libraries, authentication systems, deployment tools, integrations with major AI platforms, testing frameworks, and production-ready infrastructure patterns.
133
135
 
134
136
  FastMCP aims to be:
135
137
 
@@ -139,7 +141,7 @@ FastMCP aims to be:
139
141
 
140
142
  🐍 **Pythonic:** Feels natural to Python developers
141
143
 
142
- 🔍 **Complete:** FastMCP aims to provide a full implementation of the core MCP specification for both servers and clients
144
+ 🔍 **Complete:** A comprehensive platform for all MCP use cases, from dev to prod
143
145
 
144
146
  ## Installation
145
147
 
@@ -157,7 +159,7 @@ These are the building blocks for creating MCP servers and clients with FastMCP.
157
159
 
158
160
  ### The `FastMCP` Server
159
161
 
160
- The central object representing your MCP application. It holds your tools, resources, and prompts, manages connections, and can be configured with settings like [authentication providers](https://gofastmcp.com/servers/fastmcp#authentication).
162
+ The central object representing your MCP application. It holds your tools, resources, and prompts, manages connections, and can be configured with settings like authentication.
161
163
 
162
164
  ```python
163
165
  from fastmcp import FastMCP
@@ -173,7 +175,7 @@ Learn more in the [**FastMCP Server Documentation**](https://gofastmcp.com/serve
173
175
  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.
174
176
 
175
177
  ```python
176
- @mcp.tool()
178
+ @mcp.tool
177
179
  def multiply(a: float, b: float) -> float:
178
180
  """Multiplies two numbers."""
179
181
  return a * b
@@ -202,10 +204,10 @@ Learn more in the [**Resources & Templates Documentation**](https://gofastmcp.co
202
204
 
203
205
  ### Prompts
204
206
 
205
- Prompts define reusable message templates to guide LLM interactions. Decorate functions with `@mcp.prompt()`. Return strings or `Message` objects.
207
+ Prompts define reusable message templates to guide LLM interactions. Decorate functions with `@mcp.prompt`. Return strings or `Message` objects.
206
208
 
207
209
  ```python
208
- @mcp.prompt()
210
+ @mcp.prompt
209
211
  def summarize_request(text: str) -> str:
210
212
  """Generate a prompt asking for a summary."""
211
213
  return f"Please summarize the following text:\n\n{text}"
@@ -230,7 +232,7 @@ from fastmcp import FastMCP, Context
230
232
 
231
233
  mcp = FastMCP("My MCP Server")
232
234
 
233
- @mcp.tool()
235
+ @mcp.tool
234
236
  async def process_data(uri: str, ctx: Context):
235
237
  # Log a message to the client
236
238
  await ctx.info(f"Processing {uri}...")
@@ -328,7 +330,17 @@ Learn more in the [**Composition Documentation**](https://gofastmcp.com/patterns
328
330
 
329
331
  Automatically generate FastMCP servers from existing OpenAPI specifications (`FastMCP.from_openapi()`) or FastAPI applications (`FastMCP.from_fastapi()`), instantly bringing your web APIs to the MCP ecosystem.
330
332
 
331
- Learn more: [**OpenAPI Integration**](https://gofastmcp.com/patterns/openapi) | [**FastAPI Integration**](https://gofastmcp.com/patterns/fastapi).
333
+ Learn more: [**OpenAPI Integration**](https://gofastmcp.com/servers/openapi#openapi-integration) | [**FastAPI Integration**](https://gofastmcp.com/deployment/asgi#fastapi-integration).
334
+
335
+ ### Authentication & Security
336
+
337
+ FastMCP provides built-in authentication support to secure both your MCP servers and clients in production environments. Protect your server endpoints from unauthorized access and authenticate your clients against secured MCP servers using industry-standard protocols.
338
+
339
+ - **Server Protection**: Secure your FastMCP server endpoints with configurable authentication providers
340
+ - **Client Authentication**: Connect to authenticated MCP servers with automatic credential management
341
+ - **Production Ready**: Support for common authentication patterns used in enterprise environments
342
+
343
+ Learn more in the **Authentication Documentation** for [servers](https://gofastmcp.com/servers/auth) and [clients](https://gofastmcp.com/clients/auth).
332
344
 
333
345
  ## Running Your Server
334
346
 
@@ -340,7 +352,7 @@ from fastmcp import FastMCP
340
352
 
341
353
  mcp = FastMCP("Demo 🚀")
342
354
 
343
- @mcp.tool()
355
+ @mcp.tool
344
356
  def hello(name: str) -> str:
345
357
  return f"Hello, {name}!"
346
358
 
@@ -31,7 +31,7 @@ from fastmcp import FastMCP
31
31
 
32
32
  mcp = FastMCP("Demo 🚀")
33
33
 
34
- @mcp.tool()
34
+ @mcp.tool
35
35
  def add(a: int, b: int) -> int:
36
36
  """Add two numbers"""
37
37
  return a + b
@@ -74,6 +74,7 @@ There are two ways to access the LLM-friendly documentation:
74
74
  - [Proxy Servers](#proxy-servers)
75
75
  - [Composing MCP Servers](#composing-mcp-servers)
76
76
  - [OpenAPI \& FastAPI Generation](#openapi--fastapi-generation)
77
+ - [Authentication \& Security](#authentication--security)
77
78
  - [Running Your Server](#running-your-server)
78
79
  - [Contributing](#contributing)
79
80
  - [Prerequisites](#prerequisites)
@@ -86,20 +87,20 @@ There are two ways to access the LLM-friendly documentation:
86
87
 
87
88
  ## What is MCP?
88
89
 
89
- 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:
90
+ 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. It is often described as "the USB-C port for AI", providing a uniform way to connect LLMs to resources they can use. It may be easier to think of it as an API, but specifically designed for LLM interactions. MCP servers can:
90
91
 
91
- - Expose data through **Resources** (similar to `GET` requests; load info into context)
92
- - Provide functionality through **Tools** (similar to `POST`/`PUT` requests; execute actions)
93
- - Define interaction patterns through **Prompts** (reusable templates)
92
+ - Expose data through **Resources** (think of these sort of like GET endpoints; they are used to load information into the LLM's context)
93
+ - Provide functionality through **Tools** (sort of like POST endpoints; they are used to execute code or otherwise produce a side effect)
94
+ - Define interaction patterns through **Prompts** (reusable templates for LLM interactions)
94
95
  - And more!
95
96
 
96
- FastMCP provides a high-level, Pythonic interface for building and interacting with these servers.
97
+ FastMCP provides a high-level, Pythonic interface for building, managing, and interacting with these servers.
97
98
 
98
99
  ## Why FastMCP?
99
100
 
100
101
  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.
101
102
 
102
- While the core server concepts of FastMCP 1.0 laid the groundwork and were contributed to the official MCP SDK, **FastMCP 2.0 (this project) is the actively developed successor**, adding significant enhancements and entirely new capabilities like a powerful **client library**, server **proxying**, **composition** patterns, **OpenAPI/FastAPI integration**, and much more.
103
+ FastMCP 2.0 has evolved into a comprehensive platform that goes far beyond basic protocol implementation. While 1.0 provided server-building capabilities (and is now part of the official MCP SDK), 2.0 offers a complete ecosystem including client libraries, authentication systems, deployment tools, integrations with major AI platforms, testing frameworks, and production-ready infrastructure patterns.
103
104
 
104
105
  FastMCP aims to be:
105
106
 
@@ -109,7 +110,7 @@ FastMCP aims to be:
109
110
 
110
111
  🐍 **Pythonic:** Feels natural to Python developers
111
112
 
112
- 🔍 **Complete:** FastMCP aims to provide a full implementation of the core MCP specification for both servers and clients
113
+ 🔍 **Complete:** A comprehensive platform for all MCP use cases, from dev to prod
113
114
 
114
115
  ## Installation
115
116
 
@@ -127,7 +128,7 @@ These are the building blocks for creating MCP servers and clients with FastMCP.
127
128
 
128
129
  ### The `FastMCP` Server
129
130
 
130
- The central object representing your MCP application. It holds your tools, resources, and prompts, manages connections, and can be configured with settings like [authentication providers](https://gofastmcp.com/servers/fastmcp#authentication).
131
+ The central object representing your MCP application. It holds your tools, resources, and prompts, manages connections, and can be configured with settings like authentication.
131
132
 
132
133
  ```python
133
134
  from fastmcp import FastMCP
@@ -143,7 +144,7 @@ Learn more in the [**FastMCP Server Documentation**](https://gofastmcp.com/serve
143
144
  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.
144
145
 
145
146
  ```python
146
- @mcp.tool()
147
+ @mcp.tool
147
148
  def multiply(a: float, b: float) -> float:
148
149
  """Multiplies two numbers."""
149
150
  return a * b
@@ -172,10 +173,10 @@ Learn more in the [**Resources & Templates Documentation**](https://gofastmcp.co
172
173
 
173
174
  ### Prompts
174
175
 
175
- Prompts define reusable message templates to guide LLM interactions. Decorate functions with `@mcp.prompt()`. Return strings or `Message` objects.
176
+ Prompts define reusable message templates to guide LLM interactions. Decorate functions with `@mcp.prompt`. Return strings or `Message` objects.
176
177
 
177
178
  ```python
178
- @mcp.prompt()
179
+ @mcp.prompt
179
180
  def summarize_request(text: str) -> str:
180
181
  """Generate a prompt asking for a summary."""
181
182
  return f"Please summarize the following text:\n\n{text}"
@@ -200,7 +201,7 @@ from fastmcp import FastMCP, Context
200
201
 
201
202
  mcp = FastMCP("My MCP Server")
202
203
 
203
- @mcp.tool()
204
+ @mcp.tool
204
205
  async def process_data(uri: str, ctx: Context):
205
206
  # Log a message to the client
206
207
  await ctx.info(f"Processing {uri}...")
@@ -298,7 +299,17 @@ Learn more in the [**Composition Documentation**](https://gofastmcp.com/patterns
298
299
 
299
300
  Automatically generate FastMCP servers from existing OpenAPI specifications (`FastMCP.from_openapi()`) or FastAPI applications (`FastMCP.from_fastapi()`), instantly bringing your web APIs to the MCP ecosystem.
300
301
 
301
- Learn more: [**OpenAPI Integration**](https://gofastmcp.com/patterns/openapi) | [**FastAPI Integration**](https://gofastmcp.com/patterns/fastapi).
302
+ Learn more: [**OpenAPI Integration**](https://gofastmcp.com/servers/openapi#openapi-integration) | [**FastAPI Integration**](https://gofastmcp.com/deployment/asgi#fastapi-integration).
303
+
304
+ ### Authentication & Security
305
+
306
+ FastMCP provides built-in authentication support to secure both your MCP servers and clients in production environments. Protect your server endpoints from unauthorized access and authenticate your clients against secured MCP servers using industry-standard protocols.
307
+
308
+ - **Server Protection**: Secure your FastMCP server endpoints with configurable authentication providers
309
+ - **Client Authentication**: Connect to authenticated MCP servers with automatic credential management
310
+ - **Production Ready**: Support for common authentication patterns used in enterprise environments
311
+
312
+ Learn more in the **Authentication Documentation** for [servers](https://gofastmcp.com/servers/auth) and [clients](https://gofastmcp.com/clients/auth).
302
313
 
303
314
  ## Running Your Server
304
315
 
@@ -310,7 +321,7 @@ from fastmcp import FastMCP
310
321
 
311
322
  mcp = FastMCP("Demo 🚀")
312
323
 
313
- @mcp.tool()
324
+ @mcp.tool
314
325
  def hello(name: str) -> str:
315
326
  return f"Hello, {name}!"
316
327
 
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  title: Bearer Token Authentication
3
3
  sidebarTitle: Bearer Auth
4
- description: Authenticate your FastMCP client using pre-existing OAuth 2.0 Bearer tokens.
4
+ description: Authenticate your FastMCP client with a Bearer token.
5
5
  icon: key
6
+ tag: "New!"
6
7
  ---
7
8
 
8
9
  import { VersionBadge } from "/snippets/version-badge.mdx"
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  title: OAuth Authentication
3
3
  sidebarTitle: OAuth
4
- description: Authenticate your FastMCP client with servers using the OAuth 2.0 Authorization Code Grant, including user interaction via a web browser.
4
+ description: Authenticate your FastMCP client via OAuth 2.1.
5
5
  icon: window
6
+ tag: "New!"
6
7
  ---
7
8
 
8
9
  import { VersionBadge } from "/snippets/version-badge.mdx"
@@ -13,7 +14,7 @@ import { VersionBadge } from "/snippets/version-badge.mdx"
13
14
  OAuth authentication is only relevant for HTTP-based transports and requires user interaction via a web browser.
14
15
  </Tip>
15
16
 
16
- When your FastMCP client needs to access an MCP server protected by OAuth 2.0, and the process requires user interaction (like logging in and granting consent), you should use the Authorization Code Flow. FastMCP provides the `fastmcp.client.auth.OAuth` helper to simplify this entire process.
17
+ When your FastMCP client needs to access an MCP server protected by OAuth 2.1, and the process requires user interaction (like logging in and granting consent), you should use the Authorization Code Flow. FastMCP provides the `fastmcp.client.auth.OAuth` helper to simplify this entire process.
17
18
 
18
19
  This flow is common for user-facing applications where the application acts on behalf of the user.
19
20
 
@@ -35,7 +36,7 @@ async with Client("https://fastmcp.cloud/mcp", auth="oauth") as client:
35
36
 
36
37
  ### `OAuth` Helper
37
38
 
38
- To fully configure the OAuth flow, use the `OAuth` helper and pass it to the `auth` parameter of the `Client` or transport instance. `OAuth` manages the complexities of the OAuth 2.0 Authorization Code Grant with PKCE (Proof Key for Code Exchange) for enhanced security, and implements the full `httpx.Auth` interface.
39
+ To fully configure the OAuth flow, use the `OAuth` helper and pass it to the `auth` parameter of the `Client` or transport instance. `OAuth` manages the complexities of the OAuth 2.1 Authorization Code Grant with PKCE (Proof Key for Code Exchange) for enhanced security, and implements the full `httpx.Auth` interface.
39
40
 
40
41
  ```python {2, 4, 6}
41
42
  from fastmcp import Client
@@ -359,7 +359,7 @@ import asyncio
359
359
  # 1. Create your FastMCP server instance
360
360
  server = FastMCP(name="InMemoryServer")
361
361
 
362
- @server.tool()
362
+ @server.tool
363
363
  def ping():
364
364
  return "pong"
365
365
 
@@ -32,7 +32,7 @@ from fastmcp import FastMCP
32
32
 
33
33
  mcp = FastMCP("MyServer")
34
34
 
35
- @mcp.tool()
35
+ @mcp.tool
36
36
  def hello(name: str) -> str:
37
37
  return f"Hello, {name}!"
38
38
 
@@ -22,7 +22,7 @@ from fastmcp import FastMCP
22
22
 
23
23
  mcp = FastMCP(name="MyServer")
24
24
 
25
- @mcp.tool()
25
+ @mcp.tool
26
26
  def hello(name: str) -> str:
27
27
  return f"Hello, {name}!"
28
28
 
@@ -59,7 +59,18 @@ For development and testing, you can use the `dev` command to run your server wi
59
59
  fastmcp dev server.py
60
60
  ```
61
61
 
62
- See the [CLI documentation](/deployment/cli) for detailed information about all available commands and options.
62
+ See the [CLI documentation](/patterns/cli) for detailed information about all available commands and options.
63
+
64
+ ### Passing Arguments to Servers
65
+
66
+ When servers accept command line arguments (using argparse, click, or other libraries), you can pass them after `--`:
67
+
68
+ ```bash
69
+ fastmcp run config_server.py -- --config config.json
70
+ fastmcp run database_server.py -- --database-path /tmp/db.sqlite --debug
71
+ ```
72
+
73
+ This is useful for servers that need configuration files, database paths, API keys, or other runtime options.
63
74
 
64
75
  ## Transport Options
65
76
 
@@ -233,7 +244,7 @@ import asyncio
233
244
 
234
245
  mcp = FastMCP(name="MyServer")
235
246
 
236
- @mcp.tool()
247
+ @mcp.tool
237
248
  def hello(name: str) -> str:
238
249
  return f"Hello, {name}!"
239
250
 
@@ -11,11 +11,22 @@
11
11
  },
12
12
  "decoration": "windows"
13
13
  },
14
+ "banner": {
15
+ "content": "[FastMCP Cloud](https://fastmcp.link/x0Kyhy2) is coming!"
16
+ },
14
17
  "colors": {
15
18
  "dark": "#f72585",
16
19
  "light": "#4cc9f0",
17
20
  "primary": "#2d00f7"
18
21
  },
22
+ "contextual": {
23
+ "options": [
24
+ "copy",
25
+ "view",
26
+ "chatgpt",
27
+ "claude"
28
+ ]
29
+ },
19
30
  "description": "The fast, Pythonic way to build MCP servers and clients.",
20
31
  "favicon": {
21
32
  "dark": "/assets/favicon.ico",
@@ -47,7 +58,8 @@
47
58
  "pages": [
48
59
  "getting-started/welcome",
49
60
  "getting-started/installation",
50
- "getting-started/quickstart"
61
+ "getting-started/quickstart",
62
+ "updates"
51
63
  ]
52
64
  },
53
65
  {
@@ -93,8 +105,8 @@
93
105
  "group": "Authentication",
94
106
  "icon": "user-shield",
95
107
  "pages": [
96
- "clients/auth/bearer",
97
- "clients/auth/oauth"
108
+ "clients/auth/oauth",
109
+ "clients/auth/bearer"
98
110
  ]
99
111
  },
100
112
  "clients/advanced-features"
@@ -106,6 +118,7 @@
106
118
  "integrations/anthropic",
107
119
  "integrations/claude-desktop",
108
120
  "integrations/openai",
121
+ "integrations/gemini",
109
122
  "integrations/contrib"
110
123
  ]
111
124
  },
@@ -32,7 +32,7 @@ from fastmcp import FastMCP
32
32
 
33
33
  mcp = FastMCP("My MCP Server")
34
34
 
35
- @mcp.tool()
35
+ @mcp.tool
36
36
  def greet(name: str) -> str:
37
37
  return f"Hello, {name}!"
38
38
  ```
@@ -49,7 +49,7 @@ from fastmcp import FastMCP, Client
49
49
 
50
50
  mcp = FastMCP("My MCP Server")
51
51
 
52
- @mcp.tool()
52
+ @mcp.tool
53
53
  def greet(name: str) -> str:
54
54
  return f"Hello, {name}!"
55
55
 
@@ -76,7 +76,7 @@ from fastmcp import FastMCP
76
76
 
77
77
  mcp = FastMCP("My MCP Server")
78
78
 
79
- @mcp.tool()
79
+ @mcp.tool
80
80
  def greet(name: str) -> str:
81
81
  return f"Hello, {name}!"
82
82
 
@@ -14,7 +14,7 @@ from fastmcp import FastMCP
14
14
 
15
15
  mcp = FastMCP("Demo 🚀")
16
16
 
17
- @mcp.tool()
17
+ @mcp.tool
18
18
  def add(a: int, b: int) -> int:
19
19
  """Add two numbers"""
20
20
  return a + b
@@ -42,8 +42,7 @@ The Model Context Protocol lets you build servers that expose data and functiona
42
42
  - Define interaction patterns through `Prompts` (reusable templates for LLM interactions)
43
43
  - And more!
44
44
 
45
- There is a low-level Python SDK available for implementing the protocol directly, but FastMCP aims to make that easier by providing a high-level, Pythonic interface.
46
-
45
+ FastMCP provides a high-level, Pythonic interface for building, managing, and interacting with these servers.
47
46
 
48
47
  ## Why FastMCP?
49
48
 
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  title: Anthropic
3
3
  sidebarTitle: Anthropic
4
- description: Access FastMCP servers from the Anthropic Messages API
4
+ description: Call FastMCP servers from the Anthropic API
5
5
  icon: message-smile
6
+ tag: "New!"
6
7
  ---
7
8
 
8
9
  import { VersionBadge } from "/snippets/version-badge.mdx"
@@ -27,7 +28,7 @@ from fastmcp import FastMCP
27
28
 
28
29
  mcp = FastMCP(name="Dice Roller")
29
30
 
30
- @mcp.tool()
31
+ @mcp.tool
31
32
  def roll_dice(n_dice: int) -> list[int]:
32
33
  """Roll `n_dice` 6-sided dice and return the results."""
33
34
  return [random.randint(1, 6) for _ in range(n_dice)]
@@ -66,6 +67,12 @@ To use the Messages API with MCP servers, you'll need to install the Anthropic P
66
67
  pip install anthropic
67
68
  ```
68
69
 
70
+ You'll also need to authenticate with Anthropic. You can do this by setting the `ANTHROPIC_API_KEY` environment variable. Consult the Anthropic SDK documentation for more information.
71
+
72
+ ```bash
73
+ export ANTHROPIC_API_KEY="your-api-key"
74
+ ```
75
+
69
76
  Here is an example of how to call your server from Python. Note that you'll need to replace `https://your-server-url.com` with the actual URL of your server. In addition, we use `/sse` as the endpoint because we deployed an SSE server with the default path; you may need to use a different endpoint if you customized your server's deployment. **At this time you must also include the `extra_headers` parameter with the `anthropic-beta` header.**
70
77
 
71
78
  ```python {5, 13-22}
@@ -164,7 +171,7 @@ auth = BearerAuthProvider(
164
171
 
165
172
  mcp = FastMCP(name="Dice Roller", auth=auth)
166
173
 
167
- @mcp.tool()
174
+ @mcp.tool
168
175
  def roll_dice(n_dice: int) -> list[int]:
169
176
  """Roll `n_dice` 6-sided dice and return the results."""
170
177
  return [random.randint(1, 6) for _ in range(n_dice)]
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: Claude Desktop
3
3
  sidebarTitle: Claude Desktop
4
- description: Integrate FastMCP servers with Claude Desktop
4
+ description: Call FastMCP servers from Claude Desktop
5
5
  icon: desktop
6
6
  ---
7
7
 
@@ -31,7 +31,7 @@ from fastmcp import FastMCP
31
31
 
32
32
  mcp = FastMCP(name="Dice Roller")
33
33
 
34
- @mcp.tool()
34
+ @mcp.tool
35
35
  def roll_dice(n_dice: int) -> list[int]:
36
36
  """Roll `n_dice` 6-sided dice and return the results."""
37
37
  return [random.randint(1, 6) for _ in range(n_dice)]
@@ -0,0 +1,109 @@
1
+ ---
2
+ title: Gemini SDK
3
+ sidebarTitle: Gemini SDK
4
+ description: Call FastMCP servers from the Google Gemini SDK
5
+ icon: message-smile
6
+ tag: "New!"
7
+ ---
8
+
9
+ import { VersionBadge } from "/snippets/version-badge.mdx"
10
+
11
+ Google's Gemini API includes built-in support for MCP servers in their Python and JavaScript SDKs, allowing you to connect directly to MCP servers and use their tools seamlessly with Gemini models.
12
+
13
+ ## Gemini Python SDK
14
+
15
+ Google's [Gemini Python SDK](https://ai.google.dev/gemini-api/docs) can use FastMCP clients directly.
16
+
17
+ <Note>
18
+ Google's MCP integration is currently experimental and available in the Python and JavaScript SDKs. The API automatically calls MCP tools when needed and can connect to both local and remote MCP servers.
19
+ </Note>
20
+
21
+ <Tip>
22
+ Currently, Gemini's MCP support only accesses **tools** from MCP servers—it queries the `list_tools` endpoint and exposes those functions to the AI. Other MCP features like resources and prompts are not currently supported.
23
+ </Tip>
24
+
25
+ ### Create a Server
26
+
27
+ First, create a FastMCP server with the tools you want to expose. For this example, we'll create a server with a single tool that rolls dice.
28
+
29
+ ```python server.py
30
+ import random
31
+ from fastmcp import FastMCP
32
+
33
+ mcp = FastMCP(name="Dice Roller")
34
+
35
+ @mcp.tool
36
+ def roll_dice(n_dice: int) -> list[int]:
37
+ """Roll `n_dice` 6-sided dice and return the results."""
38
+ return [random.randint(1, 6) for _ in range(n_dice)]
39
+
40
+ if __name__ == "__main__":
41
+ mcp.run()
42
+ ```
43
+
44
+ ### Call the Server
45
+
46
+
47
+ To use the Gemini API with MCP, you'll need to install the Google Generative AI SDK:
48
+
49
+ ```bash
50
+ pip install google-genai
51
+ ```
52
+
53
+ You'll also need to authenticate with Google. You can do this by setting the `GEMINI_API_KEY` environment variable. Consult the Gemini SDK documentation for more information.
54
+
55
+ ```bash
56
+ export GEMINI_API_KEY="your-api-key"
57
+ ```
58
+
59
+ Gemini's SDK interacts directly with the MCP client session. To call the server, you'll need to instantiate a FastMCP client, enter its connection context, and pass the client session to the Gemini SDK.
60
+
61
+ ```python {5, 9, 15}
62
+ from fastmcp import Client
63
+ from google import genai
64
+ import asyncio
65
+
66
+ mcp_client = Client("server.py")
67
+ gemini_client = genai.Client()
68
+
69
+ async def main():
70
+ async with client:
71
+ response = await gemini_client.aio.models.generate_content(
72
+ model="gemini-2.0-flash",
73
+ contents="Roll 3 dice!",
74
+ config=genai.types.GenerateContentConfig(
75
+ temperature=0,
76
+ tools=[mcp_client.session], # Pass the FastMCP client session
77
+ ),
78
+ )
79
+ print(response.text)
80
+
81
+ if __name__ == "__main__":
82
+ asyncio.run(main())
83
+ ```
84
+
85
+ If you run this code, you'll see output like:
86
+
87
+ ```text
88
+ Okay, I rolled 3 dice and got a 5, 4, and 1.
89
+ ```
90
+
91
+ ### Remote & Authenticated Servers
92
+
93
+ In the above example, we connected to our local server using `stdio` transport. Because we're using a FastMCP client, you can also connect to any local or remote MCP server, using any [transport](/clients/transports) or [auth](/clients/auth) method supported by FastMCP, simply by changing the client configuration.
94
+
95
+ For example, to connect to a remote, authenticated server, you can use the following client:
96
+
97
+ ```python
98
+ from fastmcp import Client
99
+ from fastmcp.client.auth import BearerAuth
100
+
101
+ client = Client(
102
+ "https://my-server.com/sse",
103
+ auth=BearerAuth("<your-token>"),
104
+ )
105
+ ```
106
+
107
+ The rest of the code remains the same.
108
+
109
+