fastmcp 2.4.0__tar.gz → 2.5.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.4.0 → fastmcp-2.5.0}/PKG-INFO +4 -4
- {fastmcp-2.4.0 → fastmcp-2.5.0}/README.md +3 -3
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/clients/client.mdx +2 -2
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/clients/transports.mdx +3 -3
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/docs.json +1 -2
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/getting-started/installation.mdx +14 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/getting-started/welcome.mdx +4 -8
- fastmcp-2.5.0/docs/patterns/fastapi.mdx +47 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/composition.mdx +3 -1
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/context.mdx +4 -3
- fastmcp-2.5.0/docs/servers/openapi.mdx +469 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/proxy.mdx +1 -1
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/resources.mdx +15 -6
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/tools.mdx +20 -8
- fastmcp-2.5.0/examples/tags_example.py +141 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/pyproject.toml +6 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/client.py +23 -1
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/transports.py +68 -18
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/prompts/prompt.py +11 -4
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/prompts/prompt_manager.py +25 -5
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/resources/resource_manager.py +31 -5
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/resources/template.py +10 -5
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/context.py +46 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/http.py +2 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/openapi.py +324 -64
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/server.py +101 -49
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/settings.py +30 -1
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/tools/tool.py +5 -1
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/tools/tool_manager.py +9 -2
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/logging.py +6 -1
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/mcp_config.py +4 -3
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_client.py +85 -5
- fastmcp-2.5.0/tests/client/test_openapi.py +192 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/contrib/test_bulk_tool_caller.py +3 -1
- fastmcp-2.5.0/tests/deprecated/test_route_type_ignore.py +113 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/prompts/test_prompt.py +24 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/prompts/test_prompt_manager.py +46 -2
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/resources/test_resource_manager.py +38 -35
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/resources/test_resource_template.py +25 -0
- fastmcp-2.5.0/tests/server/http/test_custom_routes.py +105 -0
- fastmcp-2.5.0/tests/server/http/test_http_dependencies.py +168 -0
- {fastmcp-2.4.0/tests/server → fastmcp-2.5.0/tests/server/openapi}/test_openapi.py +469 -223
- {fastmcp-2.4.0/tests/server → fastmcp-2.5.0/tests/server/openapi}/test_openapi_path_parameters.py +7 -9
- fastmcp-2.5.0/tests/server/openapi/test_route_map_fn.py +377 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_context.py +29 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_server_interactions.py +46 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/tools/test_tool.py +31 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/tools/test_tool_manager.py +111 -5
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/openapi/test_openapi_fastapi.py +9 -9
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_mcp_config.py +2 -2
- fastmcp-2.5.0/tests/utilities/test_tests.py +10 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/uv.lock +17 -2
- fastmcp-2.4.0/docs/patterns/fastapi.mdx +0 -144
- fastmcp-2.4.0/docs/patterns/openapi.mdx +0 -263
- fastmcp-2.4.0/tests/server/test_http_dependencies.py +0 -102
- fastmcp-2.4.0/tests/utilities/test_tests.py +0 -9
- {fastmcp-2.4.0 → fastmcp-2.5.0}/.cursor/rules/core-mcp-objects.mdc +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/ISSUE_TEMPLATE/bug.yml +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/ISSUE_TEMPLATE/enhancement.yml +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/labeler.yml +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/release.yml +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/workflows/labeler.yml +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/workflows/publish.yml +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/workflows/run-static.yml +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/.github/workflows/run-tests.yml +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/.gitignore +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/.pre-commit-config.yaml +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/AGENTS.md +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/LICENSE +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/Windows_Notes.md +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/assets/demo-inspector.png +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/clients/advanced-features.mdx +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/deployment/asgi.mdx +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/deployment/authentication.mdx +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/deployment/cli.mdx +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/deployment/running-server.mdx +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/getting-started/quickstart.mdx +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/patterns/contrib.mdx +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/patterns/decorating-methods.mdx +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/patterns/http-requests.mdx +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/patterns/testing.mdx +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/fastmcp.mdx +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/servers/prompts.mdx +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/snippets/version-badge.mdx +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/docs/style.css +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/complex_inputs.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/desktop.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/echo.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/in_memory_proxy_example.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/memory.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/mount_example.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/sampling.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/screenshot.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/serializer.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/simple_echo.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/README.md +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/pyproject.toml +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/__main__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/hub.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/lights/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/lights/hue_utils.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/lights/server.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/py.typed +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/src/smart_home/settings.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/smart_home/uv.lock +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/examples/text_me.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/justfile +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/cli/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/cli/claude.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/cli/cli.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/cli/run.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/base.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/logging.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/progress.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/roots.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/client/sampling.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/README.md +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/bulk_tool_caller/README.md +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/bulk_tool_caller/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/bulk_tool_caller/bulk_tool_caller.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/bulk_tool_caller/example.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/mcp_mixin/README.md +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/mcp_mixin/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/mcp_mixin/example.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/contrib/mcp_mixin/mcp_mixin.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/exceptions.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/low_level/README.md +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/low_level/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/prompts/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/py.typed +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/resources/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/resources/resource.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/resources/types.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/dependencies.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/server/proxy.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/tools/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/cache.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/decorators.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/exceptions.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/json_schema.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/openapi.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/tests.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/src/fastmcp/utilities/types.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/cli/test_cli.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/cli/test_run.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_logs.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_progress.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_roots.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_sampling.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_sse.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/client/test_streamable_http.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/conftest.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/contrib/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/contrib/test_mcp_mixin.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/deprecated/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/deprecated/test_deprecated.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/deprecated/test_mount_separators.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/deprecated/test_resource_prefixes.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/prompts/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/resources/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/resources/test_file_resources.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/resources/test_function_resources.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/resources/test_resources.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/__init__.py +0 -0
- {fastmcp-2.4.0/tests/server → fastmcp-2.5.0/tests/server/http}/test_http_middleware.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_app_state.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_auth_integration.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_file_server.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_import_server.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_lifespan.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_logging.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_mount.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_proxy.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_resource_prefix_formats.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_run_server.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_server.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/server/test_tool_annotations.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/test_examples.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/test_servers/fastmcp_server.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/test_servers/sse.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/test_servers/stdio.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/tools/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/openapi/__init__.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/openapi/conftest.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/openapi/test_openapi.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/openapi/test_openapi_advanced.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_cache.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_decorated_function.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_json_schema.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_logging.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_typeadapter.py +0 -0
- {fastmcp-2.4.0 → fastmcp-2.5.0}/tests/utilities/test_types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastmcp
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5.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
|
|
@@ -44,11 +44,11 @@ Description-Content-Type: text/markdown
|
|
|
44
44
|
> [!NOTE]
|
|
45
45
|
> #### FastMCP 2.0 & The Official MCP SDK
|
|
46
46
|
>
|
|
47
|
-
>
|
|
47
|
+
> FastMCP is the standard framework for building MCP servers and clients. FastMCP 1.0 was incorporated into the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk).
|
|
48
48
|
>
|
|
49
|
-
> **
|
|
49
|
+
> **This is FastMCP 2.0,** the actively maintained version that significantly expands on 1.0's basic server-building capabilities by introducing full client support, server composition, OpenAPI/FastAPI integration, remote server proxying, built-in testing tools, and more.
|
|
50
50
|
>
|
|
51
|
-
> FastMCP 2.0 is the
|
|
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
52
|
|
|
53
53
|
---
|
|
54
54
|
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
> [!NOTE]
|
|
16
16
|
> #### FastMCP 2.0 & The Official MCP SDK
|
|
17
17
|
>
|
|
18
|
-
>
|
|
18
|
+
> FastMCP is the standard framework for building MCP servers and clients. FastMCP 1.0 was incorporated into the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk).
|
|
19
19
|
>
|
|
20
|
-
> **
|
|
20
|
+
> **This is FastMCP 2.0,** the actively maintained version that significantly expands on 1.0's basic server-building capabilities by introducing full client support, server composition, OpenAPI/FastAPI integration, remote server proxying, built-in testing tools, and more.
|
|
21
21
|
>
|
|
22
|
-
> FastMCP 2.0 is the
|
|
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.
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
@@ -37,7 +37,7 @@ Clients must be initialized with a `transport`. You can either provide an alread
|
|
|
37
37
|
The following inference rules are used to determine the appropriate `ClientTransport` based on the input type:
|
|
38
38
|
|
|
39
39
|
1. **`ClientTransport` Instance**: If you provide an already instantiated transport object, it's used directly.
|
|
40
|
-
2. **`FastMCP` Instance**: Creates a `FastMCPTransport` for efficient in-memory communication (ideal for testing).
|
|
40
|
+
2. **`FastMCP` Instance**: Creates a `FastMCPTransport` for efficient in-memory communication (ideal for testing). This also works with a **FastMCP 1.0 server** created via `mcp.server.fastmcp.FastMCP`.
|
|
41
41
|
3. **`Path` or `str` pointing to an existing file**:
|
|
42
42
|
* If it ends with `.py`: Creates a `PythonStdioTransport` to run the script using `python`.
|
|
43
43
|
* If it ends with `.js`: Creates a `NodeStdioTransport` to run the script using `node`.
|
|
@@ -91,7 +91,7 @@ For more control over connection details (like headers for SSE, environment vari
|
|
|
91
91
|
|
|
92
92
|
### Multi-Server Clients
|
|
93
93
|
|
|
94
|
-
<VersionBadge version="2.
|
|
94
|
+
<VersionBadge version="2.4.0" />
|
|
95
95
|
|
|
96
96
|
FastMCP supports creating clients that connect to multiple MCP servers through a single client interface using a standard MCP configuration format (`MCPConfig`). This configuration approach makes it easy to connect to multiple specialized servers or create composable systems with a simple, declarative syntax.
|
|
97
97
|
|
|
@@ -290,8 +290,8 @@ asyncio.run(main())
|
|
|
290
290
|
### FastMCP Transport
|
|
291
291
|
|
|
292
292
|
- **Class:** `fastmcp.client.transports.FastMCPTransport`
|
|
293
|
-
- **Inferred From:** An instance of `fastmcp.server.FastMCP`
|
|
294
|
-
- **Use Case:** Connecting directly to a
|
|
293
|
+
- **Inferred From:** An instance of `fastmcp.server.FastMCP` or a **FastMCP 1.0 server** (`mcp.server.fastmcp.FastMCP`)
|
|
294
|
+
- **Use Case:** Connecting directly to a FastMCP server instance in the same Python process
|
|
295
295
|
|
|
296
296
|
This is extremely useful for testing your FastMCP servers.
|
|
297
297
|
|
|
@@ -323,7 +323,7 @@ Communication happens through efficient in-memory queues, making it very fast an
|
|
|
323
323
|
|
|
324
324
|
### MCPConfig Transport
|
|
325
325
|
|
|
326
|
-
<VersionBadge version="2.
|
|
326
|
+
<VersionBadge version="2.4.0" />
|
|
327
327
|
|
|
328
328
|
- **Class:** `fastmcp.client.transports.MCPConfigTransport`
|
|
329
329
|
- **Inferred From:** An instance of `MCPConfig` or a dictionary matching the MCPConfig schema
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"servers/resources",
|
|
51
51
|
"servers/prompts",
|
|
52
52
|
"servers/context",
|
|
53
|
+
"servers/openapi",
|
|
53
54
|
"servers/proxy",
|
|
54
55
|
"servers/composition"
|
|
55
56
|
]
|
|
@@ -76,8 +77,6 @@
|
|
|
76
77
|
"pages": [
|
|
77
78
|
"patterns/decorating-methods",
|
|
78
79
|
"patterns/http-requests",
|
|
79
|
-
"patterns/openapi",
|
|
80
|
-
"patterns/fastapi",
|
|
81
80
|
"patterns/contrib",
|
|
82
81
|
"patterns/testing"
|
|
83
82
|
]
|
|
@@ -60,6 +60,20 @@ mcp = FastMCP("My MCP Server")
|
|
|
60
60
|
Prior to `fastmcp==2.3.0` and `mcp==1.8.0`, the 2.x API always mirrored the 1.0 API. However, as the projects diverge, this can not be guaranteed. You may see deprecation warnings if you attempt to use 1.0 APIs in FastMCP 2.x. Please refer to this documentation for details on new capabilities.
|
|
61
61
|
</Warning>
|
|
62
62
|
|
|
63
|
+
## Versioning and Breaking Changes
|
|
64
|
+
|
|
65
|
+
While we make every effort not to introduce backwards-incompatible changes to our public APIs and behavior, FastMCP exists in a rapidly evolving MCP landscape. We're committed to bringing the most cutting-edge features to our users, which occasionally necessitates changes to existing functionality.
|
|
66
|
+
|
|
67
|
+
As a practice, breaking changes will only occur on minor version changes (e.g., 2.3.x to 2.4.0). A minor version change indicates either:
|
|
68
|
+
- A significant new feature set that warrants a new minor version
|
|
69
|
+
- Introducing breaking changes that may affect behavior on upgrade
|
|
70
|
+
|
|
71
|
+
For users concerned about stability in production environments, we recommend pinning FastMCP to a specific version in your dependencies.
|
|
72
|
+
|
|
73
|
+
Whenever possible, FastMCP will issue deprecation warnings when users attempt to use APIs that are either deprecated or destined for future removal. These warnings will be maintained for at least 1 minor version release, and may be maintained longer.
|
|
74
|
+
|
|
75
|
+
Note that the "public API" includes the core functionality of the `FastMCP` server and its methods. It does not include private methods or objects that are stored as private attributes, as we do not expect users to rely on those implementation details.
|
|
76
|
+
|
|
63
77
|
## Installing for Development
|
|
64
78
|
|
|
65
79
|
If you plan to contribute to FastMCP, you should begin by cloning the repository and using uv to install all dependencies (development dependencies are installed automatically):
|
|
@@ -24,17 +24,13 @@ if __name__ == "__main__":
|
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
## FastMCP
|
|
27
|
+
## FastMCP and the Official MCP SDK
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
Recognize the `FastMCP` name? You might have seen the version that was contributed to the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk), which was based on **FastMCP 1.0**.
|
|
29
|
+
FastMCP is the standard framework for building MCP servers and clients. FastMCP 1.0 was incorporated into the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk).
|
|
31
30
|
|
|
31
|
+
**This is FastMCP 2.0,** the [actively maintained version](https://github.com/jlowin/fastmcp) that significantly expands on 1.0's basic server-building capabilities by introducing full client support, server composition, OpenAPI/FastAPI integration, remote server proxying, built-in testing tools, and more.
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
FastMCP 2.0 is the recommended path for building modern, powerful MCP applications. Ready to upgrade or get started? Follow the [installation instructions](/getting-started/installation), which include specific steps for upgrading.
|
|
36
|
-
</Tip>
|
|
37
|
-
|
|
33
|
+
FastMCP 2.0 is the complete toolkit for modern AI applications. Ready to upgrade or get started? Follow the [installation instructions](/getting-started/installation), which include specific steps for upgrading from the official MCP SDK.
|
|
38
34
|
|
|
39
35
|
|
|
40
36
|
## What is MCP?
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: FastAPI Integration
|
|
3
|
+
sidebarTitle: FastAPI
|
|
4
|
+
description: Generate MCP servers from FastAPI apps
|
|
5
|
+
icon: square-bolt
|
|
6
|
+
---
|
|
7
|
+
import { VersionBadge } from '/snippets/version-badge.mdx'
|
|
8
|
+
|
|
9
|
+
<VersionBadge version="2.0.0" />
|
|
10
|
+
|
|
11
|
+
<Note>
|
|
12
|
+
**Documentation Moved**: The comprehensive FastAPI integration documentation has been moved to the [OpenAPI Integration](/patterns/openapi#fastapi-integration) page, where it's covered alongside all other OpenAPI features including route mapping and tags support.
|
|
13
|
+
</Note>
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
FastMCP can automatically convert FastAPI applications into MCP servers:
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from fastapi import FastAPI
|
|
21
|
+
from fastmcp import FastMCP
|
|
22
|
+
|
|
23
|
+
# A FastAPI app
|
|
24
|
+
app = FastAPI()
|
|
25
|
+
|
|
26
|
+
@app.get("/items")
|
|
27
|
+
def list_items():
|
|
28
|
+
return [{"id": 1, "name": "Item 1"}, {"id": 2, "name": "Item 2"}]
|
|
29
|
+
|
|
30
|
+
@app.get("/items/{item_id}")
|
|
31
|
+
def get_item(item_id: int):
|
|
32
|
+
return {"id": item_id, "name": f"Item {item_id}"}
|
|
33
|
+
|
|
34
|
+
@app.post("/items")
|
|
35
|
+
def create_item(name: str):
|
|
36
|
+
return {"id": 3, "name": name}
|
|
37
|
+
|
|
38
|
+
# Create an MCP server from your FastAPI app
|
|
39
|
+
mcp = FastMCP.from_fastapi(app=app)
|
|
40
|
+
|
|
41
|
+
if __name__ == "__main__":
|
|
42
|
+
mcp.run() # Start the MCP server
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
<Tip>
|
|
46
|
+
For complete documentation including tag-based routing, route mapping configuration, timeout settings, authentication examples, and advanced configuration options, see the comprehensive [OpenAPI Integration documentation](/patterns/openapi#fastapi-integration).
|
|
47
|
+
</Tip>
|
|
@@ -35,7 +35,7 @@ The choice of importing or mounting depends on your use case and requirements.
|
|
|
35
35
|
|
|
36
36
|
FastMCP supports [MCP proxying](/patterns/proxy), which allows you to mirror a local or remote server in a local FastMCP instance. Proxies are fully compatible with both importing and mounting.
|
|
37
37
|
|
|
38
|
-
<VersionBadge version="2.
|
|
38
|
+
<VersionBadge version="2.4.0" />
|
|
39
39
|
|
|
40
40
|
You can also create proxies from configuration dictionaries that follow the MCPConfig schema, which is useful for quickly connecting to one or more remote servers. See the [Proxy Servers documentation](/servers/proxy#configuration-based-proxies) for details on configuration-based proxying. Note that MCPConfig follows an emerging standard and its format may evolve over time.
|
|
41
41
|
|
|
@@ -185,6 +185,8 @@ main_server.mount("remote", remote_proxy)
|
|
|
185
185
|
|
|
186
186
|
## Resource Prefix Formats
|
|
187
187
|
|
|
188
|
+
<VersionBadge version="2.4.0" />
|
|
189
|
+
|
|
188
190
|
When mounting or importing servers, resource URIs are usually prefixed to avoid naming conflicts. FastMCP supports two different formats for resource prefixes:
|
|
189
191
|
|
|
190
192
|
### Path Format (Default)
|
|
@@ -228,8 +228,8 @@ async def analyze_sentiment(text: str, ctx: Context) -> dict:
|
|
|
228
228
|
# Create a sampling prompt asking for sentiment analysis
|
|
229
229
|
prompt = f"Analyze the sentiment of the following text as positive, negative, or neutral. Just output a single word - 'positive', 'negative', or 'neutral'. Text to analyze: {text}"
|
|
230
230
|
|
|
231
|
-
# Send the sampling request to the client's LLM
|
|
232
|
-
response = await ctx.sample(prompt)
|
|
231
|
+
# Send the sampling request to the client's LLM (provide a hint for the model you want to use)
|
|
232
|
+
response = await ctx.sample(prompt, model_preferences="claude-3-sonnet")
|
|
233
233
|
|
|
234
234
|
# Process the LLM's response
|
|
235
235
|
sentiment = response.text.strip().lower()
|
|
@@ -247,11 +247,12 @@ async def analyze_sentiment(text: str, ctx: Context) -> dict:
|
|
|
247
247
|
|
|
248
248
|
**Method signature:**
|
|
249
249
|
|
|
250
|
-
- **`ctx.sample(messages: str | list[str | SamplingMessage], system_prompt: str | None = None, temperature: float | None = None, max_tokens: int | None = None) -> TextContent | ImageContent`**
|
|
250
|
+
- **`ctx.sample(messages: str | list[str | SamplingMessage], system_prompt: str | None = None, temperature: float | None = None, max_tokens: int | None = None, model_preferences: ModelPreferences | str | list[str] | None = None) -> TextContent | ImageContent`**
|
|
251
251
|
- `messages`: A string or list of strings/message objects to send to the LLM
|
|
252
252
|
- `system_prompt`: Optional system prompt to guide the LLM's behavior
|
|
253
253
|
- `temperature`: Optional sampling temperature (controls randomness)
|
|
254
254
|
- `max_tokens`: Optional maximum number of tokens to generate (defaults to 512)
|
|
255
|
+
- `model_preferences`: Optional model selection preferences (e.g., a model hint string, list of hints, or a ModelPreferences object)
|
|
255
256
|
- Returns the LLM's response as TextContent or ImageContent
|
|
256
257
|
|
|
257
258
|
When providing a simple string, it's treated as a user message. For more complex scenarios, you can provide a list of messages with different roles.
|