# @gleanwork/local-mcp-server 中文文档

规范地址：https://npmcn.com/package/%40gleanwork/local-mcp-server/

版本：0\.10\.1
npm 元数据更新时间：2026-06-30T15:09:11.623Z
中文译文更新时间：2026-11-16T15:44:17.665Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40gleanwork/local-mcp-server
原文对照：https://npmcn.com/package/%40gleanwork/local-mcp-server/?lang=original
项目主页：https://github.com/gleanwork/mcp-server#readme
源码仓库：https://github.com/gleanwork/mcp-server

弃用说明：Deprecated\. Use Glean's remote MCP server \(https://docs\.glean\.com/administration/platform/mcp/about\) or the Glean CLI \(https://github\.com/gleanwork/glean-cli\)\.

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：79.4 kB，35 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=20
- 运行依赖：8 个
- 首次发布：2025-06-16T18:18:26.138Z
- 最新版本发布：2026-03-06T21:28:55.778Z
- 近 30 天下载量：5330（2026-10-17 至 2026-11-15，npm 官方下载统计）
- 已发布版本数：22（近 12 个月 4 个）

## 中文简介

Glean API 集成的 MCP 服务器

## 安装

```sh
npm install @gleanwork/local-mcp-server
```

也可以使用：`pnpm add @gleanwork/local-mcp-server`、`yarn add @gleanwork/local-mcp-server`、`bun add @gleanwork/local-mcp-server`

## README

# @ gleanwork/ 本地服务器

![MCP Server](https://badge.mcpx.dev/?type=server "MCP Server") ![CI Build](https://github.com/gleanwork/mcp-server/actions/workflows/ci.yml/badge.svg) [![npm version](https://badge.fury.io/js/@gleanwork%2Flocal-mcp-server.svg)](https://badge.fury.io/js/@gleanwork%2Flocal-mcp-server) [![License](https://img.shields.io/npm/l/@gleanwork%2Fmcp-server.svg)](https://github.com/gleanwork/mcp-server/blob/main/LICENSE)

> **说明:** 我们建议使用 [远程 MCP 服务器直接集成到 Glean](https://docs.glean.com/administration/platform/mcp/about-glean-mcp-integration) 而不是本地的 MCP 服务器 。 远程服务器在自动更新,性能更好,配置简化等方面提供了更无缝的经验. 这个本地的MCP服务器主要用于实验和测试目的.

Glean MCP 服务器是一个 [示范背景协议(MCP)](https://modelcontextprotocol.io/introduction) 服务器,提供与 Glean 的企业知识的无缝集成.

## 特征

-   **公司搜索**: Access Glean 强大的内容搜索能力
-   **人物简介搜索**: 访问 Glean 的人事目录
-   **聊天**: 与 Glean 的 AI 助手互动
-   **读取文档**:通过 ID 或 URL 从 Glean 获取文档
-   **MCP 共通词**: 执行示范背景协议规格

## 工具

-   ### 公司搜索( s)
    
    使用 Glean 搜索 API 搜索 Glean 的内容索引 。 此工具允许您使用各种过滤和配置选项查询 Glean 的内容索引 .
    
-   ### 聊天
    
    与Glean的AI助手使用Glean Chat API进行互动. 此工具允许您与 Glean 的 AI 进行对话交互, 包括支持信件历史、 引用和各种配置选项 .
    
-   ### 人物 profile 搜索
    
    搜索 Glean's People directory 查找员工信息.
    
-   ### 读取文档( d)
    
    通过提供文档ID或URL从Glean读取文档. 该工具允许您获取特定文档的全部内容,以便进行详细分析或参考.
    

## MCP 客户端配置

在您的 MCP 客户端中配置此 MCP 服务器( 如 Claude Desktop, Windsurf, Cursor等) , 运行 [@ gleanwork/ 配置- mcp- 服务器](https://github.com/gleanwork/configure-mcp-server) 传到你的委托人 信使和例子.

```bash
# Configure for Cursor
npx @gleanwork/configure-mcp-server --client cursor --token your_api_token --server-url https://your-company-be.glean.com

# Configure for Claude Desktop
npx @gleanwork/configure-mcp-server --client claude --token your_api_token --server-url https://your-company-be.glean.com

# Using deprecated --instance flag (use --server-url instead)
# npx @gleanwork/configure-mcp-server --client cursor --token your_api_token --instance instance_name
```

详情见: [@ gleanwork/ 配置- mcp- 服务器](https://github.com/gleanwork/configure-mcp-server)。 。 。 .

### 手动 MCP 配置

要手动配置 MCP 客户端( 如 Claude Desktop, Windsurf, Cursor等), 在您的 MCP 客户端设置中添加以下配置 :

```json
{
  "mcpServers": {
    "glean": {
      "command": "npx",
      "args": ["-y", "@gleanwork/local-mcp-server"],
      "env": {
        "GLEAN_SERVER_URL": "<glean server URL>",
        "GLEAN_API_TOKEN": "<glean api token>"
      }
    }
  }
}
```

将环境变量值替换为您实际的 Glean 证书 .

## Docker 部署

作为npx的替代品,可以在多克容器中运行Glean MCP服务器. 这提供了孤立和持续运行的环境.

向GitHub集装箱登记处发布多层建筑图象并进行英特尔/AMD(amd64)和苹果硅(arm64)系统的工作.

### 绘制图像

```bash
docker pull ghcr.io/gleanwork/local-mcp-server:latest
```

### MCP 客户端配置

配置您的 MCP 客户端以使用 Docker 图像 。 大多数 MCP 客户端支持通过 `env` 块 :

```json
{
  "mcpServers": {
    "glean": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/gleanwork/local-mcp-server:latest"
      ],
      "env": {
        "GLEAN_SERVER_URL": "https://your-instance-be.glean.com",
        "GLEAN_API_TOKEN": "your-token"
      }
    }
  }
}
```

如果你的MCP客户端没有通过 `env` 块到 Docker, 使用 `-e` 转而使用参数中的旗帜 :

```json
{
  "mcpServers": {
    "glean": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GLEAN_SERVER_URL=https://your-instance-be.glean.com",
        "-e",
        "GLEAN_API_TOKEN=your-token",
        "ghcr.io/gleanwork/local-mcp-server:latest"
      ]
    }
  }
}
```

**重要内容:** 这个 `-i` stdio 运输通信需要旗帜.

### 环境变量

-   `GLEAN_SERVER_URL` (建议):您的 Glean 服务器 URL( 如. `https://your-instance-be.glean.com`(中文(简体) )
-   `GLEAN_INSTANCE`: 您的正选实例名称( 已过期的选项) `GLEAN_SERVER_URL`(中文(简体) )
-   `GLEAN_API_TOKEN` (需要):您的 Glean API 标志

### 解决问题

**集装箱立即出口:**

-   校验环境变量设置正确
-   检查 Docker 日志 : `docker logs <container-id>`
-   确保 `-i` 标记存在于参数中

**权限或认证错误 :**

-   检查您 `GLEAN_API_TOKEN` 无效
-   检查你的 `GLEAN_SERVER_URL` 或者说 `GLEAN_INSTANCE` 匹配您的 Glean 部署

**MCP客户端无法连接 :**

-   验证嵌入器已安装并运行
-   检查 `docker` 命令在您的路径中
-   审查 MCP 客户端错误消息日志

**未通过的环境变量 :**

-   尝试使用 `-e` 以参数代替 `env` 块(见上文替代配置)

### 多克编曲

对于独立的部署方案,可在 [实例/多克-组成.yaml](https://npmcn.com/package/examples/docker-compose.yaml)。这表明如何用 Docker Compose 运行 MCP 服务器,包括资源限制和安全选项.

注:大多数MCP客户直接管理容器的生命周期,因此多克-编组主要用于测试或自定义部署方案.

### 调试

由于MCP服务器通过stdio通信,调试可能具有挑战性. 我们建议使用 [MCP 检查员](https://github.com/modelcontextprotocol/inspector),以软件包脚本形式提供:

```bash
npm run inspector
```

检查员将提供一个 URL 访问您的浏览器中的调试工具 .

## 捐款

请看 [捐款额](https://github.com/gleanwork/mcp-server/blob/main/CONTRIBUTING.md) (c) 发展结构和准则.

## 许可证

麻省理工学院的执照 - 看 [自由主义](https://npmcn.com/package/%40gleanwork/local-mcp-server/LICENSE) 详细文件

## 支助

-   联合国 [docs.glean.com 页面存档备份,存于互联网档案馆](https://docs.glean.com/)
-   问题: [GitHub 问题](https://github.com/gleanwork/mcp-server/issues)

## 常见问题

### @gleanwork/local-mcp-server 是什么？

Glean API 集成的 MCP 服务器注意：该包已被作者标记为弃用——Deprecated\. Use Glean's remote MCP server \(https://docs\.glean\.com/administration/platform/mcp/about\) or the Glean CLI \(https://github\.com/gleanwork/glean-cli\)\.

### 如何安装 @gleanwork/local-mcp-server？

在项目目录运行 npm install @gleanwork/local-mcp-server，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 local-mcp-server，可以用 npx local-mcp-server 直接运行。

### @gleanwork/local-mcp-server 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @gleanwork/local-mcp-server 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @gleanwork/local-mcp-server 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=20。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @gleanwork/local-mcp-server 可以商用吗？

@gleanwork/local-mcp-server 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @gleanwork/local-mcp-server 的下载量有多少？

根据 npm 官方下载统计，@gleanwork/local-mcp-server 在 2026/10/17 – 2026/11/15 这 30 天内被下载 5,330 次，日均约 178 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @gleanwork/local-mcp-server 还在维护吗？

最新版本 0\.10\.1 发布于 2026/03/07（8 个月前）；至今共发布 22 个版本，其中过去 12 个月发布了 4 个；首次发布于 2025/06/17。作者已将其标记为弃用，新项目建议寻找替代方案。

