Skip to content

Commit 51ae30f

Browse files
committed
feat: validate MCP server type is stdio
1 parent df5385f commit 51ae30f

File tree

1 file changed

+6
-1
lines changed
  • src/datapilot/core/mcp_utils

1 file changed

+6
-1
lines changed

src/datapilot/core/mcp_utils/mcp.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,15 @@ async def list_tools(command: str, args: list[str], env: dict[str, str]):
147147
raise click.UsageError(f"Command not found: {command}")
148148

149149
try:
150+
# Only support stdio server type
151+
server_type = server_config.get("type", "stdio")
152+
if server_type != "stdio":
153+
raise click.UsageError(f"Only stdio MCP servers are supported. Found type: {server_type}")
154+
150155
server_params = StdioServerParameters(
151156
command=command_path,
152157
args=args,
153-
env=env, # Now using processed env
158+
env=env,
154159
)
155160

156161
async with stdio_client(server_params) as (read, write):

0 commit comments

Comments
 (0)