fastmcp 2.5.2__tar.gz → 2.6.1__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 (225) hide show
  1. {fastmcp-2.5.2 → fastmcp-2.6.1}/PKG-INFO +28 -16
  2. {fastmcp-2.5.2 → fastmcp-2.6.1}/README.md +25 -14
  3. fastmcp-2.6.1/docs/assets/favicon.ico +0 -0
  4. fastmcp-2.6.1/docs/assets/logo.png +0 -0
  5. fastmcp-2.6.1/docs/clients/auth/bearer.mdx +85 -0
  6. fastmcp-2.6.1/docs/clients/auth/oauth.mdx +116 -0
  7. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/clients/client.mdx +1 -1
  8. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/deployment/running-server.mdx +2 -2
  9. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/docs.json +57 -20
  10. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/getting-started/welcome.mdx +9 -9
  11. fastmcp-2.6.1/docs/integrations/anthropic.mdx +231 -0
  12. fastmcp-2.6.1/docs/integrations/claude-desktop.mdx +221 -0
  13. fastmcp-2.6.1/docs/integrations/gemini.mdx +108 -0
  14. fastmcp-2.6.1/docs/integrations/openai.mdx +228 -0
  15. {fastmcp-2.5.2/docs/deployment → fastmcp-2.6.1/docs/patterns}/cli.mdx +15 -12
  16. fastmcp-2.6.1/docs/servers/auth/bearer.mdx +187 -0
  17. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/composition.mdx +1 -1
  18. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/fastmcp.mdx +4 -29
  19. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/tools.mdx +20 -1
  20. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/snippets/version-badge.mdx +3 -4
  21. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/style.css +13 -11
  22. {fastmcp-2.5.2 → fastmcp-2.6.1}/pyproject.toml +4 -1
  23. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/__init__.py +3 -0
  24. fastmcp-2.6.1/src/fastmcp/client/auth/__init__.py +4 -0
  25. fastmcp-2.6.1/src/fastmcp/client/auth/bearer.py +17 -0
  26. fastmcp-2.6.1/src/fastmcp/client/auth/oauth.py +391 -0
  27. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/client.py +74 -26
  28. fastmcp-2.6.1/src/fastmcp/client/oauth_callback.py +310 -0
  29. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/transports.py +76 -14
  30. fastmcp-2.6.1/src/fastmcp/server/auth/__init__.py +4 -0
  31. fastmcp-2.6.1/src/fastmcp/server/auth/auth.py +45 -0
  32. fastmcp-2.6.1/src/fastmcp/server/auth/providers/bearer.py +377 -0
  33. fastmcp-2.6.1/src/fastmcp/server/auth/providers/bearer_env.py +62 -0
  34. fastmcp-2.6.1/src/fastmcp/server/auth/providers/in_memory.py +325 -0
  35. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/dependencies.py +10 -0
  36. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/http.py +38 -66
  37. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/openapi.py +2 -0
  38. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/server.py +21 -26
  39. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/settings.py +27 -8
  40. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/tools/tool.py +22 -3
  41. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/tools/tool_manager.py +2 -0
  42. fastmcp-2.6.1/src/fastmcp/utilities/http.py +8 -0
  43. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/tests.py +22 -10
  44. fastmcp-2.6.1/tests/auth/providers/test_bearer.py +635 -0
  45. fastmcp-2.6.1/tests/auth/providers/test_bearer_env.py +82 -0
  46. fastmcp-2.6.1/tests/auth/test_oauth_client.py +265 -0
  47. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_client.py +54 -14
  48. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_openapi.py +26 -79
  49. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_roots.py +1 -3
  50. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_sse.py +12 -28
  51. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_stdio.py +9 -19
  52. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_streamable_http.py +23 -45
  53. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/deprecated/test_deprecated.py +0 -11
  54. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/prompts/test_prompt_manager.py +2 -4
  55. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/resources/test_file_resources.py +0 -1
  56. fastmcp-2.6.1/tests/server/__init__.py +0 -0
  57. fastmcp-2.6.1/tests/server/http/__init__.py +0 -0
  58. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/http/test_http_dependencies.py +10 -53
  59. fastmcp-2.6.1/tests/server/openapi/__init__.py +0 -0
  60. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/openapi/test_openapi.py +16 -38
  61. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_auth_integration.py +1 -1
  62. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_import_server.py +6 -14
  63. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_logging.py +4 -3
  64. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_mount.py +12 -26
  65. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_proxy.py +31 -17
  66. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_server.py +56 -78
  67. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_server_interactions.py +59 -111
  68. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_tool_annotations.py +3 -4
  69. fastmcp-2.6.1/tests/server/test_tool_exclude_args.py +92 -0
  70. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/test_examples.py +8 -26
  71. fastmcp-2.6.1/tests/tools/__init__.py +0 -0
  72. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/tools/test_tool.py +14 -32
  73. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/tools/test_tool_manager.py +21 -90
  74. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_mcp_config.py +2 -6
  75. {fastmcp-2.5.2 → fastmcp-2.6.1}/uv.lock +342 -136
  76. fastmcp-2.5.2/docs/deployment/authentication.mdx +0 -15
  77. fastmcp-2.5.2/docs/patterns/fastapi.mdx +0 -47
  78. fastmcp-2.5.2/src/fastmcp/low_level/README.md +0 -1
  79. fastmcp-2.5.2/tests/client/__init__.py +0 -1
  80. fastmcp-2.5.2/tests/server/test_lifespan.py +0 -396
  81. {fastmcp-2.5.2 → fastmcp-2.6.1}/.cursor/rules/core-mcp-objects.mdc +0 -0
  82. {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/ISSUE_TEMPLATE/bug.yml +0 -0
  83. {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  84. {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/ISSUE_TEMPLATE/enhancement.yml +0 -0
  85. {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/labeler.yml +0 -0
  86. {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/release.yml +0 -0
  87. {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/workflows/labeler.yml +0 -0
  88. {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/workflows/publish.yml +0 -0
  89. {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/workflows/run-static.yml +0 -0
  90. {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/workflows/run-tests.yml +0 -0
  91. {fastmcp-2.5.2 → fastmcp-2.6.1}/.gitignore +0 -0
  92. {fastmcp-2.5.2 → fastmcp-2.6.1}/.pre-commit-config.yaml +0 -0
  93. {fastmcp-2.5.2 → fastmcp-2.6.1}/AGENTS.md +0 -0
  94. {fastmcp-2.5.2 → fastmcp-2.6.1}/LICENSE +0 -0
  95. {fastmcp-2.5.2 → fastmcp-2.6.1}/Windows_Notes.md +0 -0
  96. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/assets/demo-inspector.png +0 -0
  97. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/clients/advanced-features.mdx +0 -0
  98. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/clients/transports.mdx +0 -0
  99. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/deployment/asgi.mdx +0 -0
  100. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/getting-started/installation.mdx +0 -0
  101. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/getting-started/quickstart.mdx +0 -0
  102. {fastmcp-2.5.2/docs/patterns → fastmcp-2.6.1/docs/integrations}/contrib.mdx +0 -0
  103. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/patterns/decorating-methods.mdx +0 -0
  104. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/patterns/http-requests.mdx +0 -0
  105. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/patterns/testing.mdx +0 -0
  106. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/context.mdx +0 -0
  107. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/openapi.mdx +0 -0
  108. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/prompts.mdx +0 -0
  109. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/proxy.mdx +0 -0
  110. {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/resources.mdx +0 -0
  111. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/complex_inputs.py +0 -0
  112. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/desktop.py +0 -0
  113. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/echo.py +0 -0
  114. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/in_memory_proxy_example.py +0 -0
  115. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/memory.py +0 -0
  116. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/mount_example.py +0 -0
  117. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/sampling.py +0 -0
  118. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/screenshot.py +0 -0
  119. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/serializer.py +0 -0
  120. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/simple_echo.py +0 -0
  121. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/README.md +0 -0
  122. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/pyproject.toml +0 -0
  123. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/__init__.py +0 -0
  124. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/__main__.py +0 -0
  125. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/hub.py +0 -0
  126. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/lights/__init__.py +0 -0
  127. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/lights/hue_utils.py +0 -0
  128. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/lights/server.py +0 -0
  129. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/py.typed +0 -0
  130. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/settings.py +0 -0
  131. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/uv.lock +0 -0
  132. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/tags_example.py +0 -0
  133. {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/text_me.py +0 -0
  134. {fastmcp-2.5.2 → fastmcp-2.6.1}/justfile +0 -0
  135. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/__init__.py +0 -0
  136. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/cli/__init__.py +0 -0
  137. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/cli/claude.py +0 -0
  138. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/cli/cli.py +0 -0
  139. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/cli/run.py +0 -0
  140. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/logging.py +0 -0
  141. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/progress.py +0 -0
  142. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/roots.py +0 -0
  143. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/sampling.py +0 -0
  144. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/README.md +0 -0
  145. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/bulk_tool_caller/README.md +0 -0
  146. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/bulk_tool_caller/__init__.py +0 -0
  147. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/bulk_tool_caller/bulk_tool_caller.py +0 -0
  148. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/bulk_tool_caller/example.py +0 -0
  149. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/mcp_mixin/README.md +0 -0
  150. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/mcp_mixin/__init__.py +0 -0
  151. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/mcp_mixin/example.py +0 -0
  152. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/mcp_mixin/mcp_mixin.py +0 -0
  153. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/exceptions.py +0 -0
  154. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/prompts/__init__.py +0 -0
  155. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/prompts/prompt.py +0 -0
  156. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/prompts/prompt_manager.py +0 -0
  157. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/py.typed +0 -0
  158. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/resources/__init__.py +0 -0
  159. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/resources/resource.py +0 -0
  160. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/resources/resource_manager.py +0 -0
  161. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/resources/template.py +0 -0
  162. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/resources/types.py +0 -0
  163. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/__init__.py +0 -0
  164. {fastmcp-2.5.2/src/fastmcp/low_level → fastmcp-2.6.1/src/fastmcp/server/auth/providers}/__init__.py +0 -0
  165. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/context.py +0 -0
  166. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/proxy.py +0 -0
  167. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/tools/__init__.py +0 -0
  168. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/__init__.py +0 -0
  169. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/cache.py +0 -0
  170. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/decorators.py +0 -0
  171. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/exceptions.py +0 -0
  172. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/json_schema.py +0 -0
  173. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/logging.py +0 -0
  174. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/mcp_config.py +0 -0
  175. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/openapi.py +0 -0
  176. {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/types.py +0 -0
  177. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/__init__.py +0 -0
  178. {fastmcp-2.5.2/tests/deprecated → fastmcp-2.6.1/tests/auth}/__init__.py +0 -0
  179. {fastmcp-2.5.2/tests/prompts → fastmcp-2.6.1/tests/cli}/__init__.py +0 -0
  180. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/cli/test_cli.py +0 -0
  181. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/cli/test_run.py +0 -0
  182. {fastmcp-2.5.2/tests/resources → fastmcp-2.6.1/tests/client}/__init__.py +0 -0
  183. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_logs.py +0 -0
  184. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_progress.py +0 -0
  185. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_sampling.py +0 -0
  186. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/conftest.py +0 -0
  187. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/contrib/__init__.py +0 -0
  188. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/contrib/test_bulk_tool_caller.py +0 -0
  189. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/contrib/test_mcp_mixin.py +0 -0
  190. {fastmcp-2.5.2/tests/server → fastmcp-2.6.1/tests/deprecated}/__init__.py +0 -0
  191. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/deprecated/test_mount_separators.py +0 -0
  192. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/deprecated/test_resource_prefixes.py +0 -0
  193. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/deprecated/test_route_type_ignore.py +0 -0
  194. {fastmcp-2.5.2/tests/tools → fastmcp-2.6.1/tests/prompts}/__init__.py +0 -0
  195. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/prompts/test_prompt.py +0 -0
  196. /fastmcp-2.5.2/src/fastmcp/client/base.py → /fastmcp-2.6.1/tests/resources/__init__.py +0 -0
  197. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/resources/test_function_resources.py +0 -0
  198. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/resources/test_resource_manager.py +0 -0
  199. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/resources/test_resource_template.py +0 -0
  200. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/resources/test_resources.py +0 -0
  201. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/http/test_custom_routes.py +0 -0
  202. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/http/test_http_middleware.py +0 -0
  203. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/openapi/test_openapi_path_parameters.py +0 -0
  204. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/openapi/test_route_map_fn.py +0 -0
  205. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_app_state.py +0 -0
  206. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_context.py +0 -0
  207. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_file_server.py +0 -0
  208. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_resource_prefix_formats.py +0 -0
  209. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_run_server.py +0 -0
  210. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/test_servers/fastmcp_server.py +0 -0
  211. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/test_servers/sse.py +0 -0
  212. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/test_servers/stdio.py +0 -0
  213. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/__init__.py +0 -0
  214. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/openapi/__init__.py +0 -0
  215. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/openapi/conftest.py +0 -0
  216. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/openapi/test_openapi.py +0 -0
  217. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/openapi/test_openapi_advanced.py +0 -0
  218. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/openapi/test_openapi_fastapi.py +0 -0
  219. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_cache.py +0 -0
  220. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_decorated_function.py +0 -0
  221. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_json_schema.py +0 -0
  222. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_logging.py +0 -0
  223. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_tests.py +0 -0
  224. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_typeadapter.py +0 -0
  225. {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastmcp
3
- Version: 2.5.2
3
+ Version: 2.6.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
@@ -17,9 +17,10 @@ Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
18
  Classifier: Typing :: Typed
19
19
  Requires-Python: >=3.10
20
+ Requires-Dist: authlib>=1.5.2
20
21
  Requires-Dist: exceptiongroup>=1.2.2
21
22
  Requires-Dist: httpx>=0.28.1
22
- Requires-Dist: mcp<2.0.0,>=1.9.0
23
+ Requires-Dist: mcp<2.0.0,>=1.9.2
23
24
  Requires-Dist: openapi-pydantic>=0.5.1
24
25
  Requires-Dist: python-dotenv>=1.1.0
25
26
  Requires-Dist: rich>=13.9.4
@@ -41,14 +42,14 @@ Description-Content-Type: text/markdown
41
42
  <a href="https://trendshift.io/repositories/13266" target="_blank"><img src="https://trendshift.io/api/badge/repositories/13266" alt="jlowin%2Ffastmcp | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
42
43
  </div>
43
44
 
44
- > [!NOTE]
45
- > #### FastMCP 2.0 & The Official MCP SDK
45
+ > [!Note]
46
+ > #### Beyond the Protocol
47
+ >
48
+ > 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.
46
49
  >
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).
50
+ > 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.
48
51
  >
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
- >
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
+ > Ready to upgrade or get started? Follow the [installation instructions](/getting-started/installation), which include specific steps for upgrading from the official MCP SDK.
52
53
 
53
54
  ---
54
55
 
@@ -103,6 +104,7 @@ There are two ways to access the LLM-friendly documentation:
103
104
  - [Proxy Servers](#proxy-servers)
104
105
  - [Composing MCP Servers](#composing-mcp-servers)
105
106
  - [OpenAPI \& FastAPI Generation](#openapi--fastapi-generation)
107
+ - [Authentication \& Security](#authentication--security)
106
108
  - [Running Your Server](#running-your-server)
107
109
  - [Contributing](#contributing)
108
110
  - [Prerequisites](#prerequisites)
@@ -115,20 +117,20 @@ There are two ways to access the LLM-friendly documentation:
115
117
 
116
118
  ## What is MCP?
117
119
 
118
- 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:
120
+ 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:
119
121
 
120
- - Expose data through **Resources** (similar to `GET` requests; load info into context)
121
- - Provide functionality through **Tools** (similar to `POST`/`PUT` requests; execute actions)
122
- - Define interaction patterns through **Prompts** (reusable templates)
122
+ - Expose data through **Resources** (think of these sort of like GET endpoints; they are used to load information into the LLM's context)
123
+ - Provide functionality through **Tools** (sort of like POST endpoints; they are used to execute code or otherwise produce a side effect)
124
+ - Define interaction patterns through **Prompts** (reusable templates for LLM interactions)
123
125
  - And more!
124
126
 
125
- FastMCP provides a high-level, Pythonic interface for building and interacting with these servers.
127
+ FastMCP provides a high-level, Pythonic interface for building, managing, and interacting with these servers.
126
128
 
127
129
  ## Why FastMCP?
128
130
 
129
131
  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.
130
132
 
131
- 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.
133
+ 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.
132
134
 
133
135
  FastMCP aims to be:
134
136
 
@@ -138,7 +140,7 @@ FastMCP aims to be:
138
140
 
139
141
  🐍 **Pythonic:** Feels natural to Python developers
140
142
 
141
- 🔍 **Complete:** FastMCP aims to provide a full implementation of the core MCP specification for both servers and clients
143
+ 🔍 **Complete:** A comprehensive platform for all MCP use cases, from dev to prod
142
144
 
143
145
  ## Installation
144
146
 
@@ -156,7 +158,7 @@ These are the building blocks for creating MCP servers and clients with FastMCP.
156
158
 
157
159
  ### The `FastMCP` Server
158
160
 
159
- 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).
161
+ The central object representing your MCP application. It holds your tools, resources, and prompts, manages connections, and can be configured with settings like authentication.
160
162
 
161
163
  ```python
162
164
  from fastmcp import FastMCP
@@ -329,6 +331,16 @@ Automatically generate FastMCP servers from existing OpenAPI specifications (`Fa
329
331
 
330
332
  Learn more: [**OpenAPI Integration**](https://gofastmcp.com/patterns/openapi) | [**FastAPI Integration**](https://gofastmcp.com/patterns/fastapi).
331
333
 
334
+ ### Authentication & Security
335
+
336
+ 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.
337
+
338
+ - **Server Protection**: Secure your FastMCP server endpoints with configurable authentication providers
339
+ - **Client Authentication**: Connect to authenticated MCP servers with automatic credential management
340
+ - **Production Ready**: Support for common authentication patterns used in enterprise environments
341
+
342
+ Learn more in the **Authentication Documentation** for [servers](https://gofastmcp.com/servers/auth) and [clients](https://gofastmcp.com/clients/auth).
343
+
332
344
  ## Running Your Server
333
345
 
334
346
  The main way to run a FastMCP server is by calling the `run()` method on your server instance:
@@ -12,14 +12,14 @@
12
12
  <a href="https://trendshift.io/repositories/13266" target="_blank"><img src="https://trendshift.io/api/badge/repositories/13266" alt="jlowin%2Ffastmcp | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
13
13
  </div>
14
14
 
15
- > [!NOTE]
16
- > #### FastMCP 2.0 & The Official MCP SDK
15
+ > [!Note]
16
+ > #### Beyond the Protocol
17
+ >
18
+ > 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.
17
19
  >
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).
20
+ > 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.
19
21
  >
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
- >
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.
22
+ > Ready to upgrade or get started? Follow the [installation instructions](/getting-started/installation), which include specific steps for upgrading from the official MCP SDK.
23
23
 
24
24
  ---
25
25
 
@@ -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
@@ -300,6 +301,16 @@ Automatically generate FastMCP servers from existing OpenAPI specifications (`Fa
300
301
 
301
302
  Learn more: [**OpenAPI Integration**](https://gofastmcp.com/patterns/openapi) | [**FastAPI Integration**](https://gofastmcp.com/patterns/fastapi).
302
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).
313
+
303
314
  ## Running Your Server
304
315
 
305
316
  The main way to run a FastMCP server is by calling the `run()` method on your server instance:
Binary file
Binary file
@@ -0,0 +1,85 @@
1
+ ---
2
+ title: Bearer Token Authentication
3
+ sidebarTitle: Bearer Auth
4
+ description: Authenticate your FastMCP client with a Bearer token.
5
+ icon: key
6
+ ---
7
+
8
+ import { VersionBadge } from "/snippets/version-badge.mdx"
9
+
10
+ <VersionBadge version="2.6.0" />
11
+
12
+ <Tip>
13
+ Bearer Token authentication is only relevant for HTTP-based transports.
14
+ </Tip>
15
+
16
+ You can configure your FastMCP client to use **bearer authentication** by supplying a valid access token. This is most appropriate for service accounts, long-lived API keys, CI/CD, applications where authentication is managed separately, or other non-interactive authentication methods.
17
+
18
+ A Bearer token is a JSON Web Token (JWT) that is used to authenticate a request. It is most commonly used in the `Authorization` header of an HTTP request, using the `Bearer` scheme:
19
+
20
+ ```http
21
+ Authorization: Bearer <token>
22
+ ```
23
+
24
+
25
+ ## Client Usage
26
+
27
+ The most straightforward way to use a pre-existing Bearer token is to provide it as a string to the `auth` parameter of the `fastmcp.Client` or transport instance. FastMCP will automatically format it correctly for the `Authorization` header and bearer scheme.
28
+
29
+ <Tip>
30
+ If you're using a string token, do not include the `Bearer` prefix. FastMCP will add it for you.
31
+ </Tip>
32
+
33
+ ```python {5}
34
+ from fastmcp import Client
35
+
36
+ async with Client(
37
+ "https://fastmcp.cloud/mcp",
38
+ auth="<your-token>",
39
+ ) as client:
40
+ await client.ping()
41
+ ```
42
+
43
+ You can also supply a Bearer token to a transport instance, such as `StreamableHttpTransport` or `SSETransport`:
44
+
45
+ ```python {6}
46
+ from fastmcp import Client
47
+ from fastmcp.client.transports import StreamableHttpTransport
48
+
49
+ transport = StreamableHttpTransport(
50
+ "http://fastmcp.cloud/mcp",
51
+ auth="<your-token>",
52
+ )
53
+
54
+ async with Client(transport) as client:
55
+ await client.ping()
56
+ ```
57
+
58
+ ## `BearerAuth` Helper
59
+
60
+ If you prefer to be more explicit and not rely on FastMCP to transform your string token, you can use the `BearerAuth` class yourself, which implements the `httpx.Auth` interface.
61
+
62
+ ```python {6}
63
+ from fastmcp import Client
64
+ from fastmcp.client.auth import BearerAuth
65
+
66
+ async with Client(
67
+ "https://fastmcp.cloud/mcp",
68
+ auth=BearerAuth(token="<your-token>"),
69
+ ) as client:
70
+ await client.ping()
71
+ ```
72
+
73
+ ## Custom Headers
74
+
75
+ If the MCP server expects a custom header or token scheme, you can manually set the client's `headers` instead of using the `auth` parameter:
76
+
77
+ ```python {5}
78
+ from fastmcp import Client
79
+
80
+ async with Client(
81
+ "https://fastmcp.cloud/mcp",
82
+ headers={"X-API-Key": "<your-token>"},
83
+ ) as client:
84
+ await client.ping()
85
+ ```
@@ -0,0 +1,116 @@
1
+ ---
2
+ title: OAuth Authentication
3
+ sidebarTitle: OAuth
4
+ description: Authenticate your FastMCP client via OAuth 2.1.
5
+ icon: window
6
+ ---
7
+
8
+ import { VersionBadge } from "/snippets/version-badge.mdx"
9
+
10
+ <VersionBadge version="2.6.0" />
11
+
12
+ <Tip>
13
+ OAuth authentication is only relevant for HTTP-based transports and requires user interaction via a web browser.
14
+ </Tip>
15
+
16
+ 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
+ This flow is common for user-facing applications where the application acts on behalf of the user.
19
+
20
+ ## Client Usage
21
+
22
+
23
+ ### Default Configuration
24
+
25
+ The simplest way to use OAuth is to pass the string `"oauth"` to the `auth` parameter of the `Client` or transport instance. FastMCP will automatically configure the client to use OAuth with default settings:
26
+
27
+ ```python {4}
28
+ from fastmcp import Client
29
+
30
+ # Uses default OAuth settings
31
+ async with Client("https://fastmcp.cloud/mcp", auth="oauth") as client:
32
+ await client.ping()
33
+ ```
34
+
35
+
36
+ ### `OAuth` Helper
37
+
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.1 Authorization Code Grant with PKCE (Proof Key for Code Exchange) for enhanced security, and implements the full `httpx.Auth` interface.
39
+
40
+ ```python {2, 4, 6}
41
+ from fastmcp import Client
42
+ from fastmcp.client.auth import OAuth
43
+
44
+ oauth = OAuth(mcp_url="https://fastmcp.cloud/mcp")
45
+
46
+ async with Client("https://fastmcp.cloud/mcp", auth=oauth) as client:
47
+ await client.ping()
48
+ ```
49
+
50
+ #### `OAuth` Parameters
51
+
52
+ - **`mcp_url`** (`str`): The full URL of the target MCP server endpoint. Used to discover OAuth server metadata
53
+ - **`scopes`** (`str | list[str]`, optional): OAuth scopes to request. Can be space-separated string or list of strings
54
+ - **`client_name`** (`str`, optional): Client name for dynamic registration. Defaults to `"FastMCP Client"`
55
+ - **`token_storage_cache_dir`** (`Path`, optional): Token cache directory. Defaults to `~/.fastmcp/oauth-mcp-client-cache/`
56
+ - **`additional_client_metadata`** (`dict[str, Any]`, optional): Extra metadata for client registration
57
+
58
+
59
+ ## OAuth Flow
60
+
61
+ The OAuth flow is triggered when you use a FastMCP `Client` configured to use OAuth.
62
+
63
+ <Steps>
64
+ <Step title="Token Check">
65
+ The client first checks the `token_storage_cache_dir` for existing, valid tokens for the target server. If one is found, it will be used to authenticate the client.
66
+ </Step>
67
+ <Step title="OAuth Server Discovery">
68
+ If no valid tokens exist, the client attempts to discover the OAuth server's endpoints using a well-known URI (e.g., `/.well-known/oauth-authorization-server`) based on the `mcp_url`.
69
+ </Step>
70
+ <Step title="Dynamic Client Registration">
71
+ If the OAuth server supports it and the client isn't already registered (or credentials aren't cached), the client performs dynamic client registration according to RFC 7591.
72
+ </Step>
73
+ <Step title="Local Callback Server">
74
+ A temporary local HTTP server is started on an available port. This server's address (e.g., `http://127.0.0.1:<port>/callback`) acts as the `redirect_uri` for the OAuth flow.
75
+ </Step>
76
+ <Step title="Browser Interaction">
77
+ The user's default web browser is automatically opened, directing them to the OAuth server's authorization endpoint. The user logs in and grants (or denies) the requested `scopes`.
78
+ </Step>
79
+ <Step title="Authorization Code & Token Exchange">
80
+ Upon approval, the OAuth server redirects the user's browser to the local callback server with an `authorization_code`. The client captures this code and exchanges it with the OAuth server's token endpoint for an `access_token` (and often a `refresh_token`) using PKCE for security.
81
+ </Step>
82
+ <Step title="Token Caching">
83
+ The obtained tokens are saved to the `token_storage_cache_dir` for future use, eliminating the need for repeated browser interactions.
84
+ </Step>
85
+ <Step title="Authenticated Requests">
86
+ The access token is automatically included in the `Authorization` header for requests to the MCP server.
87
+ </Step>
88
+ <Step title="Refresh Token">
89
+ If the access token expires, the client will automatically use the refresh token to get a new access token.
90
+ </Step>
91
+ </Steps>
92
+
93
+ ## Token Management
94
+
95
+ ### Token Storage
96
+
97
+ OAuth access tokens are automatically cached in `~/.fastmcp/oauth-mcp-client-cache/` and persist between application runs. Files are keyed by the OAuth server's base URL.
98
+
99
+ ### Managing Cache
100
+
101
+ To clear the tokens for a specific server, instantiate a `FileTokenStorage` instance and call the `clear` method:
102
+
103
+ ```python
104
+ from fastmcp.client.auth import FileTokenStorage
105
+
106
+ storage = FileTokenStorage(server_url="https://fastmcp.cloud/mcp")
107
+ await storage.clear()
108
+ ```
109
+
110
+ To clear *all* tokens for all servers, call the `clear_all` method on the `FileTokenStorage` class:
111
+
112
+ ```python
113
+ from fastmcp.client.auth import FileTokenStorage
114
+
115
+ FileTokenStorage.clear_all()
116
+ ```
@@ -345,7 +345,7 @@ For consistent behavior across all transports, we recommend explicitly setting t
345
345
 
346
346
  #### Error Handling
347
347
 
348
- When a `call_tool` request results in an error on the server (e.g., the tool function raised an exception), the `client.call_tool()` method will raise a `fastmcp.client.ClientError`.
348
+ When a `call_tool` request results in an error on the server (e.g., the tool function raised an exception), the `client.call_tool()` method will raise a `fastmcp.exceptions.ClientError`.
349
349
 
350
350
  ```python
351
351
  async def safe_call_tool():
@@ -59,7 +59,7 @@ 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
63
 
64
64
  ## Transport Options
65
65
 
@@ -270,4 +270,4 @@ async def health_check(request: Request) -> PlainTextResponse:
270
270
 
271
271
  if __name__ == "__main__":
272
272
  mcp.run()
273
- ```
273
+ ```
@@ -1,5 +1,9 @@
1
1
  {
2
2
  "$schema": "https://mintlify.com/docs.json",
3
+ "appearance": {
4
+ "default": "system",
5
+ "strict": false
6
+ },
3
7
  "background": {
4
8
  "color": {
5
9
  "dark": "#222831",
@@ -13,6 +17,10 @@
13
17
  "primary": "#2d00f7"
14
18
  },
15
19
  "description": "The fast, Pythonic way to build MCP servers and clients.",
20
+ "favicon": {
21
+ "dark": "/assets/favicon.ico",
22
+ "light": "/assets/favicon.ico"
23
+ },
16
24
  "footer": {
17
25
  "socials": {
18
26
  "bluesky": "https://bsky.app/profile/jlowin.dev",
@@ -46,22 +54,34 @@
46
54
  "group": "Servers",
47
55
  "pages": [
48
56
  "servers/fastmcp",
49
- "servers/tools",
50
- "servers/resources",
51
- "servers/prompts",
52
- "servers/context",
57
+ {
58
+ "group": "Core Components",
59
+ "icon": "toolbox",
60
+ "pages": [
61
+ "servers/tools",
62
+ "servers/resources",
63
+ "servers/prompts",
64
+ "servers/context"
65
+ ]
66
+ },
67
+ {
68
+ "group": "Authentication",
69
+ "icon": "shield-check",
70
+ "pages": [
71
+ "servers/auth/bearer"
72
+ ]
73
+ },
53
74
  "servers/openapi",
54
75
  "servers/proxy",
55
- "servers/composition"
56
- ]
57
- },
58
- {
59
- "group": "Deployment",
60
- "pages": [
61
- "deployment/running-server",
62
- "deployment/asgi",
63
- "deployment/authentication",
64
- "deployment/cli"
76
+ "servers/composition",
77
+ {
78
+ "group": "Deployment",
79
+ "icon": "upload",
80
+ "pages": [
81
+ "deployment/running-server",
82
+ "deployment/asgi"
83
+ ]
84
+ }
65
85
  ]
66
86
  },
67
87
  {
@@ -69,21 +89,35 @@
69
89
  "pages": [
70
90
  "clients/client",
71
91
  "clients/transports",
92
+ {
93
+ "group": "Authentication",
94
+ "icon": "user-shield",
95
+ "pages": [
96
+ "clients/auth/oauth",
97
+ "clients/auth/bearer"
98
+ ]
99
+ },
72
100
  "clients/advanced-features"
73
101
  ]
74
102
  },
103
+ {
104
+ "group": "Integrations",
105
+ "pages": [
106
+ "integrations/anthropic",
107
+ "integrations/claude-desktop",
108
+ "integrations/openai",
109
+ "integrations/gemini",
110
+ "integrations/contrib"
111
+ ]
112
+ },
75
113
  {
76
114
  "group": "Patterns",
77
115
  "pages": [
78
116
  "patterns/decorating-methods",
79
117
  "patterns/http-requests",
80
- "patterns/contrib",
81
- "patterns/testing"
118
+ "patterns/testing",
119
+ "patterns/cli"
82
120
  ]
83
- },
84
- {
85
- "group": "Deployment",
86
- "pages": []
87
121
  }
88
122
  ]
89
123
  },
@@ -97,5 +131,8 @@
97
131
  "source": "/patterns/composition"
98
132
  }
99
133
  ],
134
+ "search": {
135
+ "prompt": "Search the docs..."
136
+ },
100
137
  "theme": "mint"
101
138
  }
@@ -9,7 +9,7 @@ icon: hand-wave
9
9
 
10
10
  The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) is a new, standardized way to provide context and tools to your LLMs, and FastMCP makes building MCP servers and clients simple and intuitive. Create tools, expose resources, define prompts, and more with clean, Pythonic code:
11
11
 
12
- ```python {1, 3, 5, 11}
12
+ ```python {1}
13
13
  from fastmcp import FastMCP
14
14
 
15
15
  mcp = FastMCP("Demo 🚀")
@@ -24,16 +24,17 @@ if __name__ == "__main__":
24
24
  ```
25
25
 
26
26
 
27
- ## FastMCP and the Official MCP SDK
27
+ ## Beyond the Protocol
28
28
 
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).
29
+ 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.
30
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.
31
+ 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.
32
32
 
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.
33
+ Ready to upgrade or get started? Follow the [installation instructions](/getting-started/installation), which include specific steps for upgrading from the official MCP SDK.
34
34
 
35
35
 
36
36
  ## What is MCP?
37
+
37
38
  The Model Context Protocol 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:
38
39
 
39
40
  - Expose data through `Resources` (think of these sort of like GET endpoints; they are used to load information into the LLM's context)
@@ -41,14 +42,13 @@ The Model Context Protocol lets you build servers that expose data and functiona
41
42
  - Define interaction patterns through `Prompts` (reusable templates for LLM interactions)
42
43
  - And more!
43
44
 
44
- 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.
45
-
45
+ FastMCP provides a high-level, Pythonic interface for building, managing, and interacting with these servers.
46
46
 
47
47
  ## Why FastMCP?
48
48
 
49
49
  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.
50
50
 
51
- 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, and much more.
51
+ 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.
52
52
 
53
53
  FastMCP aims to be:
54
54
 
@@ -58,7 +58,7 @@ FastMCP aims to be:
58
58
 
59
59
  🐍 **Pythonic**: Feels natural to Python developers
60
60
 
61
- 🔍 **Complete**: FastMCP aims to provide a full implementation of the core MCP specification
61
+ 🔍 **Complete**: A comprehensive platform for all MCP use cases, from dev to prod
62
62
 
63
63
 
64
64
  ## `llms.txt`