You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add start_mcp_server tool for dynamic MCP server startup
Allow LLM to start MCP servers from conversation context when a user
provides a command (e.g. npx ...) or URL. The tool connects to the
server and returns fully qualified tool names (mcp_{server}_{tool})
that the model discovers via tool_search.
McpPool infrastructure:
- Add dynamic_servers (parking_lot::RwLock) for runtime server configs
- add_runtime_server_config() rejects duplicate names (static or dynamic)
- get_or_connect() checks dynamic servers before static config
- server_names() includes both static and dynamic servers
Engine integration:
- Lazy pool initialization via ensure_mcp_pool() with network_policy wiring
- No eager McpPool construction in Engine::new
- start_mcp_server gated behind Feature::Mcp via tool_setup registration
- Dynamic always_load injection ensures the tool is eager (not deferred)
Security:
- ApprovalRequirement::Required — requires user approval before spawning
- Non-bypassable approval — YOLO mode cannot skip (registered_tool_requires_non_bypassable_approval)
- Reject shell wrapper commands (bash, sh, zsh, cmd, powershell)
- Reject shell metacharacters in args (redirects, pipes, chaining, $, backticks)
- Allowlist of permitted runtimes (npx, node, python, uvx, deno, ruby, cargo, etc.)
- Underscores in server names auto-converted to hyphens to prevent tool name collision
Tool implementation:
- Shell-words parsing for quoted arguments
- Name inference for npm/pnpm/node/python/uvx and Windows cmd /c
- McpAction approval classification
- with_runtime_mcp_tool() builder avoids McpToolAdapter duplication
0 commit comments