智能代理任务自动化系统

Agents MCP Server 是一个智能代理系统,用于自动路由命令到特定代理以实现任务自动化,适用于网站管理、内容优化、数据分析等多种场景。

  • by piotrsobczak-rgb
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 piotrsobczak-rgb/agents-mcp-server

使用说明

代理MCP服务器

用于任务自动化的智能代理系统。根据关键字和上下文自动将命令路由到专门的代理。

🤖 特性

  • 自动代理路由 -智能地将命令与代理进行匹配
  • 7内置代理 一些网络、SEO、媒体、GIT、内容、分析、电子邮件
  • 可扩展 -易于添加新代理和关键字
  • 命令历史记录 -跟踪所有执行的命令
  • 关键字匹配 -上下文感知命令理解
  • 多个代理 -显示替代代理(如果可用)

🚀 入门指南

安装

npm install

启动服务器

npm start

服务器在上运行 http://localhost:3000

📝 可用代理

1.Web代理

管理网站更新、部署、内容更改

  • edit-page -编辑HTML/CSS
  • change-price -更新定价
  • add-section -添加新页面部分
  • deploy -部署到生产环境
  • fix-text -修复波兰语字符

2.SEO代理

优化搜索引擎和转化的内容

  • optimize-content -改进页面内容
  • add-meta -添加SEO元数据
  • check-keywords -分析关键字

3.媒体代理

处理图像优化、转换、图库管理

  • compress -压缩图像
  • convert -转换为WebP
  • optimize -自动优化图像

4.Git代理

管理Git操作、提交、分支和部署

  • commit -创建提交
  • push -推送到GitHub
  • deploy -部署到生产环境

5.内容代理

编写和改进内容,修正语法

  • write -生成内容
  • improve -增强现有文本
  • fix-grammar -修正波兰语语法

6.分析代理

分析流量,生成报告

  • report -生成报告
  • analyze -分析指标
  • track -设置跟踪

7.电子邮件代理

管理电子邮件活动、通知

  • send -发送电子邮件
  • template -创建电子邮件模板
  • campaign -设置活动

💡 使用示例

使用cURL

# Simple command
curl -X POST http://localhost:3000 \
  -H "Content-Type: application/json" \
  -d '{"command": "deploy website"}'

# With context
curl -X POST http://localhost:3000 \
  -H "Content-Type: application/json" \
  -d '{
    "command": "fix polish characters",
    "context": {
      "file": "index.html",
      "language": "pl"
    }
  }'

使用JavaScript

const response = await fetch('http://localhost:3000', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    command: 'optimize images',
    context: { path: 'site/images' }
  })
});

const result = await response.json();
console.log(result);

🔧 API响应格式

{
  "status": "success",
  "timestamp": "2025-11-27T10:00:00Z",
  "agent": "web",
  "command": "deploy website",
  "result": {
    "status": "info",
    "message": "Web agent processing: deploy website",
    "subcommands": [...]
  },
  "alternativeAgents": ["git", "seo"]
}

📚 建筑

agents-mcp-server/
├── src/
│   ├── index.js           # MCP Server entry point
│   └── agents/
│       ├── registry.js    # Agent registry & management
│       └── router.js      # Command routing logic
├── package.json
└── README.md

🛠️ 添加自定义代理

// In registry.js
this.register('custom', {
  name: 'Custom Agent',
  description: 'Does custom things',
  async execute(command, context) {
    return {
      status: 'success',
      message: `Processing: ${command}`
    };
  }
}, ['custom', 'keyword1', 'keyword2']);

📊 命令路由逻辑

  1. 将命令解析为关键字
  2. 在注册表中搜索匹配的代理关键字
  3. 按相关性(关键字匹配)对代理进行排序
  4. 执行主代理
  5. 使用替代代理返回结果
  6. 记录历史执行情况

🔐 安全

  • 所有命令的输入验证
  • 代理故障的错误处理
  • CORS支持开发
  • 审计命令历史记录

📄 许可证

麻省理工学院


Made for Sopel 搬家 |智能自动化随叫随到🚀