Get the FREE Ultimate OpenClaw Setup Guide →

sdk-python

A model-driven approach to building AI agents in just a few lines of code.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio strands-agents-sdk-python uvx awslabs.aws-documentation-mcp-server@latest \
  --env AWS_ACCESS_KEY_ID="your_aws_access_key_id (if using AWS Bedrock or related services)" \
  --env AWS_SECRET_ACCESS_KEY="your_aws_secret_access_key"

How to use

The Strands Agents SDK for Python includes native MCP (Model Context Protocol) support, enabling you to host or connect tools exposed by MCP servers. This README shows an example MCP setup that uses uvx to run an MCP server package. You can create an MCP client in your agent workflow to pull a list of tools from the MCP server and incorporate them into your agent's toolset. The included example demonstrates wrapping the MCP server with MCPClient and stdio_client, then constructing an Agent with the MCP-provided tools and issuing a query to explore model capabilities via those tools. This approach allows you to seamlessly integrate thousands of pre-built MCP tools into your Python agent pipeline.

To use the MCP tools, initialize an MCPClient pointing to the server and then instantiate your Strands Agent with the tools provided by that MCPClient. For example, you can fetch a list of tools synchronously and pass them to the Agent, then make a request that leverages those tools to perform tasks such as documentation lookups, calculations, or other domain-specific actions exposed by the MCP server.

How to install

Prerequisites:

  • Python 3.10+ installed
  • Access to the internet to install packages
  • Optionally a virtual environment management preference (venv, pyenv, etc.)
  1. Create and activate a Python virtual environment (recommended)
python -m venv .venv
# macOS/Linux
source .venv/bin/activate
# Windows
.venv\Scripts\activate
  1. Install Strands Agents and related tools
pip install strands-agents strands-agents-tools
  1. Install and run the MCP server package via uvx (as shown in the MCP example)
  • The MCP server is run through uvx with the target MCP package. The example uses awslabs.aws-documentation-mcp-server@latest as the MCP server package. Ensure you have uvx installed and accessible in your environment.
# Install uvx if needed (example, if not already installed)
pip install uvx

# The MCP server can be run via uvx using the package name (as in the README example)
uvx awslabs.aws-documentation-mcp-server@latest
  1. Verify installation
  • Ensure Python path and uvx installation are working by importing strands and creating a small Agent, then loading tools from the MCP server as shown in the Quick Start sections of the README.

Note: You may need appropriate AWS credentials or other model provider credentials depending on the MCP server you run, particularly if the MCP server will interoperate with AWS Bedrock or other cloud services.

Additional notes

Tips and considerations:

  • The MCP server in this example uses uvx to run a package that exposes tools via the MCP protocol. Ensure the MCP package name matches the server you intend to run (e.g., awslabs.aws-documentation-mcp-server@latest).
  • If using AWS Bedrock or other cloud model providers, you’ll need credentials configured in your environment (e.g., AWS credentials for Bedrock access). The READMEs mention AWS credentials in context to certain providers.
  • You can extend or replace the MCP server package with other MCP servers as needed; just update the mcpServers entry with the corresponding package name and command arguments.
  • When troubleshooting, verify that the MCP server package is accessible in your Python environment and that uvx can resolve the package name from the registry.

Related MCP Servers

Sponsor this space

Reach thousands of developers