Strands MCP Server: Bidirectional MCP Integration 🔌
Expose your Strands agent as an MCP server, or connect to external MCP servers.
Bidirectional MCP integration with HTTP/stdio transports, Claude Desktop support, and full agent invocation.
Installation
Overview
graph LR
subgraph "Your Strands Agent"
A[Tools: calculator, shell, etc.]
B[mcp_server tool]
C[mcp_client tool]
end
subgraph "Server Mode"
B -->|HTTP/stdio| D[MCP Protocol]
D --> E[Claude Desktop]
D --> F[Other Agents]
end
subgraph "Client Mode"
H[Remote MCP Servers] -->|HTTP/stdio/SSE| I[MCP Protocol]
I --> C
end
style B fill:#2b6cb0,color:#fff
style C fill:#38a169,color:#fff
Quick Start
As MCP Server
from strands import Agent
from strands_mcp_server import mcp_server
agent = Agent(tools=[..., mcp_server])
agent("start mcp server on port 8000")
As MCP Client
from strands import Agent
from strands_mcp_server import mcp_client
agent = Agent(tools=[mcp_client])
# Connect to remote server
agent.tool.mcp_client(
action="connect",
connection_id="remote",
transport="http",
server_url="http://localhost:8000/mcp"
)
# Call remote tool
agent.tool.mcp_client(
action="call_tool",
connection_id="remote",
tool_name="calculator",
tool_args={"expression": "42 * 89"}
)
Claude Desktop Integration
{
"mcpServers": {
"my-agent": {
"command": "uvx",
"args": ["strands-mcp-server", "--cwd", "/path/to/project"]
}
}
}
API Reference
mcp_server
| Parameter | Default | Description |
|---|---|---|
action |
required | start, stop, status, list |
transport |
http |
http or stdio |
port |
8000 | Server port |
tools |
None | Tools to expose (None = all) |
expose_agent |
True | Include invoke_agent tool |
stateless |
False | Multi-node ready |
mcp_client
| Parameter | Description |
|---|---|
action |
connect, disconnect, list_tools, call_tool |
connection_id |
Connection identifier |
transport |
http, stdio, sse |
server_url |
Server URL |
tool_name |
Tool to call |
tool_args |
Tool arguments |
invoke_agent
When expose_agent=True, clients can invoke the full agent:
agent.tool.mcp_client(
action="call_tool",
connection_id="remote",
tool_name="invoke_agent",
tool_args={"prompt": "Calculate 2 + 2 and explain"}
)
CLI
# Start stdio server (for Claude Desktop)
uvx strands-mcp-server
# Start HTTP server
uvx strands-mcp-server --transport http --port 8000
# Proxy mode (stdio ↔ HTTP bridge)
uvx strands-mcp-server --proxy http://remote:8000/mcp
# With custom working directory
uvx strands-mcp-server --cwd /path/to/project
Architecture
sequenceDiagram
participant CD as Claude Desktop
participant MCP as MCP Server
participant Agent as Strands Agent
participant Tools as Tools
CD->>MCP: tools/list
MCP->>Agent: Get tool registry
Agent->>MCP: Tool definitions
MCP->>CD: Tool list
CD->>MCP: tools/call (calculator)
MCP->>Agent: Route to tool
Agent->>Tools: Execute
Tools->>Agent: Result
Agent->>MCP: Response
MCP->>CD: Tool result
Modes
HTTP Mode
agent.tool.mcp_server(
action="start",
transport="http",
port=8000
)
# Access at http://localhost:8000/mcp
Stdio Mode
Stateless Mode
For multi-node deployments:
Connect anything to anything via MCP. 🔌