mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-28 02:10:38 +02:00
Add missing 3.0.0 version badges and document tasks extra (#2866)
This commit is contained in:
parent
8c471a499d
commit
7ee3bec727
4 changed files with 27 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
<VersionBadge version="3.0.0" />
|
||||
|
||||
During development, you can use the `--reload` flag to automatically restart your server when source files change:
|
||||
|
||||
```bash
|
||||
|
|
|
|||
|
|
@ -23,6 +23,17 @@ Alternatively, you can install it directly with `pip` or `uv pip`:
|
|||
```
|
||||
</CodeGroup>
|
||||
|
||||
### 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:
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ icon: heart-pulse
|
|||
tag: NEW
|
||||
---
|
||||
|
||||
import { VersionBadge } from '/snippets/version-badge.mdx'
|
||||
|
||||
<VersionBadge version="3.0.0" />
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -36,6 +36,14 @@ MCP background tasks are different: they're **protocol-native**. This means MCP
|
|||
|
||||
## Enabling Background Tasks
|
||||
|
||||
<VersionBadge version="3.0.0" /> 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}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue