diff --git a/docs/deployment/running-server.mdx b/docs/deployment/running-server.mdx index 7e15055e5..bf4b83161 100644 --- a/docs/deployment/running-server.mdx +++ b/docs/deployment/running-server.mdx @@ -5,6 +5,8 @@ description: Learn how to run your FastMCP server locally for development and te icon: circle-play --- +import { VersionBadge } from '/snippets/version-badge.mdx' + FastMCP servers can be run in different ways depending on your needs. This guide focuses on running servers locally for development and testing. For production deployment to a URL, see the [HTTP Deployment](/deployment/http) guide. ## The `run()` Method @@ -159,6 +161,8 @@ For more CLI features including development mode with the MCP Inspector, see the ### Auto-Reload for Development + + During development, you can use the `--reload` flag to automatically restart your server when source files change: ```bash diff --git a/docs/getting-started/installation.mdx b/docs/getting-started/installation.mdx index bde4b94a8..862c95de1 100644 --- a/docs/getting-started/installation.mdx +++ b/docs/getting-started/installation.mdx @@ -23,6 +23,17 @@ Alternatively, you can install it directly with `pip` or `uv pip`: ``` +### Optional Dependencies + +FastMCP provides optional extras for specific features: + +```bash +# Background tasks (Docket-based distributed task scheduling) +pip install "fastmcp[tasks]" +``` + +See [Background Tasks](/servers/tasks) for details on the task system. + ### Verify Installation To verify that FastMCP is installed correctly, you can run the following command: diff --git a/docs/servers/lifespan.mdx b/docs/servers/lifespan.mdx index 45e1f775e..0e8f07809 100644 --- a/docs/servers/lifespan.mdx +++ b/docs/servers/lifespan.mdx @@ -5,6 +5,10 @@ icon: heart-pulse tag: NEW --- +import { VersionBadge } from '/snippets/version-badge.mdx' + + + Lifespans let you run code once when the server starts and clean up when it stops. Unlike per-session handlers, lifespans run exactly once regardless of how many clients connect. ## Basic Usage diff --git a/docs/servers/tasks.mdx b/docs/servers/tasks.mdx index 1eab75f62..dbc1725d4 100644 --- a/docs/servers/tasks.mdx +++ b/docs/servers/tasks.mdx @@ -36,6 +36,14 @@ MCP background tasks are different: they're **protocol-native**. This means MCP ## Enabling Background Tasks + Background tasks require the `tasks` extra: + +```bash +pip install "fastmcp[tasks]" +# or with uv +uv add "fastmcp[tasks]" +``` + Add `task=True` to any tool, resource, resource template, or prompt decorator. This marks the component as capable of background execution. ```python {6}