Token导航 LogoToken导航TokenDH.com
Agent MCP Framework logo
AI代理stdio官方级别未说明来源级核验

Agent MCP Framework

MCP Server

一个用于构建多代理MCP(模型上下文协议)服务器的Python框架,支持多种管道模式和MCP集成,适用于AI代理系统开发。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
AI代理PythonClaudeClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Jbermingham1

提供方

Jbermingham1

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install agent-mcp-framework

详细介绍

agent mcp框架

![CI](https://github.com/Jbermingham1/agent-mcp-framework/actions/workflows/ci.yml) ![PyPI](https://pypi.org/project/agent-mcp-framework/) ](https://github.com/Jbermingham1/agent-mcp-framework/blob/main/Dockerfile) ![Python 3.10+](https://www.python.org/downloads/)

用于构建多代理MCP(模型上下文协议)服务器的Python框架。

使用顺序、并行、条件和映射缩减流水线模式、代理生命周期挂钩和结构化输出组合多代理系统,并将结果作为MCP工具公开给Claude、VSCode或任何兼容MCP的客户端。

特性

  • 代理抽象Agent, LLMAgent, FunctionAgent 带有生命周期挂钩
  • 管道组成 --顺序、并行、条件和MapReduce模式
  • MCP集成 --将代理管道作为MCP工具在stdio或SSE上公开
  • 输出格式化 --JSON、Markdown和纯文本输出模式
  • 命令行界面 --从命令行运行服务器和管道
  • Docker就绪 --Dockerfile、健康检查和AWS ECS Fargate部署
  • CI/CD --GitHub测试、linting和部署操作

安装

pip install agent-mcp-framework

快速开始

from agent_mcp_framework import Agent, AgentContext, AgentResult, SequentialPipeline, AgentMCPServer

class AnalyzerAgent(Agent):
    async def run(self, context: AgentContext) -> AgentResult:
        code = context.get("code", "")
        issues = []
        if len(code.splitlines()) > 500:
            issues.append("File exceeds 500 lines — consider splitting")
        if "import *" in code:
            issues.append("Wildcard imports detected")
        context.set("issues", issues)
        return AgentResult(success=True, output={"issues": issues, "count": len(issues)})

class ScorerAgent(Agent):
    async def run(self, context: AgentContext) -> AgentResult:
        issues = context.get("issues", [])
        score = max(0, 100 - len(issues) * 15)
        return AgentResult(success=True, output={"score": score, "grade": "A" if score >= 90 else "B" if score >= 70 else "C"})

# Compose agents into a pipeline
pipeline = SequentialPipeline("code-review", agents=[
    AnalyzerAgent("analyzer", description="Find code issues"),
    ScorerAgent("scorer", description="Score code quality"),
])

# Expose as an MCP server
server = AgentMCPServer("code-review-server", description="Multi-agent code review")
server.add_pipeline_tool(
    pipeline,
    name="review_code",
    description="Analyze code quality and return a score",
)

if __name__ == "__main__":
    server.run()  # Starts MCP server on stdio

码头工人

# Build and run locally
docker compose up --build

# Or build manually
docker build -t agent-mcp-framework .
docker run -p 8080:8080 agent-mcp-framework

健康检查端点:

终点目的
GET /服务信息
GET /health活体探针
GET /ready准备就绪探针

代理类型

Agent --基本类

实施 run() 定义代理的逻辑。

LLMAgent --克劳德动力代理人

内置Anthropic客户端 complete() LLM呼叫的助手。

FunctionAgent --快速内联代理

将任何异步函数包装为代理,而不进行子类化。

管道模式

图案描述
SequentialPipeline逐一运行代理,每个代理都看到更新的上下文
ParallelPipeline在可选的并发限制下并发运行代理
ConditionalPipeline基于条件函数的代理路由
MapReducePipeline拆分工作,扇出并减少结果

命令行界面

# Start an MCP server
agent-mcp serve my_project.server

# Run a pipeline directly
agent-mcp run my_project.pipeline --input '{"code": "import *"}'

# Show framework info
agent-mcp info

部署

该项目包括完整的AWS ECS Fargate部署配置:

  • Dockerfile --带健康检查的多阶段构建
  • docker-compose.yml --地方发展
  • .github/workflows/ci.yml --CI管道(lint、测试、Docker构建)
  • .github/workflows/deploy.yml --CD管道(ECR推送、ECS部署)
  • aws/task-definition.json --ECS Fargate任务定义

许可证

麻省理工学院

目录标签

目录标签

AI代理PythonClaude多代理系统本地部署MCP协议AI开发框架管道模式LLM集成

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP