feat: 集成MCP统一外部接口管理系统
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m38s

- 添加MCP Manager统一入口管理
- 实现Contact/Dictionary/News三个适配器
- 三层降级策略:MCP -> Database -> Mock
- 保持原有api_client向后兼容
- 添加完整文档和测试
This commit is contained in:
2026-05-03 12:36:12 +08:00
parent 3e9462a693
commit 9c53f58165
15 changed files with 1540 additions and 519 deletions

View File

@@ -0,0 +1,68 @@
# MCP 配置示例
# 复制此文件为 mcp_config.yaml 并填入真实配置
mcp_servers:
# 文件系统服务器
# filesystem:
# type: stdio
# command: npx
# args:
# - "-y"
# - "@modelcontextprotocol/server-filesystem"
# - "/path/to/your/files"
# enabled: false
# GitHub 服务器
# github:
# type: stdio
# command: npx
# args:
# - "-y"
# - "@modelcontextprotocol/server-github"
# env:
# GITHUB_PERSONAL_ACCESS_TOKEN: "ghp_your_token_here"
# enabled: false
# Gmail 服务器
# gmail:
# type: stdio
# command: npx
# args:
# - "-y"
# - "@modelcontextprotocol/server-gmail"
# enabled: false
# 新闻资讯示例HTTP服务器
# news:
# type: http
# url: "https://mcp-news.example.com/mcp"
# headers:
# Authorization: "Bearer your_api_key"
# enabled: false
# 词典翻译
# dictionary:
# type: stdio
# command: uvx
# args:
# - "your-dictionary-mcp-server"
# enabled: false
# 适配器配置
adapters:
contact:
use_mcp: true
use_database: true
use_fallback: true
dictionary:
use_mcp: true
use_database: true
use_fallback: true
cache_ttl: 86400 # 缓存一天
news:
use_mcp: true
use_database: true
use_fallback: true
cache_ttl: 3600 # 缓存一小时