New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@gleanwork/mcp-config

Package Overview
Dependencies
Maintainers
7
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gleanwork/mcp-config

Glean-specific MCP configuration defaults and helpers

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
0
Maintainers
7
Weekly downloads
 
Created
Source

@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';

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

// Generate stdio configuration
const stdioConfig = builder.buildConfiguration({
  transport: 'stdio',
  env: createGleanEnv('my-company', 'my-api-token'),
});

// Generate HTTP configuration
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';

// Registry options for Glean MCP server
GLEAN_REGISTRY_OPTIONS.serverPackage    // '@gleanwork/local-mcp-server'
GLEAN_REGISTRY_OPTIONS.commandBuilder   // Functions to generate CLI commands
GLEAN_REGISTRY_OPTIONS.serverNameBuilder // Callback that prefixes server names with glean_

// Environment variable names
GLEAN_ENV.INSTANCE   // 'GLEAN_INSTANCE'
GLEAN_ENV.URL        // 'GLEAN_URL'
GLEAN_ENV.API_TOKEN  // 'GLEAN_API_TOKEN'

Helper Functions

FunctionDescription
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';

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

// Build server names with glean_ prefix
buildGleanServerName({ transport: 'stdio' });                              // 'glean_local'
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';

// 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,
  createGleanEnv,
  GLEAN_ENV,

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

License

MIT

Keywords

mcp

FAQs

Package last updated on 10 Jan 2026

Related posts