api-config

Document MCP core and server configuration for environment variable handling and lazy parsing.

148|28|Updated Mar 20, 2025
One-click install
npx skills add https://github.com/cyanheads/mcp-ts-core --skill api-config-cyanheads
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-config
Source: https://github.com/cyanheads/mcp-ts-core/tree/main/skills/api-config
Command: npx skills add https://github.com/cyanheads/mcp-ts-core --skill api-config-cyanheads

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This reference describes core and server configuration in MCP TS Core. It clarifies how environment variables are mapped to config fields, explains the priority order, and contrasts core configuration with server-specific schemas.

Core Features & Use Cases

  • Document environment variable mappings for identity, transport, auth, storage, and telemetry.
  • Explain the lazy parsing mechanism via parseEnvConfig and how to define server config without polluting startup.
  • Provide examples of how to validate and override config values across worker boundaries and runtime environments.

Quick Start

Consult this reference when configuring MCP environment and server configs to ensure proper env var handling and the separation between core and server schemas.

Frequently Asked Questions about api-config

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure environment variables for MCP TS Core server?

MCP server configuration maps environment variables to config fields for identity, transport, auth, storage, and telemetry using a defined priority order. It separates core configuration from server-specific Zod schemas to prevent misconfigurations across nodes and workers.

How does lazy parsing work for MCP server config?

Lazy parsing for MCP server config uses the parseEnvConfig mechanism to defer schema validation until needed. This prevents startup pollution by ensuring server config values are only parsed when accessed during runtime operations.

What is the difference between core config and server-specific schemas in MCP?

Core config handles shared environment variable mappings across nodes, while server-specific schemas define isolated Zod validations. This separation enforces distinct env var names and priority orders to prevent misconfigurations between core and server contexts.

How do I validate and override config values across worker boundaries?

Validating and overriding config values across worker boundaries requires applying server-specific Zod schemas to parse environment variables. This ensures config integrity is maintained when passing settings between different runtime environments and worker processes.

What environment variable names are enforced for MCP transport and auth?

MCP enforces specific environment variable names for transport, auth, identity, storage, and telemetry configurations. These defined names follow a strict priority order to ensure correct environment variable handling and prevent schema pollution.

Why does my MCP server config fail due to schema pollution at startup?

MCP server config fails from schema pollution when core and server configurations are not properly separated. Using lazy parsing via parseEnvConfig defers validation and prevents startup pollution by keeping server-specific schemas isolated.