From 31c457584ef63ec4a7409754724d899cc75d4516 Mon Sep 17 00:00:00 2001 From: Dennis Traub Date: Fri, 23 May 2025 20:40:29 +0200 Subject: [PATCH] Add Windows compatibility example for MCP stdio connections - Add platform-specific uvx command examples for Windows vs macOS/Linux - Use multi-line array formatting for better readability on narrow screens - Addresses Windows MCP client initialization timeout issues --- docs/user-guide/concepts/tools/mcp-tools.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/user-guide/concepts/tools/mcp-tools.md b/docs/user-guide/concepts/tools/mcp-tools.md index 117cba71..aabd2e0d 100644 --- a/docs/user-guide/concepts/tools/mcp-tools.md +++ b/docs/user-guide/concepts/tools/mcp-tools.md @@ -18,8 +18,26 @@ from strands import Agent from strands.tools.mcp import MCPClient # Connect to an MCP server using stdio transport +# Note: uvx command syntax differs by platform + +# For macOS/Linux: +stdio_mcp_client = MCPClient(lambda: stdio_client( + StdioServerParameters( + command="uvx", + args=["awslabs.aws-documentation-mcp-server@latest"] + ) +)) + +# For Windows: stdio_mcp_client = MCPClient(lambda: stdio_client( - StdioServerParameters(command="uvx", args=["awslabs.aws-documentation-mcp-server@latest"]) + StdioServerParameters( + command="uvx", + args=[ + "--from", + "awslabs.aws-documentation-mcp-server@latest", + "awslabs.aws-documentation-mcp-server.exe" + ] + ) )) # Create an agent with MCP tools