返回市场
多聊-MCP服务器

多聊-MCP服务器

作者:siva01092817 星标更新:2025-10-05

项目介绍

多聊天平台 MCP 服务器(包含 Google 聊天)

<div align="center"> <p style="background-color: #f8f9fa; padding: 15px; border-radius: 5px; border-left: 5px solid #4285f4; max-width: 800px; margin: 0 auto;"> <strong>🔥 独特功能:</strong> 使用单一 AI 助手同时运行<strong>多个聊天提供商</strong>!<br> 您的 AI 可以与 Google 聊天、Slack、Teams 和更多平台进行交互——全部同时进行。<br> 例如:“将此更新分享给 Slack 和 Google 聊天团队”<br> <a href="#running-multiple-chat-providers-simultaneously">➡️ 了解更多关于多提供商能力</a> </p> </div> <div align="center"> <h3>多聊天平台 MCP 服务器是一个开源的 Python 框架,用于构建 AI 驱动的聊天集成。内置完整的 Google 聊天支持。</h3> <p> <strong>关键词:</strong> Google 聊天 MCP • MCP 服务器实现 • AI 聊天集成 • Google Workspace 自动化 • 团队协作 AI </p> </div>

🎯 Google 聊天 MCP 服务器是什么?

Google 聊天 MCP 服务器 是一个开源的、生产就绪的 模型控制协议(MCP)服务器,旨在与 Google 聊天集成的 AI 助手。该项目采用可扩展的 多提供商架构,为 AI 助手与团队聊天平台的集成提供了一个强大的基础。

🏢 为企业安全和隐私而设计

重要安全提示: 此工具仅设计用于本地组织使用。我们强烈建议使用组织提供的本地 LLM 实例或您本地安装的 LLM 代理模型,而不是基于云的 LLM 模型,以完全控制您的团队聊天数据和通信。

为什么选择本地/内部部署:

  • 数据隐私:将敏感的团队对话保留在组织内
  • 安全合规性:满足企业安全和合规性要求
  • 全面控制:对数据流和访问进行全面监督
  • 自定义策略:实施特定于组织的安全措施

虽然任何人都可以调整此工具以适应其特定用例,但它是以企业安全为优先设计的。

当前实现状态

  • Google 聊天提供商 - 生产就绪,具有全面的 API 支持
  • 🔄 Slack 提供商 - 计划中(欢迎贡献)
  • 📝 Microsoft Teams 提供商 - 计划中(欢迎贡献)

关键功能:所有提供商都可以通过统一界面同时运行,使您的 AI 助手能够无缝地在多个聊天平台上工作。了解更多关于这一强大功能。

🧭 项目背后的故事

我们甚至看到了针对 Google 聊天的开源 MCP 服务器——但对于 Microsoft Teams 或 Slack,无论是官方还是开源,都不确定。然而,即使这些存在的工具在实际应用中也表现不佳。它们提供的功能有限,无法处理像这个项目展示的全上下文工作流程。

这个多提供商 MCP 框架源于开发团队在日常工作中尝试利用 AI 助手时所经历的真实挫败感。


原始问题

想象一下这种场景:你在调试一个复杂的问题,你的 AI 助手提出了一个解决方案,但你需要检查你的队友是否遇到过类似的情况。你切换到 Google 聊天,滚动数百条消息,复制粘贴错误日志,等待回复,然后手动将解决方案传达回你的 AI 助手。

这种不断切换上下文的行为破坏了高效 AI 辅助开发的流程。


转折点

在一个关键的生产事件中,一名开发者花了 30 分钟手动在 Claude(通过 Cursor)和团队的 Google 聊天空间之间传递信息。AI 具有帮助的技术知识,团队具有情境经验。 但是没有桥梁连接这两个知识来源。

那时我们意识到:

AI 助手需要成为团队协作的一部分——而不仅仅是孤立的工具。

我们的解决方案:

  • 无缝集成:AI 助手成为团队聊天中的活跃参与者
  • 上下文感知:AI 可以搜索团队历史记录以查找相似的问题和解决方案
  • 协作解决问题:AI 可以与团队共享问题并实施他们的建议
  • 知识桥接:连接 AI 技术知识与团队的经验知识

🎯 为开发者扩展性而设计

🏗️ 模块化提供商架构

每个聊天平台都作为独立模块实现:

src/providers/
├── google_chat/     # ✅ 完整实现
├── slack/           # 📋 框架准备实现  
└── teams/           # 📋 框架准备实现

👥 这是为谁设计的?

此项目主要面向以下两个受众群体:

🛠️ 1. 组织内的开发人员

如果你是使用 Google 聊天 的团队中的开发人员,并且希望将你的 AI IDE(如 Cursor、CodeWhisperer 或 Copilot Chat) 与团队对话集成——这个 MCP 客户端将为你节省数小时的时间。 无需手动复制日志、检查上下文或等待某人看到你的问题。 现在,你的 AI 代理可以直接:

  • 在聊天历史记录中搜索相关过去的讨论
  • 自动分享代码片段或错误日志
  • 接收回复并将其转换为可操作的修复
  • 概述正在进行的团队活动
  • 从共享空间获取缺失的配置/脚本

💡 2. 开源贡献者及 AI 平台构建者

如果你正在构建 AI 驱动的工具、IDE 集成或内部助手——这是你开始构建多提供商 MCP 架构的地方。 你可以分叉此项目来:

  • 扩展对 SlackMicrosoft Teams自定义消息平台 的支持
  • 在 MCP 上构建自己的自定义 AI 工作流

🧩 Google 聊天 MCP 服务器 – 真实使用案例展示

这些演示展示了如何通过这个 MCP 服务器,AI 助手从被动工具转变为积极的合作者——调试问题、协调团队、同步脚本,并主动解除开发者的阻塞。


🛠️ 工具设置与初始化

<div align="center"> <img src="google_chat_mcp_client_demo_images/how_google_chat_mcp_tools_registered_with_mcp_client.png" width="80%" alt="场景 1:工具注册到 Google 聊天"/> <p><i><strong>场景 1:工具注册到 Google 聊天</strong></i></p> </div>

场景:将 MCP 客户端连接到 Google 聊天。

发生了什么:AI 助手被授予访问所有 Google 聊天工具(例如发送、搜索、总结、附加、回复)的权限。

为什么重要:助手现在可以在 Google 聊天中“行动”,而不仅仅是观察。


🧯 调试与解决(Docker 示例)

<div align="center"> <img src="google_chat_mcp_client_demo_images/how_i_asked_mcp_client_to_share_my_error_along_with_logs_to_get_help_from_my_team.png" width="80%" alt="场景 2:向团队广播错误"/> <p><i><strong>场景 2:向团队广播错误</strong></i></p> </div>

发生了什么:开发人员请求 AI 将 Docker 错误日志发布到聊天中,以获得实时团队帮助。

<div align="center"> <img src="google_chat_mcp_client_demo_images/proof_that_team_member_replied_with_instructions_to_fix_the_errors_i_shared.png" width="80%" alt="场景 3:收到团队成员的修复建议"/> <p><i><strong>场景 3:团队回应并提供修复建议</strong></i></p> </div>

下一步:一位团队成员回复了 Dockerfile 的修复建议(COPY requirements.txt .)。

<div align="center"> <img src="google_chat_mcp_client_demo_images/how_i_asked_mcp_client_to_check_with_response_of_my_error_issues_which_i_shared_recently_and_how_i_asked_to_follow_instructions_of_the_response_from_my_team_to_fix_the_issue.png" width="80%" alt="场景 4:代理应用建议的修复"/> <p><i><strong>场景 4:代理应用修复建议</strong></i></p> </div>

自动化时刻:AI 助手根据建议编辑了 Dockerfile——无需手动操作。

<div align="center"> <img src="google_chat_mcp_client_demo_images/how_mcp_client_properly_followed_my_team_member_instructions_for_the_concern_i_shared.png" width="80%" alt="场景 5:验证修复"/> <p><i><strong>场景 5:验证修复</strong></i></p> </div>

总结:它验证了更改,确认 requirements.txt 存在——并且错误应该已解决。


📦 依赖项与脚本同步

<div align="center"> <img src="google_chat_mcp_client_demo_images/proof_that_mcp_client_again_3rd_time_properly_assisted_the_concern_i_asked_to_then_it_properly_provided_my_local_latest_requirements_file_to_someone_who_facing_the_issues_with_requirements.png" width="80%" alt="场景 6:分享 requirements.txt"/> <p><i><strong>场景 6:分享 `requirements.txt`</strong></i></p> </div>

场景:我请求我的团队分享一个工作的 requirements.txt

响应:我的一位团队成员分享了他们工作的 requirements.txt

<div align="center"> <img src="google_chat_mcp_client_demo_images/how_i_asked_mcp_client_to_pull_the_lastest_requirements_and_modifying_with_the_local_one_that_i_asked_for_in_team_space_after_someone_shared_the_requirements_file.png" width="80%" alt="场景 7:同步本地副本"/> <p><i><strong>场景 7:同步本地副本</strong></i></p> </div>

开发人员视角:AI 审查了线程,并根据我的指示,更新了我的本地 requirements.txt 文件。


<div align="center"> <img src="google_chat_mcp_client_demo_images/how_i_asked_my_team_to_share_aws-setup.sh_scrip_in_google_chat_space.png" width="80%" alt="场景 8:请求 AWS 设置脚本"/> <p><i><strong>场景 8:请求 AWS 设置脚本</strong></i></p> </div>

场景:你请求团队分享 aws-setup.sh 脚本。

<div align="center"> <img src="google_chat_mcp_client_demo_images/how_mcp_client_get_aws-script-from-team-space-and-compare-it_with_local_one_after_team_member_replied_to_my_previous_requesting_aws_setup_script.png" width="80%" alt="场景 9:脚本一致性检查"/> <p><i><strong>场景 9:脚本一致性检查</strong></i></p> </div>

开发人员视角:AI 审查了线程,并根据我的指示,比较了团队的脚本与本地版本——确保你处于同步状态。


👀 团队协调与更新

<div align="center"> <img src="google_chat_mcp_client_demo_images/how_i_asked_to_summarize_my_team_space_today_about_what_is_hapening_like_a_quick_updates.png" width="80%" alt="场景 10:总结团队活动"/> <p><i><strong>场景 10:总结团队活动</strong></i></p> </div>

背景:你已经离开了一段时间。有什么新的吗?

AI 响应:助手总结了你所在空间的关键活动:问题、PR、共享文件、阻碍。

<div align="center"> <img src="google_chat_mcp_client_demo_images/how_mcp_client(cursor)_get_my_mentions_from_team_chat_space.png" width="80%" alt="场景 11:跟进提及"/> <p><i><strong>场景 11:跟进提及</strong></i></p> </div>

错过回复了吗? AI 扫描所有提及,并显示你被标记的对话。


🔍 从团队聊天上下文中进行 AI 驱动的问题解决

<div align="center"> <img src="google_chat_mcp_client_demo_images/how_mcp_client_again_search_for_any_concerns_in_our_chat_space_related_to_our_project_specifically_to_assist_them_and_well_it_understand_the_concerns_and_assist_them.png" width="80%" alt="场景 12:AI 扫描团队聊天以查找问题"/> <p><i><strong>场景 12:AI 扫描团队聊天以查找问题</strong></i></p> </div>

场景:开发人员明确请求 AI 助手帮助解决团队在聊天空间中提到的开放问题。

发生了什么:AI 扫描最近的聊天消息,识别技术问题、缺少的文件以及与项目相关的潜在阻碍,并准备协助。

开发人员视角:代理不仅具有反应性——它理解团队上下文,并能在被提示时搜索未解决的问题。

<div align="center"> <img src="google_chat_mcp_client_demo_images/proof_that_mcp_client_properly_assisted_the_concern_i_asked_to.png" width="80%" alt="场景 13:AI 找到了丢失的文件路径"/> <p><i><strong>场景 13:AI 找到了丢失的文件路径</strong></i></p> </div>

示例用例:一位团队成员提到他们找不到 ReviewForm.js

AI 响应:代理搜索本地仓库,找到正确的路径,并直接在聊天线程中回复。

为什么重要:无需等待某人回复,AI 助手可以实时准确地回答,了解仓库情况——加快入职和协作速度。

🚀 快速入门:Google 聊天 MCP 服务器设置

预备条件

  • Python 3.9+
  • UV 包管理器(推荐)
  • Google Cloud 项目,启用 Google 聊天 API
  • MCP 客户端(Claude Desktop、Cursor 或其他兼容 MCP 的 AI 助手)

第一步:安装

# 克隆存储库
git clone https://github.com/siva010928/multi-chat-mcp-server.git
cd multi-chat-mcp-server

# 安装依赖
uv venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
uv pip install -r requirements.txt

第二步:Google 聊天认证设置

# 设置 Google 聊天 API 凭证
# 1. 创建 Google Cloud 项目
# 2. 启用 Google 聊天 API
# 3. 在 Google 聊天 API 仪表板中,打开**配置**标签并完成应用程序设置(应用名称、徽标等)。*API 在此步骤完成之前会拒绝请求。*
# 4. 将 credentials.json 下载到 src/providers/google_chat/

# 运行认证
python -m src.server --provider google_chat -local-auth

第三步:连接到您的 AI 助手

对于 Cursor + Claude 集成,请参阅我们的详细 Google 聊天 MCP Cursor 集成指南

对于其他 MCP 客户端,请添加以下配置:

{
  "mcpServers": {
    "google_chat_mcp": {
      "command": "uv",
      "args": [
        "--directory", "/path/to/multi-chat-mcp-server",
        "run", "-m", "src.server",
        "--provider", "google_chat"
      ]
    }
  }
}

📖 详细的设置文档

有关包括 Google Cloud 配置、OAuth 设置和故障排除在内的综合设置说明,请参阅我们的**完整的 Google 聊天 MCP 设置指南** - 该详细实施指南涵盖:

  • Google Cloud 项目设置和 API 启用
  • OAuth 2.0 配置和最佳安全实践
  • 逐步认证流程
  • 常见设置问题及其解决方案

Google 聊天工具支持(将扩展)

使用以下工具与 Google 聊天互动。每个工具包括其源文件和参数。

🧭 空间管理

  • get_chat_spaces_tool – 列出空间
  • manage_space_members_tool – 添加/移除成员
  • get_conversation_participants_tool – 获取空间参与者
  • summarize_conversation_tool – 摘要对话

💬 消息

  • send_message_tool – 发送消息
  • reply_to_message_thread_tool – 在线程中回复
  • update_chat_message_tool – 更新消息
  • delete_chat_message_tool – 删除消息

😀 互动

  • add_emoji_reaction_tool – 对消息做出反应
  • get_chat_message_tool – 获取消息详情

🔍 搜索与过滤

  • search_messages_tool – 搜索消息
  • get_my_mentions_tool – 查找提及

👤 用户信息

  • get_my_user_info_tool – 您的个人资料
  • get_user_info_by_id_tool – 根据 ID 获取用户信息
  • get_message_with_sender_info_tool – 包含发件人信息的消息
  • list_messages_with_sender_info_tool – 列出包含发件人信息的消息

📎 文件处理

  • upload_attachment_tool – 上传附件
  • send_file_message_tool – 发送文件内容
  • send_file_content_tool – 发送格式化的文件内容

📦 批量操作

  • batch_send_messages_tool – 发送多条消息

📁 *源文件位于