@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';
const registry = createGleanRegistry();
const builder = registry.createBuilder('cursor');
const httpConfig = builder.buildConfiguration({
transport: 'http',
serverUrl: buildGleanMcpUrl('https://my-company-be.glean.com'),
headers: createGleanHeaders('my-api-token'),
});
const command = builder.buildCommand({
transport: 'http',
serverUrl: buildGleanMcpUrl('https://my-company-be.glean.com'),
headers: createGleanHeaders('my-api-token'),
cliVersion: '3.1.0',
});
Available Exports
Constants
import { GLEAN_REGISTRY_OPTIONS, GLEAN_ENV } from '@gleanwork/mcp-config-glean';
GLEAN_REGISTRY_OPTIONS.tokenEnvVarName
GLEAN_REGISTRY_OPTIONS.commandBuilder
GLEAN_REGISTRY_OPTIONS.serverNameBuilder
GLEAN_ENV.SERVER_URL
GLEAN_ENV.API_TOKEN
Helper Functions
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';
normalizeGleanProductName();
normalizeGleanProductName('Acme Corp');
buildGleanServerName({ transport: 'http' });
buildGleanServerName({ transport: 'http', serverUrl: '.../mcp/analytics' });
buildGleanServerName({ serverName: 'custom' });
buildGleanServerName({ agents: true });
normalizeGleanServerName('custom');
normalizeGleanServerName('glean_custom');
Types
import type { GleanConnectionOptions, GleanEnvVars } from '@gleanwork/mcp-config-glean';
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 {
createGleanRegistry,
createGleanServerUrlEnv,
GLEAN_ENV,
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:
-
Update your package.json:
- "@gleanwork/mcp-config": "^3.x"
+ "@gleanwork/mcp-config-glean": "^4.x"
-
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.
Related Packages
License
MIT