Skip to main content
Glama

Strands MCP Server

by cagataycali

mcp_client

Connect to MCP servers, call their tools, and manage connections within Strands agents for testing and integration purposes.

Instructions

Test and interact with MCP servers.

This tool provides a complete MCP client implementation for testing and using MCP servers from within a Strands Agent.

Args: action: Action to perform - "connect", "disconnect", "list_tools", "call_tool", "list_connections" connection_id: Unique identifier for this connection transport: Transport type - "http", "stdio", or "sse" server_url: URL for HTTP/SSE transport (e.g., "http://localhost:8000/mcp") command: Command for stdio transport (e.g., "python") args: Arguments for stdio command (e.g., ["mcp_server_stdio.py"]) tool_name: Name of tool to call (for call_tool action) tool_args: Arguments to pass to tool (for call_tool action)

Returns: Result dictionary with status and content

Examples: # Connect to HTTP server mcp_client( action="connect", connection_id="my-server", transport="http", server_url="http://localhost:8000/mcp" )

# Connect to stdio server mcp_client( action="connect", connection_id="stdio-server", transport="stdio", command="python", args=["mcp_server_stdio.py"] ) # List tools from connection mcp_client(action="list_tools", connection_id="my-server") # Call a tool mcp_client( action="call_tool", connection_id="my-server", tool_name="calculator", tool_args={"expression": "2 + 2"} ) # List all connections mcp_client(action="list_connections") # Disconnect mcp_client(action="disconnect", connection_id="my-server")

Notes: - stdio transport: Server must be launchable as subprocess - HTTP transport: Server must be already running - Connections are maintained in global state for reuse

Input Schema

NameRequiredDescriptionDefault
actionYesAction to perform - "connect", "disconnect", "list_tools", "call_tool", "list_connections"
connection_idNoUnique identifier for this connection
transportNoTransport type - "http", "stdio", or "sse"
server_urlNoURL for HTTP/SSE transport (e.g., "http://localhost:8000/mcp")
commandNoCommand for stdio transport (e.g., "python")
argsNoArguments for stdio command (e.g., ["mcp_server_stdio.py"])
tool_nameNoName of tool to call (for call_tool action)
tool_argsNoArguments to pass to tool (for call_tool action)

Input Schema (JSON Schema)

{ "properties": { "action": { "description": "Action to perform - \"connect\", \"disconnect\", \"list_tools\", \"call_tool\", \"list_connections\"", "type": "string" }, "args": { "default": null, "description": "Arguments for stdio command (e.g., [\"mcp_server_stdio.py\"])", "items": { "type": "string" }, "type": "array" }, "command": { "default": null, "description": "Command for stdio transport (e.g., \"python\")", "type": "string" }, "connection_id": { "default": null, "description": "Unique identifier for this connection", "type": "string" }, "server_url": { "default": null, "description": "URL for HTTP/SSE transport (e.g., \"http://localhost:8000/mcp\")", "type": "string" }, "tool_args": { "default": null, "description": "Arguments to pass to tool (for call_tool action)", "type": "object" }, "tool_name": { "default": null, "description": "Name of tool to call (for call_tool action)", "type": "string" }, "transport": { "default": null, "description": "Transport type - \"http\", \"stdio\", or \"sse\"", "type": "string" } }, "required": [ "action" ], "type": "object" }

Other Tools from Strands MCP Server

Related Tools

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/cagataycali/strands-mcp-server'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server