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.
- {fastmcp-2.5.2 → fastmcp-2.6.1}/PKG-INFO +28 -16
- {fastmcp-2.5.2 → fastmcp-2.6.1}/README.md +25 -14
- fastmcp-2.6.1/docs/assets/favicon.ico +0 -0
- fastmcp-2.6.1/docs/assets/logo.png +0 -0
- fastmcp-2.6.1/docs/clients/auth/bearer.mdx +85 -0
- fastmcp-2.6.1/docs/clients/auth/oauth.mdx +116 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/clients/client.mdx +1 -1
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/deployment/running-server.mdx +2 -2
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/docs.json +57 -20
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/getting-started/welcome.mdx +9 -9
- fastmcp-2.6.1/docs/integrations/anthropic.mdx +231 -0
- fastmcp-2.6.1/docs/integrations/claude-desktop.mdx +221 -0
- fastmcp-2.6.1/docs/integrations/gemini.mdx +108 -0
- fastmcp-2.6.1/docs/integrations/openai.mdx +228 -0
- {fastmcp-2.5.2/docs/deployment → fastmcp-2.6.1/docs/patterns}/cli.mdx +15 -12
- fastmcp-2.6.1/docs/servers/auth/bearer.mdx +187 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/composition.mdx +1 -1
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/fastmcp.mdx +4 -29
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/tools.mdx +20 -1
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/snippets/version-badge.mdx +3 -4
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/style.css +13 -11
- {fastmcp-2.5.2 → fastmcp-2.6.1}/pyproject.toml +4 -1
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/__init__.py +3 -0
- fastmcp-2.6.1/src/fastmcp/client/auth/__init__.py +4 -0
- fastmcp-2.6.1/src/fastmcp/client/auth/bearer.py +17 -0
- fastmcp-2.6.1/src/fastmcp/client/auth/oauth.py +391 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/client.py +74 -26
- fastmcp-2.6.1/src/fastmcp/client/oauth_callback.py +310 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/transports.py +76 -14
- fastmcp-2.6.1/src/fastmcp/server/auth/__init__.py +4 -0
- fastmcp-2.6.1/src/fastmcp/server/auth/auth.py +45 -0
- fastmcp-2.6.1/src/fastmcp/server/auth/providers/bearer.py +377 -0
- fastmcp-2.6.1/src/fastmcp/server/auth/providers/bearer_env.py +62 -0
- fastmcp-2.6.1/src/fastmcp/server/auth/providers/in_memory.py +325 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/dependencies.py +10 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/http.py +38 -66
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/openapi.py +2 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/server.py +21 -26
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/settings.py +27 -8
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/tools/tool.py +22 -3
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/tools/tool_manager.py +2 -0
- fastmcp-2.6.1/src/fastmcp/utilities/http.py +8 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/tests.py +22 -10
- fastmcp-2.6.1/tests/auth/providers/test_bearer.py +635 -0
- fastmcp-2.6.1/tests/auth/providers/test_bearer_env.py +82 -0
- fastmcp-2.6.1/tests/auth/test_oauth_client.py +265 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_client.py +54 -14
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_openapi.py +26 -79
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_roots.py +1 -3
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_sse.py +12 -28
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_stdio.py +9 -19
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_streamable_http.py +23 -45
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/deprecated/test_deprecated.py +0 -11
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/prompts/test_prompt_manager.py +2 -4
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/resources/test_file_resources.py +0 -1
- fastmcp-2.6.1/tests/server/__init__.py +0 -0
- fastmcp-2.6.1/tests/server/http/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/http/test_http_dependencies.py +10 -53
- fastmcp-2.6.1/tests/server/openapi/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/openapi/test_openapi.py +16 -38
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_auth_integration.py +1 -1
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_import_server.py +6 -14
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_logging.py +4 -3
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_mount.py +12 -26
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_proxy.py +31 -17
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_server.py +56 -78
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_server_interactions.py +59 -111
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_tool_annotations.py +3 -4
- fastmcp-2.6.1/tests/server/test_tool_exclude_args.py +92 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/test_examples.py +8 -26
- fastmcp-2.6.1/tests/tools/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/tools/test_tool.py +14 -32
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/tools/test_tool_manager.py +21 -90
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_mcp_config.py +2 -6
- {fastmcp-2.5.2 → fastmcp-2.6.1}/uv.lock +342 -136
- fastmcp-2.5.2/docs/deployment/authentication.mdx +0 -15
- fastmcp-2.5.2/docs/patterns/fastapi.mdx +0 -47
- fastmcp-2.5.2/src/fastmcp/low_level/README.md +0 -1
- fastmcp-2.5.2/tests/client/__init__.py +0 -1
- fastmcp-2.5.2/tests/server/test_lifespan.py +0 -396
- {fastmcp-2.5.2 → fastmcp-2.6.1}/.cursor/rules/core-mcp-objects.mdc +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/ISSUE_TEMPLATE/bug.yml +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/ISSUE_TEMPLATE/enhancement.yml +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/labeler.yml +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/release.yml +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/workflows/labeler.yml +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/workflows/publish.yml +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/workflows/run-static.yml +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/.github/workflows/run-tests.yml +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/.gitignore +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/.pre-commit-config.yaml +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/AGENTS.md +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/LICENSE +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/Windows_Notes.md +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/assets/demo-inspector.png +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/clients/advanced-features.mdx +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/clients/transports.mdx +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/deployment/asgi.mdx +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/getting-started/installation.mdx +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/getting-started/quickstart.mdx +0 -0
- {fastmcp-2.5.2/docs/patterns → fastmcp-2.6.1/docs/integrations}/contrib.mdx +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/patterns/decorating-methods.mdx +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/patterns/http-requests.mdx +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/patterns/testing.mdx +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/context.mdx +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/openapi.mdx +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/prompts.mdx +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/proxy.mdx +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/docs/servers/resources.mdx +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/complex_inputs.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/desktop.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/echo.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/in_memory_proxy_example.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/memory.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/mount_example.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/sampling.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/screenshot.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/serializer.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/simple_echo.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/README.md +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/pyproject.toml +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/__main__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/hub.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/lights/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/lights/hue_utils.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/lights/server.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/py.typed +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/src/smart_home/settings.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/smart_home/uv.lock +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/tags_example.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/examples/text_me.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/justfile +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/cli/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/cli/claude.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/cli/cli.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/cli/run.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/logging.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/progress.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/roots.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/client/sampling.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/README.md +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/bulk_tool_caller/README.md +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/bulk_tool_caller/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/bulk_tool_caller/bulk_tool_caller.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/bulk_tool_caller/example.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/mcp_mixin/README.md +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/mcp_mixin/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/mcp_mixin/example.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/contrib/mcp_mixin/mcp_mixin.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/exceptions.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/prompts/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/prompts/prompt.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/prompts/prompt_manager.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/py.typed +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/resources/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/resources/resource.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/resources/resource_manager.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/resources/template.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/resources/types.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/__init__.py +0 -0
- {fastmcp-2.5.2/src/fastmcp/low_level → fastmcp-2.6.1/src/fastmcp/server/auth/providers}/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/context.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/server/proxy.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/tools/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/cache.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/decorators.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/exceptions.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/json_schema.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/logging.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/mcp_config.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/openapi.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/src/fastmcp/utilities/types.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/__init__.py +0 -0
- {fastmcp-2.5.2/tests/deprecated → fastmcp-2.6.1/tests/auth}/__init__.py +0 -0
- {fastmcp-2.5.2/tests/prompts → fastmcp-2.6.1/tests/cli}/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/cli/test_cli.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/cli/test_run.py +0 -0
- {fastmcp-2.5.2/tests/resources → fastmcp-2.6.1/tests/client}/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_logs.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_progress.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/client/test_sampling.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/conftest.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/contrib/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/contrib/test_bulk_tool_caller.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/contrib/test_mcp_mixin.py +0 -0
- {fastmcp-2.5.2/tests/server → fastmcp-2.6.1/tests/deprecated}/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/deprecated/test_mount_separators.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/deprecated/test_resource_prefixes.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/deprecated/test_route_type_ignore.py +0 -0
- {fastmcp-2.5.2/tests/tools → fastmcp-2.6.1/tests/prompts}/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/prompts/test_prompt.py +0 -0
- /fastmcp-2.5.2/src/fastmcp/client/base.py → /fastmcp-2.6.1/tests/resources/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/resources/test_function_resources.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/resources/test_resource_manager.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/resources/test_resource_template.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/resources/test_resources.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/http/test_custom_routes.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/http/test_http_middleware.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/openapi/test_openapi_path_parameters.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/openapi/test_route_map_fn.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_app_state.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_context.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_file_server.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_resource_prefix_formats.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/server/test_run_server.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/test_servers/fastmcp_server.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/test_servers/sse.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/test_servers/stdio.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/openapi/__init__.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/openapi/conftest.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/openapi/test_openapi.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/openapi/test_openapi_advanced.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/openapi/test_openapi_fastapi.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_cache.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_decorated_function.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_json_schema.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_logging.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_tests.py +0 -0
- {fastmcp-2.5.2 → fastmcp-2.6.1}/tests/utilities/test_typeadapter.py +0 -0
- {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.
|
|
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.
|
|
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
|
-
> [!
|
|
45
|
-
> ####
|
|
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
|
|
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
|
-
>
|
|
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.
|
|
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** (
|
|
121
|
-
- Provide functionality through **Tools** (
|
|
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
|
-
|
|
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:**
|
|
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
|
|
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
|
-
> [!
|
|
16
|
-
> ####
|
|
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
|
|
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
|
-
>
|
|
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.
|
|
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** (
|
|
92
|
-
- Provide functionality through **Tools** (
|
|
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
|
-
|
|
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:**
|
|
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
|
|
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.
|
|
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](/
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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/
|
|
81
|
-
"patterns/
|
|
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
|
|
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
|
-
##
|
|
27
|
+
## Beyond the Protocol
|
|
28
28
|
|
|
29
|
-
FastMCP is the standard framework for
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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**:
|
|
61
|
+
🔍 **Complete**: A comprehensive platform for all MCP use cases, from dev to prod
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
## `llms.txt`
|