Skip to main content
Glama

股线代理 MCP

用于执行 Strands 代理的模型上下文协议 (MCP) 服务器。该项目提供了一种将 Strands 代理与 Amazon Q 及其他兼容 MCP 的系统集成的简单方法。

概述

Strands Agent MCP 是 Strands 代理框架和模型上下文协议 (MCP) 之间的桥梁。它允许您:

  • 将 Strands 代理注册为 MCP 工具

  • 通过 MCP 执行 Strands 代理

  • 发现并列出可用的代理

该项目采用插件架构,可以轻松添加新代理,而无需修改核心代码。

Related MCP server: Elasticsearch MCP Server

安装

pip install strands-agent-mcp

用法

启动 MCP 服务器

strands-agent-mcp

这将在默认端口上启动 MCP 服务器。

创建代理插件

要创建新的代理插件,请创建一个以sap_mcp_plugin_开头的 Python 包(sap 代表 strands agent plugin)。您的包应该实现一个register_plugin函数,该函数用于向提供的注册表注册一个或多个代理:

from strands import Agent
from strands.models import BedrockModel
from strands_agent_mcp.registry import Registry

def register_plugin(registry: Registry) -> None:
    registry.register("my-agent", Agent(
        model=BedrockModel(boto_session=Session(region_name="us-west-2")))
    )

与 Amazon Q 一起使用

一旦 MCP 服务器运行,您就可以将代理与 Amazon Q 一起使用:

q chat --mcp-server http://localhost:8000

然后您可以在聊天中使用以下命令:

  • 列出可用的代理: strands___list_agents list_agents

  • 执行代理: strands___execute_agent execute_agent,参数为agent (代理名称)和prompt (发送给代理的提示)

建筑学

该项目由三个主要部分组成:

  1. 服务器:暴露代理执行 API 的 MCP 服务器

  2. 注册表:用于管理可用代理的简单注册表

  3. 插件:动态发现向注册表注册代理的模块

服务器自动发现所有遵循命名约定的已安装插件并注册其代理。

依赖项

  • fastmcp :用于实现 MCP 服务器

  • strands-agents :核心 Strands 代理框架

  • strands-agents-builder :用于构建 Strands 代理的工具

  • strands-agents-tools :Strands 代理的附加工具

发展

要设置开发环境:

  1. 克隆存储库

  2. 创建虚拟环境: python -m venv .venv

  3. 激活虚拟环境: source .venv/bin/activate (Linux/Mac)或.venv\Scripts\activate (Windows)

  4. 安装开发依赖项: pip install -e ".[dev]"

创建测试插件

该存储库包含一个示例插件( sap_mcp_plugin_test ),它演示了如何创建和注册一个名为“simple-agent”的简单代理:

from boto3 import Session
from strands import Agent
from strands.models import BedrockModel

from strands_agent_mcp.registry import Registry


def register_plugin(registry: Registry) -> None:
    registry.register("simple-agent", Agent(
        model=BedrockModel(boto_session=Session(region_name="us-west-2")))
    )

执照

[在此处添加许可信息]

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/imgaray/strands-agents-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server