@gleanwork/mcp-config-glean

中文文档
5.4.1发布于 2026/07/30MITTypeScriptESM + CJS近 30 天下载 4.1万

Glean-specific MCP configuration defaults and helpers

原始使用文档
文档目录8 节
  1. Installation
  2. Usage
  3. Quick Start
  4. Available Exports
  5. Re-exports
  6. Migration from @gleanwork/mcp-config
  7. Related Packages
  8. License

@gleanwork/mcp-config-glean

Glean-specific MCP configuration defaults and helpers. Wraps @gleanwork/mcp-config-schema with Glean-specific constants and convenience functions.

Installation

npm install @gleanwork/mcp-config-glean

Usage

Quick Start

import {
  createGleanRegistry,
  createGleanHeaders,
  buildGleanMcpUrl,
} from '@gleanwork/mcp-config-glean';

// Create a pre-configured registry (remote / HTTP only)
const registry = createGleanRegistry();
const builder = registry.createBuilder('cursor');

// Generate HTTP configuration
const httpConfig = builder.buildConfiguration({
  transport: 'http',
  serverUrl: buildGleanMcpUrl('https://my-company-be.glean.com'),
  headers: createGleanHeaders('my-api-token'),
});

// Pin the CLI version in generated install commands
const command = builder.buildCommand({
  transport: 'http',
  serverUrl: buildGleanMcpUrl('https://my-company-be.glean.com'),
  headers: createGleanHeaders('my-api-token'),
  cliVersion: '3.1.0',
});
// -> `npx -y @gleanwork/[email protected] remote --url ... --client cursor --token ...`

Available Exports

Constants

import { GLEAN_REGISTRY_OPTIONS, GLEAN_ENV } from '@gleanwork/mcp-config-glean';

// Registry options for Glean's remote MCP server (HTTP only)
GLEAN_REGISTRY_OPTIONS.tokenEnvVarName   // 'GLEAN_API_TOKEN'
GLEAN_REGISTRY_OPTIONS.commandBuilder    // Functions to generate CLI commands
GLEAN_REGISTRY_OPTIONS.serverNameBuilder // Callback that prefixes server names with glean_
GLEAN_REGISTRY_OPTIONS.managedSetupUrls  // Admin setup destinations for managed clients

// Environment variable names
GLEAN_ENV.SERVER_URL // 'GLEAN_SERVER_URL'
GLEAN_ENV.API_TOKEN  // 'GLEAN_API_TOKEN'

The Glean registry provides managed setup destinations for ChatGPT, Claude Teams/Enterprise, and Cursor Team:

const registry = createGleanRegistry();

registry.getManagedSetupUrl('chatgpt');
// https://chatgpt.com/admin/apps?tab=available&q=glean

registry.getManagedSetupUrl('claude-teams-enterprise');
// https://claude.ai/directory/connectors/glean

registry.getManagedSetupUrl('cursor-team');
// https://cursor.com/dashboard/integrations

Helper Functions

FunctionDescription
createGleanRegistry()Create MCPConfigRegistry with Glean defaults
createGleanServerUrlEnv(serverUrl, apiToken?)Create env vars using server URL
buildGleanMcpUrl(serverUrl, endpoint?)Build full MCP endpoint URL from server URL
createGleanHeaders(apiToken)Create Authorization header
normalizeGleanProductName(productName?)Normalize product name for white-labeling (defaults to 'glean')
buildGleanServerName(options)Build server name with glean_ prefix
normalizeGleanServerName(name, productName?)Normalize server name to safe config key with prefix

Server Name Functions

These functions handle server name generation with proper prefixing:

import {
  normalizeGleanProductName,
  buildGleanServerName,
  normalizeGleanServerName,
} from '@gleanwork/mcp-config-glean';

// Normalize product names for white-labeling
normalizeGleanProductName();              // 'glean'
normalizeGleanProductName('Acme Corp');   // 'acme_corp'

// Build server names with glean_ prefix
buildGleanServerName({ transport: 'http' });                               // 'glean_default'
buildGleanServerName({ transport: 'http', serverUrl: '.../mcp/analytics' }); // 'glean_analytics'
buildGleanServerName({ serverName: 'custom' });                            // 'glean_custom'
buildGleanServerName({ agents: true });                                    // 'glean_agents'

// Normalize existing server names
normalizeGleanServerName('custom');        // 'glean_custom'
normalizeGleanServerName('glean_custom');  // 'glean_custom' (no double prefix)

Types

import type { GleanConnectionOptions, GleanEnvVars } from '@gleanwork/mcp-config-glean';

// GleanConnectionOptions extends MCPConnectionOptions with:
// - productName?: string  (for white-label support)
// - agents?: boolean      (use agents endpoint)

Re-exports

This package re-exports everything from @gleanwork/mcp-config-schema, so you can import both Glean-specific and generic types from a single package:

import {
  // Glean-specific
  createGleanRegistry,
  createGleanServerUrlEnv,
  GLEAN_ENV,

  // From mcp-config-schema
  MCPConfigRegistry,
  type MCPConnectionOptions,
  type ClientId,
} from '@gleanwork/mcp-config-glean';

Migration from @gleanwork/mcp-config

If you're migrating from the older @gleanwork/mcp-config package:

  1. Update your package.json:

    - "@gleanwork/mcp-config": "^3.x"
    + "@gleanwork/mcp-config-glean": "^4.x"
    
  2. Update your imports:

    - import { ... } from '@gleanwork/mcp-config';
    + import { ... } from '@gleanwork/mcp-config-glean';
    

The API is fully compatible - no code changes required beyond the import path.

License

MIT

版本与发布记录

@gleanwork/mcp-config-glean 共发布 14 个版本,首次发布于 2026/01/14;过去 12 个月发布了 14 个版本。

版本发布日期距今
5.4.1latest2026/07/303 个月前
5.4.02026/07/164 个月前
5.3.02026/07/154 个月前
5.2.02026/06/075 个月前
5.1.02026/06/075 个月前
5.0.02026/05/036 个月前

关于 @gleanwork/mcp-config-glean 的常见问题

@gleanwork/mcp-config-glean 是什么?

Glean-specific MCP configuration defaults and helpers

如何安装 @gleanwork/mcp-config-glean?

在项目目录运行 npm install @gleanwork/mcp-config-glean,或使用 pnpm add / yarn add / bun add。

@gleanwork/mcp-config-glean 支持 TypeScript 吗?

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

@gleanwork/mcp-config-glean 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@gleanwork/mcp-config-glean 需要什么版本的 Node.js?

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

@gleanwork/mcp-config-glean 可以商用吗?

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

@gleanwork/mcp-config-glean 的下载量有多少?

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

@gleanwork/mcp-config-glean 还在维护吗?

最新版本 5.4.1 发布于 2026/07/30(3 个月前);至今共发布 14 个版本,其中过去 12 个月发布了 14 个;首次发布于 2026/01/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。