﻿---
title: "安装 Glean 插件并连接组织 MCP"
summary: "安装 glean@glean-codex-plugins，再添加组织提供的 MCP 地址并通过 OAuth 登录。安装后重新打开任务。"
category: skills
level: starter
surfaces: [cli, app, ide]
tags: ["MCP", "Glean", "插件", "OAuth"]
canonical: /tips/glean-codex-plugin/
---

# 安装 Glean 插件并连接组织 MCP

安装 glean@glean-codex-plugins，再添加组织提供的 MCP 地址并通过 OAuth 登录。安装后重新打开任务。

Glean 插件用 marketplace 加 gleanwork/codex-plugins，再 mcp login glean。官方 Codex 页把企业知识插件和组织远程 MCP 拆开：插件会装 Skills，并带一台本机 stdio 网关；组织搜索入口还要自己登记。

先让管理员打开 Glean 的 OAuth、Dynamic Client Registration（只放行已批准应用时把 Glean CLI 加进名单）和 MCP 服务器。你自己打开 MCP Configurator（头像 → Your settings → Third party apps and MCP），抄**组织后端地址**和**服务器名**。文档示例是 `https://acme-be.glean.com/mcp/engineering`，路径带 `/mcp/`，不要猜。

在**普通终端**装，不要在 Codex TUI 里跑：

```bash
codex plugin marketplace add gleanwork/codex-plugins
codex plugin add glean@glean-codex-plugins
codex mcp add glean --url https://acme-be.glean.com/mcp/engineering
codex mcp login glean
```

清单 `.agents/plugins/marketplace.json` 的 name 是 `glean-codex-plugins`，插件 name 是 `glean`，所以是 `glean@glean-codex-plugins`。`codex plugin list` 应看到 installed, enabled。0.154 起先看**当前会话**；当前会话没有再新开。随后 `mcp login glean` 打开浏览器走公司 SSO。已经登记过就**不要**再 `mcp add` 同一张 `glean` 表。

```toml
[mcp_servers.glean]
url = "https://acme-be.glean.com/mcp/engineering"
enabled = true
```

用户层表名官方就是 `glean`。这是 Streamable HTTP + OAuth，不要写 `command`，插件 `.mcp.json` 另有一台本机 `glean_plugin`（`node ./mcp/start.mjs`，开 HITL），那是插件网关，**不要**再手写一张 `glean_plugin`。

只要远程 MCP、不装技能时，只跑上面的 `mcp add` / `mcp login`。仓 README 还可以 `codex plugin add glean-dev-docs@glean-codex-plugins`，再 `codex mcp add glean-dev-docs --url https://developers.glean.com/mcp`；那是**公开开发者文档**，不是你们公司的索引，不要和 `glean` 叠成一台。公开这张默认不必 `mcp login`。

Cursor / Claude 用 `/glean_run`，第一次还会要工作邮箱。Codex **没有**这条斜杠：用自然语言让它搜 Glean，认证走 `mcp login glean`。验证句官方是 `Search for my company onboarding docs in Glean.` 网关先 `find_skills` 再 `run_tool`，不要猜下游工具名。写 Google Doc / Jira 保持批准。

网页 Cloud 不读取 `~/.codex/config.toml`。配置后重新打开会话。用 `codex mcp get glean` 看传输是 streamable_http，url 带你们公司的 `/mcp/` 路径。

## 来源

- [Glean · Plugin for Codex](https://developers.glean.com/guides/mcp/codex)
- [Glean · Set up the plug-in in Codex](https://docs.glean.com/user-guide/mcp/glean-plugin-codex)
- [gleanwork/codex-plugins](https://github.com/gleanwork/codex-plugins)
