代理MCP服务器
用于任务自动化的智能代理系统。根据关键字和上下文自动将命令路由到专门的代理。
🤖 特性
- 自动代理路由 -智能地将命令与代理进行匹配
- 7内置代理 一些网络、SEO、媒体、GIT、内容、分析、电子邮件
- 可扩展 -易于添加新代理和关键字
- 命令历史记录 -跟踪所有执行的命令
- 关键字匹配 -上下文感知命令理解
- 多个代理 -显示替代代理(如果可用)
🚀 入门指南
安装
npm install启动服务器
npm start服务器在上运行 http://localhost:3000
📝 可用代理
1.Web代理
管理网站更新、部署、内容更改
edit-page-编辑HTML/CSSchange-price-更新定价add-section-添加新页面部分deploy-部署到生产环境fix-text-修复波兰语字符
2.SEO代理
优化搜索引擎和转化的内容
optimize-content-改进页面内容add-meta-添加SEO元数据check-keywords-分析关键字
3.媒体代理
处理图像优化、转换、图库管理
compress-压缩图像convert-转换为WebPoptimize-自动优化图像
4.Git代理
管理Git操作、提交、分支和部署
commit-创建提交push-推送到GitHubdeploy-部署到生产环境
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']);📊 命令路由逻辑
- 将命令解析为关键字
- 在注册表中搜索匹配的代理关键字
- 按相关性(关键字匹配)对代理进行排序
- 执行主代理
- 使用替代代理返回结果
- 记录历史执行情况
🔐 安全
- 所有命令的输入验证
- 代理故障的错误处理
- CORS支持开发
- 审计命令历史记录
📄 许可证
麻省理工学院
______________________________________________________________________
Made for Sopel 搬家 |智能自动化随叫随到🚀
