fastmcp 2.5.2__tar.gz → 2.6.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 (224) hide show
  1. {fastmcp-2.5.2 → fastmcp-2.6.0}/PKG-INFO +9 -8
  2. {fastmcp-2.5.2 → fastmcp-2.6.0}/README.md +6 -6
  3. fastmcp-2.6.0/docs/assets/favicon.ico +0 -0
  4. fastmcp-2.6.0/docs/assets/logo.png +0 -0
  5. fastmcp-2.6.0/docs/clients/auth/bearer.mdx +85 -0
  6. fastmcp-2.6.0/docs/clients/auth/oauth.mdx +116 -0
  7. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/clients/client.mdx +1 -1
  8. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/docs.json +56 -20
  9. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/getting-started/welcome.mdx +8 -7
  10. fastmcp-2.6.0/docs/integrations/anthropic.mdx +225 -0
  11. fastmcp-2.6.0/docs/integrations/claude-desktop.mdx +221 -0
  12. fastmcp-2.6.0/docs/integrations/openai.mdx +222 -0
  13. {fastmcp-2.5.2/docs/deployment → fastmcp-2.6.0/docs/patterns}/cli.mdx +15 -12
  14. fastmcp-2.6.0/docs/servers/auth/bearer.mdx +183 -0
  15. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/servers/fastmcp.mdx +1 -0
  16. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/servers/tools.mdx +20 -1
  17. {fastmcp-2.5.2 → fastmcp-2.6.0}/pyproject.toml +4 -1
  18. fastmcp-2.6.0/server.py +26 -0
  19. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/client/__init__.py +3 -0
  20. fastmcp-2.6.0/src/fastmcp/client/auth/__init__.py +4 -0
  21. fastmcp-2.6.0/src/fastmcp/client/auth/bearer.py +17 -0
  22. fastmcp-2.6.0/src/fastmcp/client/auth/oauth.py +394 -0
  23. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/client/client.py +74 -26
  24. fastmcp-2.6.0/src/fastmcp/client/oauth_callback.py +310 -0
  25. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/client/transports.py +76 -14
  26. fastmcp-2.6.0/src/fastmcp/server/auth/__init__.py +4 -0
  27. fastmcp-2.6.0/src/fastmcp/server/auth/auth.py +45 -0
  28. fastmcp-2.6.0/src/fastmcp/server/auth/providers/bearer.py +377 -0
  29. fastmcp-2.6.0/src/fastmcp/server/auth/providers/bearer_env.py +62 -0
  30. fastmcp-2.6.0/src/fastmcp/server/auth/providers/in_memory.py +330 -0
  31. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/server/dependencies.py +10 -0
  32. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/server/http.py +38 -66
  33. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/server/openapi.py +2 -0
  34. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/server/server.py +21 -16
  35. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/settings.py +27 -8
  36. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/tools/tool.py +22 -3
  37. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/tools/tool_manager.py +2 -0
  38. fastmcp-2.6.0/src/fastmcp/utilities/http.py +8 -0
  39. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/utilities/tests.py +22 -10
  40. fastmcp-2.6.0/tests/auth/providers/test_bearer.py +635 -0
  41. fastmcp-2.6.0/tests/auth/providers/test_bearer_env.py +82 -0
  42. fastmcp-2.6.0/tests/auth/test_oauth_client.py +265 -0
  43. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/client/test_client.py +54 -14
  44. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/client/test_openapi.py +26 -79
  45. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/client/test_roots.py +1 -3
  46. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/client/test_sse.py +12 -28
  47. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/client/test_stdio.py +9 -19
  48. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/client/test_streamable_http.py +23 -45
  49. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/prompts/test_prompt_manager.py +2 -4
  50. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/resources/test_file_resources.py +0 -1
  51. fastmcp-2.6.0/tests/server/http/__init__.py +0 -0
  52. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/http/test_http_dependencies.py +10 -53
  53. fastmcp-2.6.0/tests/server/openapi/__init__.py +0 -0
  54. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/openapi/test_openapi.py +16 -38
  55. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/test_import_server.py +6 -14
  56. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/test_logging.py +4 -3
  57. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/test_mount.py +12 -26
  58. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/test_proxy.py +31 -17
  59. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/test_server.py +56 -78
  60. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/test_server_interactions.py +59 -111
  61. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/test_tool_annotations.py +3 -4
  62. fastmcp-2.6.0/tests/server/test_tool_exclude_args.py +92 -0
  63. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/test_examples.py +8 -26
  64. fastmcp-2.6.0/tests/tools/__init__.py +0 -0
  65. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/tools/test_tool.py +14 -32
  66. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/tools/test_tool_manager.py +21 -90
  67. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/test_mcp_config.py +2 -6
  68. {fastmcp-2.5.2 → fastmcp-2.6.0}/uv.lock +342 -136
  69. fastmcp-2.5.2/docs/deployment/authentication.mdx +0 -15
  70. fastmcp-2.5.2/docs/patterns/fastapi.mdx +0 -47
  71. fastmcp-2.5.2/src/fastmcp/low_level/README.md +0 -1
  72. fastmcp-2.5.2/tests/client/__init__.py +0 -1
  73. fastmcp-2.5.2/tests/server/test_lifespan.py +0 -396
  74. {fastmcp-2.5.2 → fastmcp-2.6.0}/.cursor/rules/core-mcp-objects.mdc +0 -0
  75. {fastmcp-2.5.2 → fastmcp-2.6.0}/.github/ISSUE_TEMPLATE/bug.yml +0 -0
  76. {fastmcp-2.5.2 → fastmcp-2.6.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  77. {fastmcp-2.5.2 → fastmcp-2.6.0}/.github/ISSUE_TEMPLATE/enhancement.yml +0 -0
  78. {fastmcp-2.5.2 → fastmcp-2.6.0}/.github/labeler.yml +0 -0
  79. {fastmcp-2.5.2 → fastmcp-2.6.0}/.github/release.yml +0 -0
  80. {fastmcp-2.5.2 → fastmcp-2.6.0}/.github/workflows/labeler.yml +0 -0
  81. {fastmcp-2.5.2 → fastmcp-2.6.0}/.github/workflows/publish.yml +0 -0
  82. {fastmcp-2.5.2 → fastmcp-2.6.0}/.github/workflows/run-static.yml +0 -0
  83. {fastmcp-2.5.2 → fastmcp-2.6.0}/.github/workflows/run-tests.yml +0 -0
  84. {fastmcp-2.5.2 → fastmcp-2.6.0}/.gitignore +0 -0
  85. {fastmcp-2.5.2 → fastmcp-2.6.0}/.pre-commit-config.yaml +0 -0
  86. {fastmcp-2.5.2 → fastmcp-2.6.0}/AGENTS.md +0 -0
  87. {fastmcp-2.5.2 → fastmcp-2.6.0}/LICENSE +0 -0
  88. {fastmcp-2.5.2 → fastmcp-2.6.0}/Windows_Notes.md +0 -0
  89. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/assets/demo-inspector.png +0 -0
  90. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/clients/advanced-features.mdx +0 -0
  91. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/clients/transports.mdx +0 -0
  92. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/deployment/asgi.mdx +0 -0
  93. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/deployment/running-server.mdx +0 -0
  94. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/getting-started/installation.mdx +0 -0
  95. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/getting-started/quickstart.mdx +0 -0
  96. {fastmcp-2.5.2/docs/patterns → fastmcp-2.6.0/docs/integrations}/contrib.mdx +0 -0
  97. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/patterns/decorating-methods.mdx +0 -0
  98. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/patterns/http-requests.mdx +0 -0
  99. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/patterns/testing.mdx +0 -0
  100. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/servers/composition.mdx +0 -0
  101. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/servers/context.mdx +0 -0
  102. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/servers/openapi.mdx +0 -0
  103. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/servers/prompts.mdx +0 -0
  104. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/servers/proxy.mdx +0 -0
  105. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/servers/resources.mdx +0 -0
  106. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/snippets/version-badge.mdx +0 -0
  107. {fastmcp-2.5.2 → fastmcp-2.6.0}/docs/style.css +0 -0
  108. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/complex_inputs.py +0 -0
  109. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/desktop.py +0 -0
  110. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/echo.py +0 -0
  111. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/in_memory_proxy_example.py +0 -0
  112. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/memory.py +0 -0
  113. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/mount_example.py +0 -0
  114. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/sampling.py +0 -0
  115. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/screenshot.py +0 -0
  116. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/serializer.py +0 -0
  117. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/simple_echo.py +0 -0
  118. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/smart_home/README.md +0 -0
  119. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/smart_home/pyproject.toml +0 -0
  120. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/smart_home/src/smart_home/__init__.py +0 -0
  121. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/smart_home/src/smart_home/__main__.py +0 -0
  122. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/smart_home/src/smart_home/hub.py +0 -0
  123. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/smart_home/src/smart_home/lights/__init__.py +0 -0
  124. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/smart_home/src/smart_home/lights/hue_utils.py +0 -0
  125. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/smart_home/src/smart_home/lights/server.py +0 -0
  126. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/smart_home/src/smart_home/py.typed +0 -0
  127. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/smart_home/src/smart_home/settings.py +0 -0
  128. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/smart_home/uv.lock +0 -0
  129. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/tags_example.py +0 -0
  130. {fastmcp-2.5.2 → fastmcp-2.6.0}/examples/text_me.py +0 -0
  131. {fastmcp-2.5.2 → fastmcp-2.6.0}/justfile +0 -0
  132. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/__init__.py +0 -0
  133. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/cli/__init__.py +0 -0
  134. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/cli/claude.py +0 -0
  135. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/cli/cli.py +0 -0
  136. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/cli/run.py +0 -0
  137. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/client/logging.py +0 -0
  138. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/client/progress.py +0 -0
  139. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/client/roots.py +0 -0
  140. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/client/sampling.py +0 -0
  141. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/contrib/README.md +0 -0
  142. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/contrib/bulk_tool_caller/README.md +0 -0
  143. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/contrib/bulk_tool_caller/__init__.py +0 -0
  144. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/contrib/bulk_tool_caller/bulk_tool_caller.py +0 -0
  145. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/contrib/bulk_tool_caller/example.py +0 -0
  146. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/contrib/mcp_mixin/README.md +0 -0
  147. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/contrib/mcp_mixin/__init__.py +0 -0
  148. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/contrib/mcp_mixin/example.py +0 -0
  149. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/contrib/mcp_mixin/mcp_mixin.py +0 -0
  150. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/exceptions.py +0 -0
  151. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/prompts/__init__.py +0 -0
  152. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/prompts/prompt.py +0 -0
  153. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/prompts/prompt_manager.py +0 -0
  154. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/resources/__init__.py +0 -0
  155. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/resources/resource.py +0 -0
  156. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/resources/resource_manager.py +0 -0
  157. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/resources/template.py +0 -0
  158. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/resources/types.py +0 -0
  159. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/server/__init__.py +0 -0
  160. {fastmcp-2.5.2/src/fastmcp/low_level → fastmcp-2.6.0/src/fastmcp/server/auth/providers}/__init__.py +0 -0
  161. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/server/context.py +0 -0
  162. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/server/proxy.py +0 -0
  163. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/tools/__init__.py +0 -0
  164. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/utilities/__init__.py +0 -0
  165. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/utilities/cache.py +0 -0
  166. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/utilities/decorators.py +0 -0
  167. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/utilities/exceptions.py +0 -0
  168. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/utilities/json_schema.py +0 -0
  169. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/utilities/logging.py +0 -0
  170. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/utilities/mcp_config.py +0 -0
  171. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/utilities/openapi.py +0 -0
  172. {fastmcp-2.5.2 → fastmcp-2.6.0}/src/fastmcp/utilities/types.py +0 -0
  173. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/__init__.py +0 -0
  174. {fastmcp-2.5.2/tests/deprecated → fastmcp-2.6.0/tests/auth}/__init__.py +0 -0
  175. {fastmcp-2.5.2/tests/prompts → fastmcp-2.6.0/tests/cli}/__init__.py +0 -0
  176. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/cli/test_cli.py +0 -0
  177. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/cli/test_run.py +0 -0
  178. {fastmcp-2.5.2/tests/resources → fastmcp-2.6.0/tests/client}/__init__.py +0 -0
  179. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/client/test_logs.py +0 -0
  180. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/client/test_progress.py +0 -0
  181. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/client/test_sampling.py +0 -0
  182. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/conftest.py +0 -0
  183. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/contrib/__init__.py +0 -0
  184. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/contrib/test_bulk_tool_caller.py +0 -0
  185. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/contrib/test_mcp_mixin.py +0 -0
  186. {fastmcp-2.5.2/tests/server → fastmcp-2.6.0/tests/deprecated}/__init__.py +0 -0
  187. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/deprecated/test_deprecated.py +0 -0
  188. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/deprecated/test_mount_separators.py +0 -0
  189. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/deprecated/test_resource_prefixes.py +0 -0
  190. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/deprecated/test_route_type_ignore.py +0 -0
  191. {fastmcp-2.5.2/tests/tools → fastmcp-2.6.0/tests/prompts}/__init__.py +0 -0
  192. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/prompts/test_prompt.py +0 -0
  193. /fastmcp-2.5.2/src/fastmcp/client/base.py → /fastmcp-2.6.0/tests/resources/__init__.py +0 -0
  194. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/resources/test_function_resources.py +0 -0
  195. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/resources/test_resource_manager.py +0 -0
  196. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/resources/test_resource_template.py +0 -0
  197. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/resources/test_resources.py +0 -0
  198. /fastmcp-2.5.2/src/fastmcp/py.typed → /fastmcp-2.6.0/tests/server/__init__.py +0 -0
  199. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/http/test_custom_routes.py +0 -0
  200. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/http/test_http_middleware.py +0 -0
  201. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/openapi/test_openapi_path_parameters.py +0 -0
  202. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/openapi/test_route_map_fn.py +0 -0
  203. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/test_app_state.py +0 -0
  204. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/test_auth_integration.py +0 -0
  205. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/test_context.py +0 -0
  206. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/test_file_server.py +0 -0
  207. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/test_resource_prefix_formats.py +0 -0
  208. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/server/test_run_server.py +0 -0
  209. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/test_servers/fastmcp_server.py +0 -0
  210. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/test_servers/sse.py +0 -0
  211. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/test_servers/stdio.py +0 -0
  212. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/__init__.py +0 -0
  213. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/openapi/__init__.py +0 -0
  214. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/openapi/conftest.py +0 -0
  215. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/openapi/test_openapi.py +0 -0
  216. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/openapi/test_openapi_advanced.py +0 -0
  217. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/openapi/test_openapi_fastapi.py +0 -0
  218. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/test_cache.py +0 -0
  219. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/test_decorated_function.py +0 -0
  220. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/test_json_schema.py +0 -0
  221. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/test_logging.py +0 -0
  222. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/test_tests.py +0 -0
  223. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/test_typeadapter.py +0 -0
  224. {fastmcp-2.5.2 → fastmcp-2.6.0}/tests/utilities/test_types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastmcp
3
- Version: 2.5.2
3
+ Version: 2.6.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
@@ -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
 
@@ -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
 
Binary file
Binary file
@@ -0,0 +1,85 @@
1
+ ---
2
+ title: Bearer Token Authentication
3
+ sidebarTitle: Bearer Auth
4
+ description: Authenticate your FastMCP client using pre-existing OAuth 2.0 Bearer tokens.
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 with servers using the OAuth 2.0 Authorization Code Grant, including user interaction via a web browser.
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.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
+
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.0 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():
@@ -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,34 @@
69
89
  "pages": [
70
90
  "clients/client",
71
91
  "clients/transports",
92
+ {
93
+ "group": "Authentication",
94
+ "icon": "user-shield",
95
+ "pages": [
96
+ "clients/auth/bearer",
97
+ "clients/auth/oauth"
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/contrib"
110
+ ]
111
+ },
75
112
  {
76
113
  "group": "Patterns",
77
114
  "pages": [
78
115
  "patterns/decorating-methods",
79
116
  "patterns/http-requests",
80
- "patterns/contrib",
81
- "patterns/testing"
117
+ "patterns/testing",
118
+ "patterns/cli"
82
119
  ]
83
- },
84
- {
85
- "group": "Deployment",
86
- "pages": []
87
120
  }
88
121
  ]
89
122
  },
@@ -97,5 +130,8 @@
97
130
  "source": "/patterns/composition"
98
131
  }
99
132
  ],
133
+ "search": {
134
+ "prompt": "Search the docs..."
135
+ },
100
136
  "theme": "mint"
101
137
  }
@@ -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)
@@ -48,7 +49,7 @@ There is a low-level Python SDK available for implementing the protocol directly
48
49
 
49
50
  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
51
 
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.
52
+ 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
53
 
53
54
  FastMCP aims to be:
54
55
 
@@ -58,7 +59,7 @@ FastMCP aims to be:
58
59
 
59
60
  🐍 **Pythonic**: Feels natural to Python developers
60
61
 
61
- 🔍 **Complete**: FastMCP aims to provide a full implementation of the core MCP specification
62
+ 🔍 **Complete**: A comprehensive platform for all MCP use cases, from dev to prod
62
63
 
63
64
 
64
65
  ## `llms.txt`