Custom Google Workspace Server
Multi-Agent MCP Orchestrator
一个企业级、自主式 AI 编排系统,基于 LangGraph 构建,利用 Model Context Protocol (MCP) 将 LLM 无缝连接到本地环境、向量数据库和云 API。
架构亮点
1. 监督者路由(LangGraph)
从单体工具调用代理过渡到分布式
MultiServerMCPClient架构。实现了严格的系统提示注入,以动态控制代理行为(例如,强制使用 Google Sheets 默认值),而不会污染用户查询。
通过
GraphState处理状态路由,允许在完全隔离的 MCP 服务器之间进行无缝的多步骤工具链式调用。
2. 自愈式 RAG 知识库(ragsystem.py)
使用 LlamaParse 构建了自定义 Pinecone 混合搜索向量数据库,用于结构化 Markdown 提取。
清除并替换机制: 实现了摄取前的元数据过滤(
index.delete(filter={"source": filepath}))。这可以防止在重新摄取更新后的源文件时产生向量重复,从而保持纯净的上下文窗口。
3. 自定义 Google Workspace 服务器(workspace_custom.py)
绕过了功能有限的社区 MCP 包,构建了一个直接与 Google Docs 和 Sheets REST API 交互的原生 Python MCP 服务器。
功能: *
create_sheet和write_sheet:使用 Google 的USER_ENTERED解析进行基于矩阵(二维数组)的行追加。create_doc和append_doc:动态计算 EOF 索引,以安全地将文本注入到深度嵌套的 Google Docs JSON 树中。
4. 跨平台集成
该编排器能够在单次对话轮次中,成功地将复杂工作流路由到多个相互隔离的领域:
本地文件系统: 通过标准 I/O 传输进行读写访问。
Notion: 通过官方
@modelcontextprotocol/server-notion进行文档检索。DuckDuckGo: 通过
duckduckgo-mcp-server进行零认证网络搜索。Todoist: 通过自定义 FastMCP REST API 服务器进行任务管理和创建。
Related MCP server: Generic MCP Server for Google Workspace
先决条件与安装
1. 环境设置
本项目使用 uv 进行极速包管理。请确保已安装 Python 3.12+ 和 uv。
# Clone the repository
git clone [https://github.com/yourusername/multi-agent-orchestrator.git](https://github.com/yourusername/multi-agent-orchestrator.git)
cd multi-agent-orchestrator
# Install dependencies via uv
uv venv
uv pip install -r requirements.txtRelated MCP Connectors
Online office suite for AI agents: edit docs, sheets, slides and PDFs in browser or via MCP.
1Connect AI assistants to Google Sheets through controlled tools for reading and updating rows.
Multiple Gmail accounts, editable Google Sheets & Docs for AI agents. Deny-by-default access rules.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides read/write access to Google Sheets and Google Docs through MCP tools, enabling operations like reading sheets, appending rows, and editing documents.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to send emails, create drafts in Gmail, and append content to Google Docs via standardized MCP tools.27 npmISC
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to send and draft Gmail emails and append content to Google Docs through standardized MCP tools.6 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to draft and send Gmail emails and append content to Google Docs through MCP tools.27 npmISC