这是一个用于执行Strands代理的模型上下文协议(MCP)服务器。该项目提供了一种简单的方法来将Strands代理与Amazon Q和其他兼容MCP的系统集成。
<a href="https://glama.ai/mcp/servers/@imgaray/strands-agents-mcp"> <img width="380" height="200" src="https://gips3.baidu.com/it/u=3821839914,2316155393&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Strands Agent MCP 服务器" /> </a>重要提示:此项目目前处于Alpha阶段,尚未发布到PyPI。
Strands Agent MCP是Strands代理框架与模型上下文协议(MCP)之间的桥梁。它允许您:
该项目使用插件架构,使得添加新代理无需修改核心代码变得容易。
注意:此包尚未在PyPI上可用。您需要从源代码安装。
# 克隆仓库
git clone https://github.com/yourusername/strands-agent-mcp.git
cd strands-agent-mcp
# 安装包
pip install -e .
strands-agent-mcp
这将启动MCP服务器。
服务器支持以下环境变量:
PLUGIN_PATH:自定义查找插件的路径(默认值:".")PLUGIN_NAMESPACE:自定义插件命名空间前缀(默认值:'sap_mcp_plugin')要创建一个新的代理插件,请创建一个以sap_mcp_plugin_开头的Python包(sap代表Strands代理插件)。您的包应实现一个返回AgentEntry对象列表的build_agents函数:
from typing import List
from boto3 import Session
from strands import Agent
from strands.models import BedrockModel
from strands_agent_mcp.registry import AgentEntry
def build_agents() -> List[AgentEntry]:
return [
AgentEntry(
name="my-agent",
agent=Agent(
model=BedrockModel(boto_session=Session(region_name="us-west-2"))
),
skills=["general-knowledge", "coding"]
)
]
一旦MCP服务器运行起来,您可以将其连接到Amazon Q。请参阅Amazon Q文档以获取正确的连接参数。
以下MCP工具将可用:
execute_agent:使用参数agent_name和prompt执行代理list_agents:列出所有可用代理该项目由三个主要组件组成:
服务器会自动发现所有遵循命名约定的已安装插件,并注册它们的代理。
fastmcp>=2.3.4:用于实现MCP服务器strands-agents>=0.1.1:核心Strands代理框架strands-agents-builder>=0.1.0:构建Strands代理的工具strands-agents-tools>=0.1.0:额外的Strands代理工具此项目使用uv进行依赖管理。要设置开发环境:
pip install uvuv venv
uv sync
仓库中包含一个示例插件(sap_mcp_plugin_simple),演示如何创建和注册一个简单的代理:
from typing import List
from boto3 import Session
from strands import Agent
from strands.models import BedrockModel
from strands_agent_mcp.registry import AgentEntry
def build_agents() -> List[AgentEntry]:
return [
AgentEntry(
name="simple-agent",
agent=Agent(
model=BedrockModel(boto_session=Session(region_name="us-west-2"))
),
skills=["general-knowledge"]
)
]
本项目根据仓库中的LICENSE文件的条款授权。