fastmcp 2.11.3__py3-none-any.whl → 2.12.0rc1__py3-none-any.whl
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/__init__.py +5 -4
- fastmcp/cli/claude.py +22 -18
- fastmcp/cli/cli.py +472 -136
- fastmcp/cli/install/claude_code.py +37 -40
- fastmcp/cli/install/claude_desktop.py +37 -42
- fastmcp/cli/install/cursor.py +148 -38
- fastmcp/cli/install/mcp_json.py +38 -43
- fastmcp/cli/install/shared.py +64 -7
- fastmcp/cli/run.py +122 -215
- fastmcp/client/auth/oauth.py +69 -13
- fastmcp/client/client.py +46 -9
- fastmcp/client/oauth_callback.py +91 -91
- fastmcp/client/sampling.py +12 -4
- fastmcp/client/transports.py +139 -64
- fastmcp/experimental/sampling/__init__.py +0 -0
- fastmcp/experimental/sampling/handlers/__init__.py +3 -0
- fastmcp/experimental/sampling/handlers/base.py +21 -0
- fastmcp/experimental/sampling/handlers/openai.py +163 -0
- fastmcp/experimental/server/openapi/routing.py +0 -2
- fastmcp/experimental/server/openapi/server.py +0 -2
- fastmcp/experimental/utilities/openapi/parser.py +5 -1
- fastmcp/mcp_config.py +40 -20
- fastmcp/prompts/prompt_manager.py +2 -0
- fastmcp/resources/resource_manager.py +4 -0
- fastmcp/server/auth/__init__.py +2 -0
- fastmcp/server/auth/auth.py +2 -1
- fastmcp/server/auth/oauth_proxy.py +1047 -0
- fastmcp/server/auth/providers/azure.py +270 -0
- fastmcp/server/auth/providers/github.py +287 -0
- fastmcp/server/auth/providers/google.py +305 -0
- fastmcp/server/auth/providers/jwt.py +24 -12
- fastmcp/server/auth/providers/workos.py +256 -2
- fastmcp/server/auth/redirect_validation.py +65 -0
- fastmcp/server/context.py +91 -41
- fastmcp/server/elicitation.py +60 -1
- fastmcp/server/http.py +3 -3
- fastmcp/server/middleware/logging.py +66 -28
- fastmcp/server/proxy.py +2 -0
- fastmcp/server/sampling/handler.py +19 -0
- fastmcp/server/server.py +76 -15
- fastmcp/settings.py +16 -1
- fastmcp/tools/tool.py +22 -9
- fastmcp/tools/tool_manager.py +2 -0
- fastmcp/tools/tool_transform.py +39 -10
- fastmcp/utilities/auth.py +34 -0
- fastmcp/utilities/cli.py +148 -15
- fastmcp/utilities/components.py +2 -1
- fastmcp/utilities/inspect.py +166 -37
- fastmcp/utilities/json_schema_type.py +4 -2
- fastmcp/utilities/logging.py +4 -1
- fastmcp/utilities/mcp_config.py +47 -18
- fastmcp/utilities/mcp_server_config/__init__.py +25 -0
- fastmcp/utilities/mcp_server_config/v1/__init__.py +0 -0
- fastmcp/utilities/mcp_server_config/v1/environments/__init__.py +6 -0
- fastmcp/utilities/mcp_server_config/v1/environments/base.py +30 -0
- fastmcp/utilities/mcp_server_config/v1/environments/uv.py +306 -0
- fastmcp/utilities/mcp_server_config/v1/mcp_server_config.py +446 -0
- fastmcp/utilities/mcp_server_config/v1/schema.json +361 -0
- fastmcp/utilities/mcp_server_config/v1/sources/__init__.py +0 -0
- fastmcp/utilities/mcp_server_config/v1/sources/base.py +30 -0
- fastmcp/utilities/mcp_server_config/v1/sources/filesystem.py +216 -0
- fastmcp/utilities/tests.py +7 -2
- fastmcp/utilities/types.py +15 -2
- {fastmcp-2.11.3.dist-info → fastmcp-2.12.0rc1.dist-info}/METADATA +2 -1
- fastmcp-2.12.0rc1.dist-info/RECORD +129 -0
- fastmcp-2.11.3.dist-info/RECORD +0 -108
- {fastmcp-2.11.3.dist-info → fastmcp-2.12.0rc1.dist-info}/WHEEL +0 -0
- {fastmcp-2.11.3.dist-info → fastmcp-2.12.0rc1.dist-info}/entry_points.txt +0 -0
- {fastmcp-2.11.3.dist-info → fastmcp-2.12.0rc1.dist-info}/licenses/LICENSE +0 -0
fastmcp/__init__.py
CHANGED
|
@@ -6,10 +6,11 @@ from fastmcp.settings import Settings
|
|
|
6
6
|
from fastmcp.utilities.logging import configure_logging as _configure_logging
|
|
7
7
|
|
|
8
8
|
settings = Settings()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
if settings.log_enabled:
|
|
10
|
+
_configure_logging(
|
|
11
|
+
level=settings.log_level,
|
|
12
|
+
enable_rich_tracebacks=settings.enable_rich_tracebacks,
|
|
13
|
+
)
|
|
13
14
|
|
|
14
15
|
from fastmcp.server.server import FastMCP
|
|
15
16
|
from fastmcp.server.context import Context
|
fastmcp/cli/claude.py
CHANGED
|
@@ -7,6 +7,7 @@ from pathlib import Path
|
|
|
7
7
|
from typing import Any
|
|
8
8
|
|
|
9
9
|
from fastmcp.utilities.logging import get_logger
|
|
10
|
+
from fastmcp.utilities.mcp_server_config.v1.environments.uv import UVEnvironment
|
|
10
11
|
|
|
11
12
|
logger = get_logger(__name__)
|
|
12
13
|
|
|
@@ -33,7 +34,7 @@ def update_claude_config(
|
|
|
33
34
|
file_spec: str,
|
|
34
35
|
server_name: str,
|
|
35
36
|
*,
|
|
36
|
-
with_editable: Path | None = None,
|
|
37
|
+
with_editable: list[Path] | None = None,
|
|
37
38
|
with_packages: list[str] | None = None,
|
|
38
39
|
env_vars: dict[str, str] | None = None,
|
|
39
40
|
) -> bool:
|
|
@@ -42,7 +43,7 @@ def update_claude_config(
|
|
|
42
43
|
Args:
|
|
43
44
|
file_spec: Path to the server file, optionally with :object suffix
|
|
44
45
|
server_name: Name for the server in Claude's config
|
|
45
|
-
with_editable: Optional
|
|
46
|
+
with_editable: Optional list of directories to install in editable mode
|
|
46
47
|
with_packages: Optional list of additional packages to install
|
|
47
48
|
env_vars: Optional dictionary of environment variables. These are merged with
|
|
48
49
|
any existing variables, with new values taking precedence.
|
|
@@ -89,20 +90,19 @@ def update_claude_config(
|
|
|
89
90
|
else:
|
|
90
91
|
env_vars = existing_env
|
|
91
92
|
|
|
92
|
-
#
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
# Collect all packages in a set to deduplicate
|
|
96
|
-
packages = {"fastmcp"}
|
|
93
|
+
# Deduplicate packages and exclude 'fastmcp' since Environment adds it automatically
|
|
94
|
+
deduplicated_packages = None
|
|
97
95
|
if with_packages:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
96
|
+
deduplicated = list(dict.fromkeys(with_packages))
|
|
97
|
+
deduplicated_packages = [pkg for pkg in deduplicated if pkg != "fastmcp"]
|
|
98
|
+
if not deduplicated_packages:
|
|
99
|
+
deduplicated_packages = None
|
|
100
|
+
|
|
101
|
+
# Build uv run command using Environment.build_uv_run_command()
|
|
102
|
+
env_config = UVEnvironment(
|
|
103
|
+
dependencies=deduplicated_packages,
|
|
104
|
+
editable=[str(p) for p in with_editable] if with_editable else None,
|
|
105
|
+
)
|
|
106
106
|
|
|
107
107
|
# Convert file path to absolute before adding to command
|
|
108
108
|
# Split off any :object suffix first
|
|
@@ -112,10 +112,14 @@ def update_claude_config(
|
|
|
112
112
|
else:
|
|
113
113
|
file_spec = str(Path(file_spec).resolve())
|
|
114
114
|
|
|
115
|
-
#
|
|
116
|
-
|
|
115
|
+
# Build the full command
|
|
116
|
+
full_command = env_config.build_command(["fastmcp", "run", file_spec])
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
# Extract command and args for the config
|
|
119
|
+
server_config: dict[str, Any] = {
|
|
120
|
+
"command": full_command[0],
|
|
121
|
+
"args": full_command[1:],
|
|
122
|
+
}
|
|
119
123
|
|
|
120
124
|
# Add environment variables if specified
|
|
121
125
|
if env_vars:
|