mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-30 23:02:50 +00:00
fix: address review comments for MCP stdio command allowlist
- Remove unused pytest import from test_stdio_config.py - Strip file extension from base_command for Windows compatibility (e.g., python.exe -> python) using os.path.splitext Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -69,6 +69,8 @@ class StdioTransport(BaseTransport):
|
||||
|
||||
if allowed_commands is not None:
|
||||
base_command = os.path.basename(command)
|
||||
# Strip extension for Windows compatibility (e.g., python.exe -> python)
|
||||
base_command = os.path.splitext(base_command)[0]
|
||||
if base_command not in allowed_commands:
|
||||
raise ValueError(
|
||||
f"Command '{command}' is not in the allowed commands list: "
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
"""Tests for MCPServerStdio allowed_commands config integration."""
|
||||
|
||||
import pytest
|
||||
|
||||
from crewai.mcp.config import MCPServerStdio
|
||||
from crewai.mcp.transports.stdio import DEFAULT_ALLOWED_COMMANDS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user