Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

Update environment note (#1075)

Jeremiah Lowin45c4ceb1bdef
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 143d664f7..9b1efe160 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -2,7 +2,7 @@ fail_fast: false
repos:
- repo: https://github.com/abravalheri/validate-pyproject
- rev: v0.23
+ rev: v0.24.1
hooks:
- id: validate-pyproject
@@ -14,10 +14,10 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
- rev: v0.11.4
+ rev: v0.12.1
hooks:
# Run the linter.
- - id: ruff
+ - id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
# Run the formatter.
- id: ruff-format
diff --git a/docs/patterns/cli.mdx b/docs/patterns/cli.mdx
index f3833abb1..22b400512 100644
--- a/docs/patterns/cli.mdx
+++ b/docs/patterns/cli.mdx
@@ -160,7 +160,7 @@ fastmcp install cursor server.py
fastmcp install mcp-json server.py
```
-Note that for security reasons, MCP clients run every server in a completely isolated environment. Therefore, all dependencies must be explicitly specified using the `--with` and/or `--with-editable` options (following `uv` conventions) or by attaching them to your server in code via the `dependencies` parameter.
+Note that for security reasons, MCP clients usually run every server in a completely isolated environment. Therefore, all dependencies must be explicitly specified using the `--with` and/or `--with-editable` options (following `uv` conventions) or by attaching them to your server in code via the `dependencies` parameter. You should not assume that the MCP server will have access to your local environment.
<Warning>
**`uv` must be installed and available in your system PATH**. Both Claude Desktop and Cursor run in isolated environments and need `uv` to manage dependencies. On macOS, install `uv` globally with Homebrew for Claude Desktop compatibility: `brew install uv`.
diff --git a/examples/memory.py b/examples/memory.py
index 161f0d7f5..2dc3c09e8 100644
--- a/examples/memory.py
+++ b/examples/memory.py
@@ -15,7 +15,7 @@ import os
from dataclasses import dataclass
from datetime import datetime, timezone
from pathlib import Path
-from typing import Annotated, Self
+from typing import Annotated, Any, Self
import asyncpg
import numpy as np
@@ -60,12 +60,12 @@ def cosine_similarity(a: list[float], b: list[float]) -> float:
)
-async def do_ai[T](
+async def do_ai(
user_prompt: str,
system_prompt: str,
- result_type: type[T] | Annotated,
+ result_type: type | Annotated,
deps=None,
-) -> T:
+) -> Any:
agent = Agent(
DEFAULT_LLM_MODEL,
system_prompt=system_prompt,