fastmcp 2.8.0__tar.gz → 2.9.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.
- {fastmcp-2.8.0 → fastmcp-2.9.0}/.github/release.yml +11 -2
- {fastmcp-2.8.0 → fastmcp-2.9.0}/.pre-commit-config.yaml +1 -1
- fastmcp-2.9.0/CLAUDE.md +36 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/PKG-INFO +47 -27
- {fastmcp-2.8.0 → fastmcp-2.9.0}/README.md +45 -25
- fastmcp-2.9.0/docs/.cursor/rules/mintlify.mdc +364 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/changelog.mdx +68 -1
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/clients/auth/bearer.mdx +7 -4
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/clients/auth/oauth.mdx +1 -1
- fastmcp-2.9.0/docs/clients/client.mdx +291 -0
- fastmcp-2.9.0/docs/clients/logging.mdx +76 -0
- fastmcp-2.9.0/docs/clients/progress.mdx +70 -0
- fastmcp-2.9.0/docs/clients/prompts.mdx +187 -0
- fastmcp-2.9.0/docs/clients/resources.mdx +171 -0
- fastmcp-2.9.0/docs/clients/roots.mdx +42 -0
- fastmcp-2.9.0/docs/clients/sampling.mdx +152 -0
- fastmcp-2.9.0/docs/clients/tools.mdx +143 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/clients/transports.mdx +4 -4
- fastmcp-2.9.0/docs/community/README.md +22 -0
- fastmcp-2.9.0/docs/community/showcase.mdx +59 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/deployment/asgi.mdx +11 -5
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/deployment/running-server.mdx +11 -8
- fastmcp-2.9.0/docs/docs.json +312 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/getting-started/installation.mdx +3 -2
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/getting-started/welcome.mdx +5 -3
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/integrations/anthropic.mdx +6 -6
- fastmcp-2.9.0/docs/integrations/chatgpt.mdx +158 -0
- fastmcp-2.9.0/docs/integrations/claude-code.mdx +60 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/integrations/claude-desktop.mdx +9 -5
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/integrations/gemini.mdx +2 -2
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/integrations/openai.mdx +6 -6
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/patterns/cli.mdx +33 -8
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/patterns/tool-transformation.mdx +1 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-cli-__init__.mdx +9 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-cli-claude.mdx +43 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-cli-cli.mdx +86 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-cli-run.mdx +106 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-client-__init__.mdx +8 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-client-auth-__init__.mdx +8 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-client-auth-bearer.mdx +18 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-client-auth-oauth.mdx +102 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-client-client.mdx +94 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-client-logging.mdx +14 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-client-oauth_callback.mdx +63 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-client-progress.mdx +8 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-client-roots.mdx +20 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-client-sampling.mdx +14 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-client-transports.mdx +191 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-exceptions.mdx +65 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-prompts-__init__.mdx +8 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-prompts-prompt.mdx +84 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-prompts-prompt_manager.mdx +43 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-resources-__init__.mdx +8 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-resources-resource.mdx +90 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-resources-resource_manager.mdx +111 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-resources-template.mdx +104 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-resources-types.mdx +83 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-__init__.mdx +8 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-auth-__init__.mdx +8 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-auth-auth.mdx +10 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-auth-providers-__init__.mdx +8 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-auth-providers-bearer.mdx +69 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-auth-providers-bearer_env.mdx +22 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-auth-providers-in_memory.mdx +15 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-context.mdx +118 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-dependencies.mdx +36 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-http.mdx +113 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-middleware.mdx +56 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-openapi.mdx +58 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-proxy.mdx +101 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-server-server.mdx +542 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-settings.mdx +59 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-tools-__init__.mdx +8 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-tools-tool.mdx +68 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-tools-tool_manager.mdx +58 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-tools-tool_transform.mdx +117 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-utilities-__init__.mdx +9 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-utilities-cache.mdx +30 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-utilities-components.mdx +52 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-utilities-exceptions.mdx +20 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-utilities-http.mdx +18 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-utilities-inspect.mdx +41 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-utilities-json_schema.mdx +25 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-utilities-logging.mdx +41 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-utilities-mcp_config.mdx +50 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-utilities-openapi.mdx +118 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-utilities-tests.mdx +42 -0
- fastmcp-2.9.0/docs/python-sdk/fastmcp-utilities-types.mdx +112 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/servers/auth/bearer.mdx +69 -24
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/servers/composition.mdx +81 -9
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/servers/context.mdx +1 -0
- fastmcp-2.9.0/docs/servers/middleware.mdx +574 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/servers/prompts.mdx +113 -49
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/servers/proxy.mdx +3 -3
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/servers/resources.mdx +37 -18
- fastmcp-2.8.0/docs/servers/fastmcp.mdx → fastmcp-2.9.0/docs/servers/server.mdx +115 -26
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/servers/tools.mdx +68 -26
- fastmcp-2.9.0/docs/snippets/youtube-embed.mdx +12 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/tutorials/rest-api.mdx +3 -3
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/updates.mdx +31 -3
- fastmcp-2.9.0/examples/atproto_mcp/README.md +146 -0
- fastmcp-2.9.0/examples/atproto_mcp/demo.py +225 -0
- fastmcp-2.9.0/examples/atproto_mcp/pyproject.toml +24 -0
- fastmcp-2.9.0/examples/atproto_mcp/src/atproto_mcp/__init__.py +3 -0
- fastmcp-2.9.0/examples/atproto_mcp/src/atproto_mcp/__main__.py +9 -0
- fastmcp-2.9.0/examples/atproto_mcp/src/atproto_mcp/_atproto/__init__.py +19 -0
- fastmcp-2.9.0/examples/atproto_mcp/src/atproto_mcp/_atproto/_client.py +16 -0
- fastmcp-2.9.0/examples/atproto_mcp/src/atproto_mcp/_atproto/_posts.py +284 -0
- fastmcp-2.9.0/examples/atproto_mcp/src/atproto_mcp/_atproto/_profile.py +33 -0
- fastmcp-2.9.0/examples/atproto_mcp/src/atproto_mcp/_atproto/_read.py +124 -0
- fastmcp-2.9.0/examples/atproto_mcp/src/atproto_mcp/_atproto/_social.py +108 -0
- fastmcp-2.9.0/examples/atproto_mcp/src/atproto_mcp/server.py +128 -0
- fastmcp-2.9.0/examples/atproto_mcp/src/atproto_mcp/settings.py +17 -0
- fastmcp-2.9.0/examples/atproto_mcp/src/atproto_mcp/types.py +121 -0
- fastmcp-2.9.0/examples/get_file.py +33 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/screenshot.py +2 -1
- fastmcp-2.9.0/justfile +30 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/pyproject.toml +1 -1
- fastmcp-2.9.0/src/fastmcp/__init__.py +50 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/cli/cli.py +99 -1
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/cli/run.py +1 -3
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/client/auth/oauth.py +1 -2
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/client/client.py +24 -9
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/client/sampling.py +5 -9
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/client/transports.py +24 -7
- fastmcp-2.9.0/src/fastmcp/contrib/mcp_mixin/README.md +116 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/contrib/mcp_mixin/mcp_mixin.py +14 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/prompts/prompt.py +94 -14
- fastmcp-2.9.0/src/fastmcp/prompts/prompt_manager.py +201 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/resources/resource.py +11 -1
- fastmcp-2.9.0/src/fastmcp/resources/resource_manager.py +492 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/resources/template.py +27 -1
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/server/auth/providers/bearer.py +32 -10
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/server/auth/providers/in_memory.py +2 -2
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/server/context.py +53 -12
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/server/http.py +8 -0
- fastmcp-2.9.0/src/fastmcp/server/middleware/__init__.py +6 -0
- fastmcp-2.9.0/src/fastmcp/server/middleware/error_handling.py +206 -0
- fastmcp-2.9.0/src/fastmcp/server/middleware/logging.py +165 -0
- fastmcp-2.9.0/src/fastmcp/server/middleware/middleware.py +236 -0
- fastmcp-2.9.0/src/fastmcp/server/middleware/rate_limiting.py +231 -0
- fastmcp-2.9.0/src/fastmcp/server/middleware/timing.py +156 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/server/openapi.py +22 -19
- fastmcp-2.9.0/src/fastmcp/server/proxy.py +401 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/server/server.py +432 -327
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/settings.py +22 -9
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/tools/tool.py +16 -11
- fastmcp-2.9.0/src/fastmcp/tools/tool_manager.py +215 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/tools/tool_transform.py +9 -5
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/utilities/components.py +22 -2
- fastmcp-2.9.0/src/fastmcp/utilities/inspect.py +326 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/utilities/json_schema.py +67 -23
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/utilities/mcp_config.py +13 -7
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/utilities/openapi.py +5 -3
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/utilities/tests.py +1 -1
- fastmcp-2.9.0/src/fastmcp/utilities/types.py +294 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/auth/providers/test_bearer.py +98 -6
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/auth/test_oauth_client.py +2 -2
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/cli/test_cli.py +35 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/client/test_client.py +133 -6
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/client/test_openapi.py +5 -5
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/client/test_sse.py +3 -3
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/client/test_streamable_http.py +71 -22
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/contrib/test_bulk_tool_caller.py +1 -3
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/deprecated/test_deprecated.py +24 -81
- fastmcp-2.9.0/tests/deprecated/test_mount_import_arg_order.py +275 -0
- fastmcp-2.9.0/tests/deprecated/test_mount_separators.py +113 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/deprecated/test_resource_prefixes.py +7 -5
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/deprecated/test_settings.py +24 -16
- fastmcp-2.9.0/tests/prompts/test_prompt.py +484 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/prompts/test_prompt_manager.py +23 -24
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/resources/test_resource_manager.py +73 -53
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/resources/test_resource_template.py +1 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/http/test_custom_routes.py +1 -1
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/http/test_http_dependencies.py +3 -3
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/http/test_http_middleware.py +2 -2
- fastmcp-2.9.0/tests/server/middleware/test_error_handling.py +601 -0
- fastmcp-2.9.0/tests/server/middleware/test_logging.py +426 -0
- fastmcp-2.9.0/tests/server/middleware/test_middleware.py +567 -0
- fastmcp-2.9.0/tests/server/middleware/test_rate_limiting.py +448 -0
- fastmcp-2.9.0/tests/server/middleware/test_timing.py +312 -0
- fastmcp-2.9.0/tests/server/openapi/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/openapi/test_openapi.py +188 -184
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_app_state.py +2 -2
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_auth_integration.py +3 -3
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_context.py +37 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_import_server.py +237 -38
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_mount.py +386 -67
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_proxy.py +2 -2
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_resource_prefix_formats.py +6 -6
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_server.py +15 -9
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_server_interactions.py +243 -13
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_tool_annotations.py +6 -3
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_tool_exclude_args.py +5 -3
- fastmcp-2.9.0/tests/tools/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/tools/test_tool.py +132 -2
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/tools/test_tool_manager.py +48 -42
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/tools/test_tool_transform.py +32 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/utilities/openapi/test_openapi_advanced.py +22 -0
- fastmcp-2.9.0/tests/utilities/test_inspect.py +388 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/utilities/test_json_schema.py +17 -5
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/utilities/test_mcp_config.py +6 -6
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/utilities/test_types.py +212 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/uv.lock +150 -148
- fastmcp-2.8.0/docs/clients/advanced-features.mdx +0 -152
- fastmcp-2.8.0/docs/clients/client.mdx +0 -372
- fastmcp-2.8.0/docs/docs.json +0 -165
- fastmcp-2.8.0/justfile +0 -9
- fastmcp-2.8.0/src/fastmcp/__init__.py +0 -24
- fastmcp-2.8.0/src/fastmcp/contrib/mcp_mixin/README.md +0 -39
- fastmcp-2.8.0/src/fastmcp/prompts/prompt_manager.py +0 -124
- fastmcp-2.8.0/src/fastmcp/resources/resource_manager.py +0 -317
- fastmcp-2.8.0/src/fastmcp/server/proxy.py +0 -295
- fastmcp-2.8.0/src/fastmcp/tools/tool_manager.py +0 -146
- fastmcp-2.8.0/src/fastmcp/utilities/types.py +0 -128
- fastmcp-2.8.0/tests/deprecated/test_mount_separators.py +0 -88
- fastmcp-2.8.0/tests/prompts/test_prompt.py +0 -242
- {fastmcp-2.8.0 → fastmcp-2.9.0}/.cursor/rules/core-mcp-objects.mdc +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/.github/ISSUE_TEMPLATE/bug.yml +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/.github/ISSUE_TEMPLATE/enhancement.yml +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/.github/dependabot.yml +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/.github/labeler.yml +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/.github/workflows/labeler.yml +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/.github/workflows/publish.yml +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/.github/workflows/run-static.yml +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/.github/workflows/run-tests.yml +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/.gitignore +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/AGENTS.md +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/LICENSE +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/Windows_Notes.md +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/assets/demo-inspector.png +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/assets/favicon.ico +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/assets/images/tutorial-rest-api-result.png +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/assets/logo.png +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/assets/updates/release-2-7.png +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/getting-started/quickstart.mdx +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/integrations/contrib.mdx +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/patterns/decorating-methods.mdx +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/patterns/http-requests.mdx +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/patterns/testing.mdx +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/servers/openapi.mdx +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/snippets/version-badge.mdx +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/style.css +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/tutorials/create-mcp-server.mdx +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/docs/tutorials/mcp.mdx +0 -0
- {fastmcp-2.8.0/examples/smart_home/src/smart_home → fastmcp-2.9.0/examples/atproto_mcp/src/atproto_mcp}/py.typed +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/complex_inputs.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/config_server.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/desktop.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/echo.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/in_memory_proxy_example.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/memory.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/mount_example.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/sampling.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/serializer.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/simple_echo.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/smart_home/README.md +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/smart_home/pyproject.toml +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/smart_home/src/smart_home/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/smart_home/src/smart_home/__main__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/smart_home/src/smart_home/hub.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/smart_home/src/smart_home/lights/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/smart_home/src/smart_home/lights/hue_utils.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/smart_home/src/smart_home/lights/server.py +0 -0
- {fastmcp-2.8.0/src/fastmcp → fastmcp-2.9.0/examples/smart_home/src/smart_home}/py.typed +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/smart_home/src/smart_home/settings.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/smart_home/uv.lock +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/tags_example.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/examples/text_me.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/cli/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/cli/claude.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/client/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/client/auth/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/client/auth/bearer.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/client/logging.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/client/oauth_callback.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/client/progress.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/client/roots.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/contrib/README.md +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/contrib/bulk_tool_caller/README.md +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/contrib/bulk_tool_caller/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/contrib/bulk_tool_caller/bulk_tool_caller.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/contrib/bulk_tool_caller/example.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/contrib/mcp_mixin/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/contrib/mcp_mixin/example.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/exceptions.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/prompts/__init__.py +0 -0
- /fastmcp-2.8.0/src/fastmcp/server/auth/providers/__init__.py → /fastmcp-2.9.0/src/fastmcp/py.typed +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/resources/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/resources/types.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/server/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/server/auth/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/server/auth/auth.py +0 -0
- {fastmcp-2.8.0/tests → fastmcp-2.9.0/src/fastmcp/server/auth/providers}/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/server/auth/providers/bearer_env.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/server/dependencies.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/tools/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/utilities/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/utilities/cache.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/utilities/exceptions.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/utilities/http.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/src/fastmcp/utilities/logging.py +0 -0
- {fastmcp-2.8.0/tests/auth → fastmcp-2.9.0/tests}/__init__.py +0 -0
- {fastmcp-2.8.0/tests/cli → fastmcp-2.9.0/tests/auth}/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/auth/providers/test_bearer_env.py +0 -0
- {fastmcp-2.8.0/tests/client → fastmcp-2.9.0/tests/cli}/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/cli/test_run.py +0 -0
- {fastmcp-2.8.0/tests/prompts → fastmcp-2.9.0/tests/client}/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/client/test_logs.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/client/test_progress.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/client/test_roots.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/client/test_sampling.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/client/test_stdio.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/conftest.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/contrib/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/contrib/test_mcp_mixin.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/deprecated/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/deprecated/test_route_type_ignore.py +0 -0
- {fastmcp-2.8.0/tests/resources → fastmcp-2.9.0/tests/prompts}/__init__.py +0 -0
- {fastmcp-2.8.0/tests/server → fastmcp-2.9.0/tests/resources}/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/resources/test_file_resources.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/resources/test_function_resources.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/resources/test_resources.py +0 -0
- {fastmcp-2.8.0/tests/server/http → fastmcp-2.9.0/tests/server}/__init__.py +0 -0
- {fastmcp-2.8.0/tests/server/openapi → fastmcp-2.9.0/tests/server/http}/__init__.py +0 -0
- {fastmcp-2.8.0/tests/tools → fastmcp-2.9.0/tests/server/middleware}/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/openapi/test_openapi_path_parameters.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/openapi/test_route_map_fn.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_file_server.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_logging.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/server/test_run_server.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/test_examples.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/test_servers/fastmcp_server.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/test_servers/sse.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/test_servers/stdio.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/utilities/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/utilities/openapi/__init__.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/utilities/openapi/conftest.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/utilities/openapi/test_openapi.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/utilities/openapi/test_openapi_fastapi.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/utilities/test_cache.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/utilities/test_logging.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/utilities/test_tests.py +0 -0
- {fastmcp-2.8.0 → fastmcp-2.9.0}/tests/utilities/test_typeadapter.py +0 -0
|
@@ -9,7 +9,7 @@ changelog:
|
|
|
9
9
|
- feature
|
|
10
10
|
exclude:
|
|
11
11
|
labels:
|
|
12
|
-
-
|
|
12
|
+
- contrib
|
|
13
13
|
|
|
14
14
|
- title: Enhancements 🔧
|
|
15
15
|
labels:
|
|
@@ -17,22 +17,31 @@ changelog:
|
|
|
17
17
|
exclude:
|
|
18
18
|
labels:
|
|
19
19
|
- breaking change
|
|
20
|
+
- contrib
|
|
20
21
|
|
|
21
22
|
- title: Fixes 🐞
|
|
22
23
|
labels:
|
|
23
24
|
- bug
|
|
24
25
|
exclude:
|
|
25
26
|
labels:
|
|
26
|
-
-
|
|
27
|
+
- contrib
|
|
27
28
|
|
|
28
29
|
- title: Breaking Changes 🛫
|
|
29
30
|
labels:
|
|
30
31
|
- breaking change
|
|
32
|
+
exclude:
|
|
33
|
+
labels:
|
|
34
|
+
- contrib
|
|
31
35
|
|
|
32
36
|
- title: Docs 📚
|
|
33
37
|
labels:
|
|
34
38
|
- documentation
|
|
35
39
|
|
|
40
|
+
- title: Examples & Contrib 💡
|
|
41
|
+
labels:
|
|
42
|
+
- example
|
|
43
|
+
- contrib
|
|
44
|
+
|
|
36
45
|
- title: Dependencies 📦
|
|
37
46
|
labels:
|
|
38
47
|
- dependencies
|
fastmcp-2.9.0/CLAUDE.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# FastMCP Development Guidelines
|
|
2
|
+
|
|
3
|
+
## Testing and Investigation
|
|
4
|
+
|
|
5
|
+
### In-Memory Transport - Always Preferred
|
|
6
|
+
|
|
7
|
+
When testing or investigating FastMCP servers, **always prefer the in-memory transport** unless you specifically need HTTP transport features. Pass a FastMCP server directly to a Client to eliminate separate processes and network complexity.
|
|
8
|
+
|
|
9
|
+
```python
|
|
10
|
+
# Create your FastMCP server
|
|
11
|
+
mcp = FastMCP("TestServer")
|
|
12
|
+
|
|
13
|
+
@mcp.tool
|
|
14
|
+
def greet(name: str) -> str:
|
|
15
|
+
return f"Hello, {name}!"
|
|
16
|
+
|
|
17
|
+
# Pass server directly to client - uses in-memory transport
|
|
18
|
+
async with Client(mcp) as client:
|
|
19
|
+
result = await client.call_tool("greet", {"name": "World"})
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### When to Use HTTP Transport
|
|
23
|
+
|
|
24
|
+
Only use HTTP transport when testing network-specific features. Prefer StreamableHttp over SSE as it's the modern approach.
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
# Only when network testing is required
|
|
28
|
+
async with Client(transport=StreamableHttpTransport(server_url)) as client:
|
|
29
|
+
result = await client.ping()
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Development Workflow
|
|
33
|
+
|
|
34
|
+
- You must always run pre-commit if you open a PR, because it is run as part of a required check.
|
|
35
|
+
- When opening PRs, apply labels appropriately for bugs/breaking changes/enhancements/features. Generally, improvements are enhancements (not features) unless told otherwise.
|
|
36
|
+
- NEVER modify files in docs/python-sdk/**, as they are auto-generated.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastmcp
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.9.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
|
|
@@ -20,7 +20,7 @@ Requires-Python: >=3.10
|
|
|
20
20
|
Requires-Dist: authlib>=1.5.2
|
|
21
21
|
Requires-Dist: exceptiongroup>=1.2.2
|
|
22
22
|
Requires-Dist: httpx>=0.28.1
|
|
23
|
-
Requires-Dist: mcp<2.0.0,>=1.9.
|
|
23
|
+
Requires-Dist: mcp<2.0.0,>=1.9.4
|
|
24
24
|
Requires-Dist: openapi-pydantic>=0.5.1
|
|
25
25
|
Requires-Dist: python-dotenv>=1.1.0
|
|
26
26
|
Requires-Dist: rich>=13.9.4
|
|
@@ -33,6 +33,7 @@ Description-Content-Type: text/markdown
|
|
|
33
33
|
|
|
34
34
|
<!-- omit in toc -->
|
|
35
35
|
# FastMCP v2 🚀
|
|
36
|
+
|
|
36
37
|
<strong>The fast, Pythonic way to build MCP servers and clients.</strong>
|
|
37
38
|
|
|
38
39
|
*FastMCP is made with 💙 by [Prefect](https://www.prefect.io/)*
|
|
@@ -46,13 +47,16 @@ Description-Content-Type: text/markdown
|
|
|
46
47
|
</div>
|
|
47
48
|
|
|
48
49
|
> [!Note]
|
|
50
|
+
>
|
|
49
51
|
> #### Beyond the Protocol
|
|
50
|
-
>
|
|
51
|
-
> 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.
|
|
52
52
|
>
|
|
53
|
-
> FastMCP
|
|
53
|
+
> FastMCP is the standard framework for working with the Model Context Protocol. FastMCP 1.0 was incorporated into the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk) in 2024.
|
|
54
|
+
>
|
|
55
|
+
> This is FastMCP 2.0, the **actively maintained version** that provides a complete toolkit for working with the MCP ecosystem.
|
|
54
56
|
>
|
|
55
|
-
>
|
|
57
|
+
> FastMCP 2.0 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 deployment, auth, clients, server proxying and composition, generating servers from REST APIs, dynamic tool rewriting, built-in testing tools, integrations, and more.
|
|
58
|
+
>
|
|
59
|
+
> Ready to upgrade or get started? Follow the [installation instructions](https://gofastmcp.com/getting-started/installation), which include steps for upgrading from the official MCP SDK.
|
|
56
60
|
|
|
57
61
|
---
|
|
58
62
|
|
|
@@ -74,6 +78,7 @@ if __name__ == "__main__":
|
|
|
74
78
|
```
|
|
75
79
|
|
|
76
80
|
Run the server locally:
|
|
81
|
+
|
|
77
82
|
```bash
|
|
78
83
|
fastmcp run server.py
|
|
79
84
|
```
|
|
@@ -82,9 +87,10 @@ fastmcp run server.py
|
|
|
82
87
|
|
|
83
88
|
FastMCP's complete documentation is available at **[gofastmcp.com](https://gofastmcp.com)**, including detailed guides, API references, and advanced patterns. This readme provides only a high-level overview.
|
|
84
89
|
|
|
85
|
-
Documentation is also available in [llms.txt format](https://llmstxt.org/), which is a simple markdown standard that LLMs can consume easily.
|
|
90
|
+
Documentation is also available in [llms.txt format](https://llmstxt.org/), which is a simple markdown standard that LLMs can consume easily.
|
|
86
91
|
|
|
87
92
|
There are two ways to access the LLM-friendly documentation:
|
|
93
|
+
|
|
88
94
|
- [`llms.txt`](https://gofastmcp.com/llms.txt) is essentially a sitemap, listing all the pages in the documentation.
|
|
89
95
|
- [`llms-full.txt`](https://gofastmcp.com/llms-full.txt) contains the entire documentation. Note this may exceed the context window of your LLM.
|
|
90
96
|
|
|
@@ -174,7 +180,7 @@ Learn more in the [**FastMCP Server Documentation**](https://gofastmcp.com/serve
|
|
|
174
180
|
|
|
175
181
|
### Tools
|
|
176
182
|
|
|
177
|
-
Tools allow LLMs to perform actions by executing your Python functions (sync or async). Ideal for computations, API calls, or side effects (like `POST`/`PUT`). FastMCP handles schema generation from type hints and docstrings. Tools can return various types, including text, JSON-serializable objects, and even images
|
|
183
|
+
Tools allow LLMs to perform actions by executing your Python functions (sync or async). Ideal for computations, API calls, or side effects (like `POST`/`PUT`). FastMCP handles schema generation from type hints and docstrings. Tools can return various types, including text, JSON-serializable objects, and even images or audio aided by the FastMCP media helper classes.
|
|
178
184
|
|
|
179
185
|
```python
|
|
180
186
|
@mcp.tool
|
|
@@ -220,12 +226,13 @@ Learn more in the [**Prompts Documentation**](https://gofastmcp.com/servers/prom
|
|
|
220
226
|
### Context
|
|
221
227
|
|
|
222
228
|
Access MCP session capabilities within your tools, resources, or prompts by adding a `ctx: Context` parameter. Context provides methods for:
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
+
|
|
230
|
+
- **Logging:** Log messages to MCP clients with `ctx.info()`, `ctx.error()`, etc.
|
|
231
|
+
- **LLM Sampling:** Use `ctx.sample()` to request completions from the client's LLM.
|
|
232
|
+
- **HTTP Request:** Use `ctx.http_request()` to make HTTP requests to other servers.
|
|
233
|
+
- **Resource Access:** Use `ctx.read_resource()` to access resources on the server
|
|
234
|
+
- **Progress Reporting:** Use `ctx.report_progress()` to report progress to the client.
|
|
235
|
+
- and more...
|
|
229
236
|
|
|
230
237
|
To access the context, add a parameter annotated as `Context` to any mcp-decorated function. FastMCP will automatically inject the correct context object when the function is called.
|
|
231
238
|
|
|
@@ -365,16 +372,19 @@ if __name__ == "__main__":
|
|
|
365
372
|
FastMCP supports three transport protocols:
|
|
366
373
|
|
|
367
374
|
**STDIO (Default)**: Best for local tools and command-line scripts.
|
|
375
|
+
|
|
368
376
|
```python
|
|
369
377
|
mcp.run(transport="stdio") # Default, so transport argument is optional
|
|
370
378
|
```
|
|
371
379
|
|
|
372
380
|
**Streamable HTTP**: Recommended for web deployments.
|
|
381
|
+
|
|
373
382
|
```python
|
|
374
|
-
mcp.run(transport="
|
|
383
|
+
mcp.run(transport="http", host="127.0.0.1", port=8000, path="/mcp")
|
|
375
384
|
```
|
|
376
385
|
|
|
377
386
|
**SSE**: For compatibility with existing SSE clients.
|
|
387
|
+
|
|
378
388
|
```python
|
|
379
389
|
mcp.run(transport="sse", host="127.0.0.1", port=8000)
|
|
380
390
|
```
|
|
@@ -387,22 +397,26 @@ Contributions are the core of open source! We welcome improvements and features.
|
|
|
387
397
|
|
|
388
398
|
### Prerequisites
|
|
389
399
|
|
|
390
|
-
|
|
391
|
-
|
|
400
|
+
- Python 3.10+
|
|
401
|
+
- [uv](https://docs.astral.sh/uv/) (Recommended for environment management)
|
|
392
402
|
|
|
393
403
|
### Setup
|
|
394
404
|
|
|
395
|
-
1. Clone the repository:
|
|
405
|
+
1. Clone the repository:
|
|
406
|
+
|
|
396
407
|
```bash
|
|
397
408
|
git clone https://github.com/jlowin/fastmcp.git
|
|
398
409
|
cd fastmcp
|
|
399
410
|
```
|
|
400
|
-
|
|
411
|
+
|
|
412
|
+
2. Create and sync the environment:
|
|
413
|
+
|
|
401
414
|
```bash
|
|
402
415
|
uv sync
|
|
403
416
|
```
|
|
417
|
+
|
|
404
418
|
This installs all dependencies, including dev tools.
|
|
405
|
-
|
|
419
|
+
|
|
406
420
|
3. Activate the virtual environment (e.g., `source .venv/bin/activate` or via your IDE).
|
|
407
421
|
|
|
408
422
|
### Unit Tests
|
|
@@ -410,10 +424,13 @@ Contributions are the core of open source! We welcome improvements and features.
|
|
|
410
424
|
FastMCP has a comprehensive unit test suite. All PRs must introduce or update tests as appropriate and pass the full suite.
|
|
411
425
|
|
|
412
426
|
Run tests using pytest:
|
|
427
|
+
|
|
413
428
|
```bash
|
|
414
429
|
pytest
|
|
415
430
|
```
|
|
431
|
+
|
|
416
432
|
or if you want an overview of the code coverage
|
|
433
|
+
|
|
417
434
|
```bash
|
|
418
435
|
uv run pytest --cov=src --cov=examples --cov-report=html
|
|
419
436
|
```
|
|
@@ -423,10 +440,13 @@ uv run pytest --cov=src --cov=examples --cov-report=html
|
|
|
423
440
|
FastMCP uses `pre-commit` for code formatting, linting, and type-checking. All PRs must pass these checks (they run automatically in CI).
|
|
424
441
|
|
|
425
442
|
Install the hooks locally:
|
|
443
|
+
|
|
426
444
|
```bash
|
|
427
445
|
uv run pre-commit install
|
|
428
446
|
```
|
|
447
|
+
|
|
429
448
|
The hooks will now run automatically on `git commit`. You can also run them manually at any time:
|
|
449
|
+
|
|
430
450
|
```bash
|
|
431
451
|
pre-commit run --all-files
|
|
432
452
|
# or via uv
|
|
@@ -435,11 +455,11 @@ uv run pre-commit run --all-files
|
|
|
435
455
|
|
|
436
456
|
### Pull Requests
|
|
437
457
|
|
|
438
|
-
1.
|
|
439
|
-
2.
|
|
440
|
-
3.
|
|
441
|
-
4.
|
|
442
|
-
5.
|
|
443
|
-
6.
|
|
458
|
+
1. Fork the repository on GitHub.
|
|
459
|
+
2. Create a feature branch from `main`.
|
|
460
|
+
3. Make your changes, including tests and documentation updates.
|
|
461
|
+
4. Ensure tests and pre-commit hooks pass.
|
|
462
|
+
5. Commit your changes and push to your fork.
|
|
463
|
+
6. Open a pull request against the `main` branch of `jlowin/fastmcp`.
|
|
444
464
|
|
|
445
|
-
Please open an issue or discussion for questions or suggestions before starting significant work!
|
|
465
|
+
Please open an issue or discussion for questions or suggestions before starting significant work!
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- omit in toc -->
|
|
4
4
|
# FastMCP v2 🚀
|
|
5
|
+
|
|
5
6
|
<strong>The fast, Pythonic way to build MCP servers and clients.</strong>
|
|
6
7
|
|
|
7
8
|
*FastMCP is made with 💙 by [Prefect](https://www.prefect.io/)*
|
|
@@ -15,13 +16,16 @@
|
|
|
15
16
|
</div>
|
|
16
17
|
|
|
17
18
|
> [!Note]
|
|
19
|
+
>
|
|
18
20
|
> #### Beyond the Protocol
|
|
19
|
-
>
|
|
20
|
-
> 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.
|
|
21
21
|
>
|
|
22
|
-
> FastMCP
|
|
22
|
+
> FastMCP is the standard framework for working with the Model Context Protocol. FastMCP 1.0 was incorporated into the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk) in 2024.
|
|
23
|
+
>
|
|
24
|
+
> This is FastMCP 2.0, the **actively maintained version** that provides a complete toolkit for working with the MCP ecosystem.
|
|
23
25
|
>
|
|
24
|
-
>
|
|
26
|
+
> FastMCP 2.0 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 deployment, auth, clients, server proxying and composition, generating servers from REST APIs, dynamic tool rewriting, built-in testing tools, integrations, and more.
|
|
27
|
+
>
|
|
28
|
+
> Ready to upgrade or get started? Follow the [installation instructions](https://gofastmcp.com/getting-started/installation), which include steps for upgrading from the official MCP SDK.
|
|
25
29
|
|
|
26
30
|
---
|
|
27
31
|
|
|
@@ -43,6 +47,7 @@ if __name__ == "__main__":
|
|
|
43
47
|
```
|
|
44
48
|
|
|
45
49
|
Run the server locally:
|
|
50
|
+
|
|
46
51
|
```bash
|
|
47
52
|
fastmcp run server.py
|
|
48
53
|
```
|
|
@@ -51,9 +56,10 @@ fastmcp run server.py
|
|
|
51
56
|
|
|
52
57
|
FastMCP's complete documentation is available at **[gofastmcp.com](https://gofastmcp.com)**, including detailed guides, API references, and advanced patterns. This readme provides only a high-level overview.
|
|
53
58
|
|
|
54
|
-
Documentation is also available in [llms.txt format](https://llmstxt.org/), which is a simple markdown standard that LLMs can consume easily.
|
|
59
|
+
Documentation is also available in [llms.txt format](https://llmstxt.org/), which is a simple markdown standard that LLMs can consume easily.
|
|
55
60
|
|
|
56
61
|
There are two ways to access the LLM-friendly documentation:
|
|
62
|
+
|
|
57
63
|
- [`llms.txt`](https://gofastmcp.com/llms.txt) is essentially a sitemap, listing all the pages in the documentation.
|
|
58
64
|
- [`llms-full.txt`](https://gofastmcp.com/llms-full.txt) contains the entire documentation. Note this may exceed the context window of your LLM.
|
|
59
65
|
|
|
@@ -143,7 +149,7 @@ Learn more in the [**FastMCP Server Documentation**](https://gofastmcp.com/serve
|
|
|
143
149
|
|
|
144
150
|
### Tools
|
|
145
151
|
|
|
146
|
-
Tools allow LLMs to perform actions by executing your Python functions (sync or async). Ideal for computations, API calls, or side effects (like `POST`/`PUT`). FastMCP handles schema generation from type hints and docstrings. Tools can return various types, including text, JSON-serializable objects, and even images
|
|
152
|
+
Tools allow LLMs to perform actions by executing your Python functions (sync or async). Ideal for computations, API calls, or side effects (like `POST`/`PUT`). FastMCP handles schema generation from type hints and docstrings. Tools can return various types, including text, JSON-serializable objects, and even images or audio aided by the FastMCP media helper classes.
|
|
147
153
|
|
|
148
154
|
```python
|
|
149
155
|
@mcp.tool
|
|
@@ -189,12 +195,13 @@ Learn more in the [**Prompts Documentation**](https://gofastmcp.com/servers/prom
|
|
|
189
195
|
### Context
|
|
190
196
|
|
|
191
197
|
Access MCP session capabilities within your tools, resources, or prompts by adding a `ctx: Context` parameter. Context provides methods for:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
+
|
|
199
|
+
- **Logging:** Log messages to MCP clients with `ctx.info()`, `ctx.error()`, etc.
|
|
200
|
+
- **LLM Sampling:** Use `ctx.sample()` to request completions from the client's LLM.
|
|
201
|
+
- **HTTP Request:** Use `ctx.http_request()` to make HTTP requests to other servers.
|
|
202
|
+
- **Resource Access:** Use `ctx.read_resource()` to access resources on the server
|
|
203
|
+
- **Progress Reporting:** Use `ctx.report_progress()` to report progress to the client.
|
|
204
|
+
- and more...
|
|
198
205
|
|
|
199
206
|
To access the context, add a parameter annotated as `Context` to any mcp-decorated function. FastMCP will automatically inject the correct context object when the function is called.
|
|
200
207
|
|
|
@@ -334,16 +341,19 @@ if __name__ == "__main__":
|
|
|
334
341
|
FastMCP supports three transport protocols:
|
|
335
342
|
|
|
336
343
|
**STDIO (Default)**: Best for local tools and command-line scripts.
|
|
344
|
+
|
|
337
345
|
```python
|
|
338
346
|
mcp.run(transport="stdio") # Default, so transport argument is optional
|
|
339
347
|
```
|
|
340
348
|
|
|
341
349
|
**Streamable HTTP**: Recommended for web deployments.
|
|
350
|
+
|
|
342
351
|
```python
|
|
343
|
-
mcp.run(transport="
|
|
352
|
+
mcp.run(transport="http", host="127.0.0.1", port=8000, path="/mcp")
|
|
344
353
|
```
|
|
345
354
|
|
|
346
355
|
**SSE**: For compatibility with existing SSE clients.
|
|
356
|
+
|
|
347
357
|
```python
|
|
348
358
|
mcp.run(transport="sse", host="127.0.0.1", port=8000)
|
|
349
359
|
```
|
|
@@ -356,22 +366,26 @@ Contributions are the core of open source! We welcome improvements and features.
|
|
|
356
366
|
|
|
357
367
|
### Prerequisites
|
|
358
368
|
|
|
359
|
-
|
|
360
|
-
|
|
369
|
+
- Python 3.10+
|
|
370
|
+
- [uv](https://docs.astral.sh/uv/) (Recommended for environment management)
|
|
361
371
|
|
|
362
372
|
### Setup
|
|
363
373
|
|
|
364
|
-
1. Clone the repository:
|
|
374
|
+
1. Clone the repository:
|
|
375
|
+
|
|
365
376
|
```bash
|
|
366
377
|
git clone https://github.com/jlowin/fastmcp.git
|
|
367
378
|
cd fastmcp
|
|
368
379
|
```
|
|
369
|
-
|
|
380
|
+
|
|
381
|
+
2. Create and sync the environment:
|
|
382
|
+
|
|
370
383
|
```bash
|
|
371
384
|
uv sync
|
|
372
385
|
```
|
|
386
|
+
|
|
373
387
|
This installs all dependencies, including dev tools.
|
|
374
|
-
|
|
388
|
+
|
|
375
389
|
3. Activate the virtual environment (e.g., `source .venv/bin/activate` or via your IDE).
|
|
376
390
|
|
|
377
391
|
### Unit Tests
|
|
@@ -379,10 +393,13 @@ Contributions are the core of open source! We welcome improvements and features.
|
|
|
379
393
|
FastMCP has a comprehensive unit test suite. All PRs must introduce or update tests as appropriate and pass the full suite.
|
|
380
394
|
|
|
381
395
|
Run tests using pytest:
|
|
396
|
+
|
|
382
397
|
```bash
|
|
383
398
|
pytest
|
|
384
399
|
```
|
|
400
|
+
|
|
385
401
|
or if you want an overview of the code coverage
|
|
402
|
+
|
|
386
403
|
```bash
|
|
387
404
|
uv run pytest --cov=src --cov=examples --cov-report=html
|
|
388
405
|
```
|
|
@@ -392,10 +409,13 @@ uv run pytest --cov=src --cov=examples --cov-report=html
|
|
|
392
409
|
FastMCP uses `pre-commit` for code formatting, linting, and type-checking. All PRs must pass these checks (they run automatically in CI).
|
|
393
410
|
|
|
394
411
|
Install the hooks locally:
|
|
412
|
+
|
|
395
413
|
```bash
|
|
396
414
|
uv run pre-commit install
|
|
397
415
|
```
|
|
416
|
+
|
|
398
417
|
The hooks will now run automatically on `git commit`. You can also run them manually at any time:
|
|
418
|
+
|
|
399
419
|
```bash
|
|
400
420
|
pre-commit run --all-files
|
|
401
421
|
# or via uv
|
|
@@ -404,11 +424,11 @@ uv run pre-commit run --all-files
|
|
|
404
424
|
|
|
405
425
|
### Pull Requests
|
|
406
426
|
|
|
407
|
-
1.
|
|
408
|
-
2.
|
|
409
|
-
3.
|
|
410
|
-
4.
|
|
411
|
-
5.
|
|
412
|
-
6.
|
|
427
|
+
1. Fork the repository on GitHub.
|
|
428
|
+
2. Create a feature branch from `main`.
|
|
429
|
+
3. Make your changes, including tests and documentation updates.
|
|
430
|
+
4. Ensure tests and pre-commit hooks pass.
|
|
431
|
+
5. Commit your changes and push to your fork.
|
|
432
|
+
6. Open a pull request against the `main` branch of `jlowin/fastmcp`.
|
|
413
433
|
|
|
414
|
-
Please open an issue or discussion for questions or suggestions before starting significant work!
|
|
434
|
+
Please open an issue or discussion for questions or suggestions before starting significant work!
|