@gleanwork/mcp-config
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
Usage
Quick Start
import {
createGleanRegistry,
createGleanEnv,
createGleanHeaders,
buildGleanServerUrl,
} from '@gleanwork/mcp-config';
const registry = createGleanRegistry();
const builder = registry.createBuilder('cursor');
const stdioConfig = builder.buildConfiguration({
transport: 'stdio',
env: createGleanEnv('my-company', 'my-api-token'),
});
const httpConfig = builder.buildConfiguration({
transport: 'http',
serverUrl: buildGleanServerUrl('my-company'),
headers: createGleanHeaders('my-api-token'),
});
Available Exports
Constants
import { GLEAN_REGISTRY_OPTIONS, GLEAN_ENV } from '@gleanwork/mcp-config';
GLEAN_REGISTRY_OPTIONS.serverPackage
GLEAN_REGISTRY_OPTIONS.commandBuilder
GLEAN_REGISTRY_OPTIONS.serverNameBuilder
GLEAN_ENV.INSTANCE
GLEAN_ENV.URL
GLEAN_ENV.API_TOKEN
Helper Functions
createGleanRegistry() | Create MCPConfigRegistry with Glean defaults |
createGleanEnv(instance, apiToken?) | Create env vars using instance name |
createGleanUrlEnv(url, apiToken?) | Create env vars using full URL |
createGleanHeaders(apiToken) | Create Authorization header |
buildGleanServerUrl(instance, endpoint?) | Build Glean MCP server URL |
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';
normalizeGleanProductName();
normalizeGleanProductName('Acme Corp');
buildGleanServerName({ transport: 'stdio' });
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';
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,
createGleanEnv,
GLEAN_ENV,
MCPConfigRegistry,
type MCPConnectionOptions,
type ClientId,
} from '@gleanwork/mcp-config';
License
MIT