Skip to main content
Glama

OMOS-MCP

MCP 服务器让 AI 代理(Claude、ChatGPT、Cursor 等)读取 OMOS Shared Drive 中的项目文档来回答问题 — 每个答案都引用源文件并附带 Google Drive 链接

支持的 Drive 结构:

OMOS/
├── Project A/
│   ├── Project Overview/
│   ├── Timeline/
│   ├── Design/
│   │   ├── System Flow/
│   │   ├── DB/
│   │   └── API/
│   └── BRD/
└── Project B/ ...

工具

工具

说明

omos_index

索引整个 Drive:所有项目 + 所有文件,附带 ID 和链接(代理始终先调用此工具)

omos_search

全文搜索整个 Drive,可按项目/部分限定范围

omos_read

以文本形式读取文件 — Google Docs/Sheets/Slides、PDF、.docx、.xlsx、md/text 以及图片(直接将图片发送给代理查看)

omos_refresh

立即重建索引(默认缓存 5 分钟)

代理按顺序搜索:过滤 Project Name → 未找到则查看 Project Overview 并向用户确认 → 继续询问是否涉及 Timeline | BRD | Design (System Flow / DB / API) → 问题过于宽泛时会反问以缩小范围(已内置于服务器指令中)

Related MCP server: brkt-gdrive-mcp

一次性设置:Service Account

服务器通过 service account 访问 Drive(无需每个人登录):

  1. 进入 console.cloud.google.com → 创建新项目(或使用现有项目)

  2. APIs & Services → Library → 搜索 Google Drive API → 点击 Enable

  3. IAM & Admin → Service Accounts → Create Service Account → 设置名称如 omos-mcp → 点击 Create(可跳过角色步骤,无需授予任何权限)

  4. 进入创建的 service account → 标签页 Keys → Add Key → Create new key → JSON → 密钥文件将下载

  5. 复制 service account 的电子邮件(格式为 omos-mcp@<project>.iam.gserviceaccount.com)并共享 Shared Drive / OMOS 文件夹,授予该邮箱 Viewer 权限

  6. 找到根 OMOS 的 folder id:在浏览器中打开文件夹,查看 URL https://drive.google.com/drive/folders/<这是 id>

环境变量

变量

说明

OMOS_ROOT_FOLDER_ID

root OMOS 的文件夹 ID(来自步骤 6)— 必填

GOOGLE_SERVICE_ACCOUNT_JSON

整个 JSON 密钥文件的内容,或指向文件的路径 — 必填

OMOS_AUTH_TOKEN

(HTTP 模式)客户端必须发送的 bearer token

OMOS_INDEX_TTL

索引缓存过期时间(秒),默认 300

OAUTH_ISSUER / OAUTH_AUDIENCE / PUBLIC_URL

(HTTP 模式)为 Claude.ai / ChatGPT 网页版启用 OAuth 模式

PORT

(HTTP 模式)监听端口,默认 8000

本地运行

先安装 uv(curl -LsSf https://astral.sh/uv/install.sh | sh)

1) 设置 .env(服务器从仓库根目录自动加载):

cp .env.example .env

编辑 .env,填入 OMOS_ROOT_FOLDER_ID 和密钥文件路径(例如将密钥文件放在 ./service-account.json — 已加入 gitignore)

2) 连接 Claude Code(stdio):

claude mcp add omos -- uv run --directory "/path/to/OMOS-MCP" omos-mcp

Claude Desktop / Cursor / Windsurf — 在 MCP 配置中添加:

{
  "mcpServers": {
    "omos": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/OMOS-MCP", "omos-mcp"]
    }
  }
}

3) 测试: 向代理提问 "OMOS 中有哪些项目?" — 应返回项目列表及链接

(可选)在本地作为 HTTP 服务器运行: 在 .env 中启用 OMOS_AUTH_TOKEN,然后

uv run omos-mcp-http

端点位于 http://localhost:8000/mcp,连接方式:

claude mcp add --transport http omos http://localhost:8000/mcp -H "Authorization: Bearer <OMOS_AUTH_TOKEN>"
  1. 将此仓库推送到 GitHub(已包含 Dockerfile + render.yaml)

  2. Render → New → Blueprint → 选择此仓库

  3. 在仪表盘中设置环境变量:

    • OMOS_ROOT_FOLDER_ID = root OMOS 的文件夹 ID

    • GOOGLE_SERVICE_ACCOUNT_JSON = 整个 JSON 密钥文件的内容(直接粘贴)

    • OMOS_AUTH_TOKEN Render 自动生成 → 复制分发给团队

  4. 部署完成后 → 端点为 https://<app>.onrender.com/mcp

用户连接:

claude mcp add --transport http omos https://<app>.onrender.com/mcp \
  -H "Authorization: Bearer <OMOS_AUTH_TOKEN>"

Cursor / VS Code:在 MCP 配置中添加 URL 和 header Authorization: Bearer <token>

供 Claude.ai / ChatGPT(网页版)使用 — OAuth

网页客户端没有输入 header 的地方,必须通过 OAuth 提供商(如 WorkOS AuthKit,免费支持最多 100 万用户):

  1. 注册 workos.com → 启用 AuthKit → 设置登录方式并限制仅团队成员

  2. 仪表盘 → Connect → Configuration → 开启 Client ID Metadata Document 和 Dynamic Client Registration

  3. 添加 Resource Indicator = https://<app>.onrender.com(不带 /mcp)

  4. 在 Render 上额外设置 3 个环境变量:OAUTH_ISSUER = AuthKit 域名,OAUTH_AUDIENCE = https://<app>.onrender.com,PUBLIC_URL = https://<app>.onrender.com

  5. 用户:Claude.ai → Settings → Connectors → Add custom connector → 输入 https://<app>.onrender.com/mcp → 通过 WorkOS 登录

OAuth 模式和 bearer token 可以共存 — 网页使用 OAuth,CLI 仍可使用 token

测试转换器

uv run python test_convert.py

Available Tools

4 tools
omos_indexA

Get the full index of the OMOS drive: every project and its files (with file ids and links). Use this whenever the user asks about any internal project, BRD, timeline, design, system flow, DB, API, or เอกสารโปรเจค — ALWAYS call this first, then filter by Project Name before drilling into Timeline / BRD / Design (System Flow, DB, API).

Inputs: no named parameters. Returns: result

omos_readA

Read a file from the OMOS drive as text (Google Docs/Sheets/Slides, PDF, docx, xlsx, markdown/text) or as an image (png/jpg). The response starts with a citation block (file name, path, link) — always include that citation in your answer.

Args: file_id: the Drive file id from omos_index or omos_search

Inputs: file_id (required).

omos_refreshA

Rebuild the drive index so newly added projects/files show up immediately (the index is otherwise cached for a few minutes).

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: omos_index provides the full index, omos_search performs full-text search with optional filters, omos_refresh rebuilds the index, and omos_read reads file content. There is no overlap or ambiguity between them.

    Naming Consistency5/5

    All tools follow a consistent 'omos_<verb>' pattern (index, search, refresh, read). The naming is predictable and uniform, making it easy for an agent to understand the action each tool performs.

    Tool Count5/5

    With 4 tools, the set is well-scoped for a drive retrieval server. Each tool addresses a necessary function (listing, searching, refreshing, reading) without being too few or excessive. The count matches the domain's core operations.

    Completeness5/5

    The tool surface covers the full read lifecycle for the OMOS drive: obtaining the index, searching, refreshing for updates, and reading file content. No obvious gaps exist for a retrieval-focused server; all necessary operations are present.

    Related MCP Connectors

    Related MCP Servers