mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-20 04:24:17 +02:00
Scope validation to shell-backed install paths only
This commit is contained in:
parent
cc2e3ab11f
commit
a40e6ad2f3
3 changed files with 6 additions and 4 deletions
|
|
@ -12,7 +12,7 @@ from rich import print
|
|||
from fastmcp.utilities.logging import get_logger
|
||||
from fastmcp.utilities.mcp_server_config.v1.environments.uv import UVEnvironment
|
||||
|
||||
from .shared import process_common_args
|
||||
from .shared import process_common_args, validate_server_name
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
|
|
@ -124,6 +124,8 @@ def install_claude_code(
|
|||
# Build the full command
|
||||
full_command = env_config.build_command(["fastmcp", "run", server_spec])
|
||||
|
||||
validate_server_name(name)
|
||||
|
||||
# Build claude mcp add command
|
||||
cmd_parts = [claude_cmd, "mcp", "add", name]
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from rich import print
|
|||
from fastmcp.utilities.logging import get_logger
|
||||
from fastmcp.utilities.mcp_server_config.v1.environments.uv import UVEnvironment
|
||||
|
||||
from .shared import process_common_args
|
||||
from .shared import process_common_args, validate_server_name
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
|
|
@ -129,6 +129,8 @@ def install_gemini_cli(
|
|||
for key, value in env_vars.items():
|
||||
cmd_parts.extend(["-e", f"{key}={value}"])
|
||||
|
||||
validate_server_name(name)
|
||||
|
||||
# Add server name and command
|
||||
cmd_parts.extend([name, full_command[0], "--"])
|
||||
cmd_parts.extend(full_command[1:])
|
||||
|
|
|
|||
|
|
@ -144,8 +144,6 @@ async def process_common_args(
|
|||
)
|
||||
name = file.stem
|
||||
|
||||
validate_server_name(name)
|
||||
|
||||
# Process environment variables if provided
|
||||
env_dict: dict[str, str] | None = None
|
||||
if env_file or env_vars:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue