{"type":"mcp_client","name":"sdk-python","description":"Here are a few options, prioritizing clarity and SEO:\n\n* **AI Agent SDK (Python): Model-driven agent creation with minimal code. #AI #Python #SDK** (79 characters)\n\n* **Python SDK for model-driven AI ","category":"AI","language":"Python","stars":6365,"forks":190,"owner":"strands-agents","github_url":"https://github.com/strands-agents/sdk-python","homepage":"https://strandsagents.com","setup":"## Setup\n\n**Prerequisites:**\n\n*   Python 3.10 or higher is required.\n\n**Installation:**\n\n1.  **Create a virtual environment (recommended):**\n\n    ```bash\n    python -m venv .venv\n    ```\n\n2.  **Activate the virtual environment:**\n\n    *   On Linux/macOS:\n\n        ```bash\n        source .venv/bin/activate\n        ```\n\n    *   On Windows:\n\n        ```bash\n        .venv\\Scripts\\activate\n        ```\n\n3.  **Install Strands Agents and the optional tools package:**\n\n    ```bash\n    pip install strands-agents strands-agents-tools\n    ```\n\n**Configuration:**\n\n*   **Model Provider Credentials:** Strands Agents supports various model providers. For the default Amazon Bedrock model provider, you'll need AWS credentials configured and model access enabled for Claude 3 Sonnet in the `us-west-2` region. Refer to the [Quickstart Guide](https://strandsagents.com/latest/user-guide/quickstart/) for detailed instructions on configuring other model providers (Anthropic, LiteLLM, Llama, Ollama, OpenAI, etc.).\n\n**Environment Variables:**\n\n*   Specific environment variables may be required depending on the model provider you choose. Consult the documentation for your chosen provider for details. For example, when using Bedrock, you'll need standard AWS environment variables configured (e.g., `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`).","tools":"## Available Tools\n\nStrands Agents provides a flexible framework for building AI agents, with support for various tools and features. Here's a breakdown:\n\n*   **Python-Based Tools:**\n\n    *   **What it does:** Allows you to define custom tools using Python functions and decorators. The docstrings of these functions are used by the LLM to understand the tool's purpose.\n    *   **Usage Example:**\n\n        ```python\n        from strands import Agent, tool\n\n        @tool\n        def word_count(text: str) -> int:\n            \"\"\"Count words in text.\n\n            This docstring is used by the LLM to understand the tool's purpose.\n            \"\"\"\n            return len(text.split())\n\n        agent = Agent(tools=[word_count])\n        response = agent(\"How many words are in this sentence?\")\n        ```\n\n*   **MCP (Model Context Protocol) Support:**\n\n    *   **What it does:** Enables seamless integration with MCP servers, providing access to a wide range of pre-built tools. MCP allows agents to discover and utilize tools dynamically.\n    *   **Usage Example:**\n\n        ```python\n        from strands import Agent\n        from strands.tools.mcp import MCPClient\n        from mcp import stdio_client, StdioServerParameters\n\n        aws_docs_client = MCPClient(\n            lambda: stdio_client(StdioServerParameters(command=\"uvx\", args=[\"awslabs.aws-documentation-mcp-server@latest\"]))\n        )\n\n        with aws_docs_client:\n           agent = Agent(tools=aws_docs_client.list_tools_sync())\n           response = agent(\"Tell me about Amazon Bedrock and how to use it with Python\")\n        ```\n\n*   **Pre-built Tools (strands-agents-tools):**\n\n    *   **What it does:** Offers a collection of pre-built tools for common tasks, facilitating quick experimentation and agent development.  The `strands-agents-tools` package is optional.\n    *   **Example:** The `calculator` tool performs calculations.\n    *   **Usage Example:**\n\n        ```python\n        from strands import Agent\n        from strands_tools import calculator\n        agent = Agent(tools=[calculator])\n        agent(\"What is the square root of 1764\")\n        ```\n\n*   **Multiple Model Providers:**\n\n    *   **What it does:** Supports a variety of LLM providers, including Amazon Bedrock, Anthropic, LiteLLM, LlamaAPI, Ollama, and OpenAI. This allows you to choose the best model for your specific needs.\n    *   **Usage Example:**\n\n        ```python\n        from strands import Agent\n        from strands.models import BedrockModel\n        from strands.models.ollama import OllamaModel\n        from strands.models.llamaapi import LlamaAPIModel\n\n        # Bedrock\n        bedrock_model = BedrockModel(\n          model_id=\"us.amazon.nova-pro-v1:0\",\n          temperature=0.3,\n          streaming=True, # Enable/disable streaming\n        )\n        agent = Agent(model=bedrock_model)\n        agent(\"Tell me about Agentic AI\")\n\n        # Ollama\n        ollama_model = OllamaModel(\n          host=\"http://localhost:11434\",\n          model_id=\"llama3\"\n        )\n        agent = Agent(model=ollama_model)\n        agent(\"Tell me about Agentic AI\")\n\n        # Llama API\n        llama_model = LlamaAPIModel(\n            model_id=\"Llama-4-Maverick-17B-128E-Instruct-FP8\",\n        )\n        agent = Agent(model=llama_model)\n        response = agent(\"Tell me about Agentic AI\")\n        ```","faq":null,"created_at":"2025-05-14T19:59:51+00:00","updated_at":"2025-07-07T17:03:28+00:00","source_url":"https://model-context-protocol.com/clients/sdk-python","related_articles":[]}