MCP ExplorerExplorer

Sdk Python

@strands-agentson a month ago
1432 Apache-2.0
FreeCommunity
AI Systems
#agentic#agentic-ai#agents#ai#autonomous-agents#genai#llm#multi-agent-systems#python#anthropic#litellm#machine-learning#ollama#mcp#opentelemetry
A model-driven approach to building AI agents in just a few lines of code.

Overview

What is Sdk Python

sdk-python is a model-driven SDK designed for building and running AI agents with minimal code. It enables the creation of various AI applications, from simple chatbots to complex autonomous systems.

Use cases

Use cases include developing conversational agents, implementing autonomous workflows, creating interactive applications, and integrating with existing AI models for enhanced functionality.

How to use

To use sdk-python, install it via pip, and follow the documentation for setup and examples. You can create agents by defining their behavior and integrating them with various AI models.

Key features

Key features include a lightweight and flexible agent loop, model agnosticism supporting multiple providers, advanced capabilities for multi-agent systems and streaming, and built-in support for MCP servers.

Where to use

sdk-python can be used in various fields such as customer service, automation, robotics, and any domain requiring AI-driven solutions.

Content

Strands Agents

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

GitHub commit activity GitHub open issues GitHub open pull requests License PyPI version Python versions

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents is a simple yet powerful SDK that takes a model-driven approach to building and running AI agents. From simple conversational assistants to complex autonomous workflows, from local development to production deployment, Strands Agents scales with your needs.

Feature Overview

  • Lightweight & Flexible: Simple agent loop that just works and is fully customizable
  • Model Agnostic: Support for Amazon Bedrock, Anthropic, LiteLLM, Llama, Ollama, OpenAI, and custom providers
  • Advanced Capabilities: Multi-agent systems, autonomous agents, and streaming support
  • Built-in MCP: Native support for Model Context Protocol (MCP) servers, enabling access to thousands of pre-built tools

Quick Start

# Install Strands Agents
pip install strands-agents strands-agents-tools
from strands import Agent
from strands_tools import calculator
agent = Agent(tools=[calculator])
agent("What is the square root of 1764")

Note: For the default Amazon Bedrock model provider, you’ll need AWS credentials configured and model access enabled for Claude 3.7 Sonnet in the us-west-2 region. See the Quickstart Guide for details on configuring other model providers.

Installation

Ensure you have Python 3.10+ installed, then:

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows use: .venv\Scripts\activate

# Install Strands and tools
pip install strands-agents strands-agents-tools

Features at a Glance

Python-Based Tools

Easily build tools using Python decorators:

from strands import Agent, tool

@tool
def word_count(text: str) -> int:
    """Count words in text.

    This docstring is used by the LLM to understand the tool's purpose.
    """
    return len(text.split())

agent = Agent(tools=[word_count])
response = agent("How many words are in this sentence?")

MCP Support

Seamlessly integrate Model Context Protocol (MCP) servers:

from strands import Agent
from strands.tools.mcp import MCPClient
from mcp import stdio_client, StdioServerParameters

aws_docs_client = MCPClient(
    lambda: stdio_client(StdioServerParameters(command="uvx", args=["awslabs.aws-documentation-mcp-server@latest"]))
)

with aws_docs_client:
   agent = Agent(tools=aws_docs_client.list_tools_sync())
   response = agent("Tell me about Amazon Bedrock and how to use it with Python")

Multiple Model Providers

Support for various model providers:

from strands import Agent
from strands.models import BedrockModel
from strands.models.ollama import OllamaModel
from strands.models.llamaapi import LlamaAPIModel

# Bedrock
bedrock_model = BedrockModel(
  model_id="us.amazon.nova-pro-v1:0",
  temperature=0.3,
  streaming=True, # Enable/disable streaming
)
agent = Agent(model=bedrock_model)
agent("Tell me about Agentic AI")

# Ollama
ollama_model = OllamaModel(
  host="http://localhost:11434",
  model_id="llama3"
)
agent = Agent(model=ollama_model)
agent("Tell me about Agentic AI")

# Llama API
llama_model = LlamaAPIModel(
    model_id="Llama-4-Maverick-17B-128E-Instruct-FP8",
)
agent = Agent(model=llama_model)
response = agent("Tell me about Agentic AI")

Built-in providers:

Custom providers can be implemented using Custom Providers

Example tools

Strands offers an optional strands-agents-tools package with pre-built tools for quick experimentation:

from strands import Agent
from strands_tools import calculator
agent = Agent(tools=[calculator])
agent("What is the square root of 1764")

It’s also available on GitHub via strands-agents/tools.

Documentation

For detailed guidance & examples, explore our documentation:

Contributing ❤️

We welcome contributions! See our Contributing Guide for details on:

  • Reporting bugs & features
  • Development setup
  • Contributing via Pull Requests
  • Code of Conduct
  • Reporting of security issues

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Security

See CONTRIBUTING for more information.

⚠️ Preview Status

Strands Agents is currently in public preview. During this period:

  • APIs may change as we refine the SDK
  • We welcome feedback and contributions

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers