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
I would like strands to support multiple MCP servers. One of the mechanisms to provide this may be loading from a config file.
As outlined in the parent issue #198 the DX for adding MCP tools to an agent can be improved, alongside these improvements it would be great to configure multiple MCP servers and have the lifecycle of client connections be managed automatically.
Refined Requirements
Based on repository analysis and community feedback, here's the refined scope:
Current State ✅
Multiple MCP servers and lifecycle management are already supported programmatically:
Configuration file support for MCP servers - Users must currently define MCP clients programmatically. The experimental agent_config.py does not support MCP configuration.
Proposed Solution
Extend src/strands/experimental/agent_config.py to support MCP server configuration.
Configuration Format
Use JSON format (matching existing agent_config.py pattern):
Problem Statement
I would like strands to support multiple MCP servers. One of the mechanisms to provide this may be loading from a config file.
As outlined in the parent issue #198 the DX for adding MCP tools to an agent can be improved, alongside these improvements it would be great to configure multiple MCP servers and have the lifecycle of client connections be managed automatically.
Refined Requirements
Based on repository analysis and community feedback, here's the refined scope:
Current State ✅
Multiple MCP servers and lifecycle management are already supported programmatically:
Gap ❌
Configuration file support for MCP servers - Users must currently define MCP clients programmatically. The experimental
agent_config.pydoes not support MCP configuration.Proposed Solution
Extend
src/strands/experimental/agent_config.pyto support MCP server configuration.Configuration Format
Use JSON format (matching existing
agent_config.pypattern):{ "name": "my_agent", "model": "us.anthropic.claude-3-5-sonnet-20241022-v2:0", "prompt": "You are a helpful assistant.", "tools": ["strands_tools.file_read"], "mcp_servers": [ { "name": "aws_docs", "transport": "stdio", "command": "uvx", "args": ["awslabs.aws-documentation-mcp-server@latest"], "env": {}, "prefix": "aws", "startup_timeout": 30, "tool_filter": { "allowed": ["search_.*", "get_docs"], "rejected": ["dangerous_tool"] } }, { "name": "local_agent", "transport": "sse", "url": "http://localhost:8000/sse", "headers": { "Authorization": "Bearer ${MCP_AUTH_TOKEN}" }, "timeout": 300, "prefix": "local" }, { "name": "remote_service", "transport": "streamable-http", "url": "https://api.example.com/mcp", "headers": { "X-API-Key": "${API_KEY}" } } ] }Transport Types
stdiocommandargs,env,cwdsseurlheaders,timeoutstreamable-httpurlheaders,timeoutStrands-Specific Options (per server)
nameprefixstartup_timeouttool_filterallowed/rejectedpatterns)Features
${VAR_NAME}syntax for secretsDependencies
Use Cases
Implementation Approach
AGENT_CONFIG_SCHEMAinagent_config.pyto includemcp_serverspropertyMCPClientinstancesAcceptance Criteria
References