mcp代理工作流
MCP代理与企业知识转移代理工作流-一个全面的系统,用于构建具有自主代理的智能模型上下文协议代理,以实现无缝的企业知识管理和转移。
特性
- MCP经纪人核心:具有异步支持的强大模型上下文协议代理实现
- 代理管理:具有基于角色的访问权限的自治代理的动态注册和管理
- 任务执行:具有重试逻辑和错误处理的异步任务处理
- 知识管理:具有搜索和标记功能的企业级知识库
- FastAPI集成:实现无缝集成的高性能REST API
- 企业KT:企业知识转移的专业工作流程
- 可扩展性:专为具有可配置资源限制的企业级部署而构建
- 监控:内置日志记录和状态端点,实现操作可见性
建筑
┌─────────────────────────────────────────────────────┐
│ FastAPI Server (api_server.py) │
│ ├─ /agents/* (Agent Management) │
│ ├─ /tasks/* (Task Management) │
│ ├─ /knowledge/* (Knowledge Management) │
│ └─ /status (Broker Status) │
└────────────────┬────────────────────────────────────┘
│
┌────────────────▼────────────────────────────────────┐
│ MCPBroker Core (mcp_broker.py) │
│ ├─ Agent Registry │
│ ├─ Task Queue │
│ ├─ Knowledge Base │
│ └─ Workflow Engine │
└─────────────────────────────────────────────────────┘安装
# Clone the repository
git clone https://github.com/KiruthikaPalanivelu/mcp-broker-agentic-workflow.git
cd mcp-broker-agentic-workflow
# Install dependencies
pip install -r requirements.txt
# Run the server
python -m src.api_server配置
编辑 config.yaml 自定义:
- 服务器设置(主机、端口、工作程序)
- 代理配置(最大代理、任务、知识保留)
- 代理扩展策略
- 任务执行参数
- 知识库设置
- 安全和监控选项
用法示例
注册代理
curl -X POST http://localhost:8000/agents/register \
-H "Content-Type: application/json" \
-d '{
"name": "DocumentProcessor",
"role": "executor",
"description": "Processes enterprise documents",
"capabilities": ["parse", "extract", "validate"]
}'创建并执行任务
curl -X POST http://localhost:8000/tasks/create \
-H "Content-Type: application/json" \
-d '{
"agent_id": "",
"task_type": "document_processing",
"description": "Process Q4 reports",
"parameters": {"format": "pdf", "extract_tables": true}
}'存储知识
curl -X POST http://localhost:8000/knowledge/store \
-H "Content-Type: application/json" \
-d '{
"title": "Enterprise Best Practices",
"content": "...",
"source": "internal_wiki",
"tags": ["enterprise", "best-practices"]
}'企业知识转移(KT)
该系统专为企业知识转移场景而设计:
- 知识获取:自动收集领域专业知识和流程
- 基于代理的处理:智能代理处理KT工作流程的不同方面
- 可扩展的分布:通过可配置的工作流程在整个组织中分发知识
- 质量保证:内置验证和核查代理
- 持续学习:知识库不断更新新见解
API终点
健康与状态
GET /health-健康检查GET /status-经纪人状态
代理管理
POST /agents/register-注册新代理GET /agents-列出所有代理
任务管理
POST /tasks/create-创建任务POST /tasks/{task_id}/execute-执行任务GET /tasks-列出所有任务
知识管理
POST /knowledge/store-存储知识项POST /knowledge/retrieve-检索知识项
发展
# Run with auto-reload
uvicorn src.api_server:app --reload
# View API documentation
# Navigate to http://localhost:8000/docs贡献
欢迎投稿!请遵循项目指南并提交拉取请求。
许可证
MIT许可证
支持
有关问题和疑问,请在GitHub存储库上打开问题。
