Skip to content

mcp-core configuration

Your service's config class extends MCPCoreConfig with its own variables and loads it once at startup. Loading fails and names the variable when a required one is missing. A secret is removed from process.env once it is read.

import { type EnviConfig, envfield } from "@evolve-framework/config";
import { MCPCoreConfig } from "@evolve-framework/mcp-core";
class Config extends MCPCoreConfig {
readonly HTTP_PORT = 8080;
config(): EnviConfig {
return { ...super.config(), HTTP_PORT: envfield.number() };
}
}
export const config = new Config();
await config.load();

MCPCoreConfig

Base configuration class for MCP services. Services should extend this class and override COMPONENT_NAME (and HTTP_PORT if needed).

import { MCPCoreConfig } from "@evolve-framework/mcp-core";
VariableDescription
COMPONENT_NAMEoptionalThe service's name, which a service overrides. Defaults to mcp-server.Default mcp-server
COMPONENT_VERSIONoptionalThe service's version, for the service to report. Unset by default.
HTTP_HOSToptionalThe address the HTTP server binds to. Defaults to 0.0.0.0.Default 0.0.0.0
HTTP_PORToptional · numberThe port the HTTP server listens on. Defaults to 6000.Default 6000
MCP_ENDPOINT_PATHoptionalThe path MCP clients post to. Defaults to /mcp.Default /mcp
GATEWAY_ENDPOINToptionalThe GraphQL gateway the tools call, as the storefront does.Default http://localhost:4000/graphql
ACCOUNT_SERVICE_ENDPOINToptionalThe account service's URL, for a service that calls it directly.Default http://localhost:4001
DEFAULT_STORE_KEYoptionalThe store a request is scoped to when it names none.Default evolve
DEFAULT_LOCALEoptionalThe locale a request uses when it names none.Default nl-NL
DEFAULT_CURRENCYoptionalThe currency a request uses when it names none.Default EUR
JWT_ISSUERoptional · list, ","The issuers a bearer token may come from; comma-separated for several.Default http://localhost:4000
JWT_AUDIENCEoptional · list, ","The audiences a bearer token may be for; comma-separated for several.Default http://localhost:4000
PROXY_AUTH_ENABLEDoptional · booleanWhen true, a trusted proxy may forward a pre-authenticated session via the X-Access-Token / X-Data-Token / X-Refresh-Token headers. These take precedence over Authorization: Bearer and skip JWT pre-validation — token validity is enforced by the downstream gateway. Leave disabled unless this service sits behind a trusted proxy (e.g. the chat backend).Default false
MCP_PUBLIC_URLoptionalThe canonical address clients connect to, which tokens are bound to.Default http://localhost:6000/mcp
MCP_LOGIN_URLoptionalThe storefront's login page, for customers connecting a client.Default http://localhost:3000/account/login
MCP_OAUTH_SECRETSoptional · secretComma-separated secrets of at least 32 bytes, which seal every token. Stays with this service. OAuth is off while this is unset.Default
MCP_INTERACTION_SECREToptional · secretWhat the login page authenticates with on the interaction routes. At least 32 bytes.Default
TOKEN_REFRESH_THRESHOLD_SECONDSoptional · numberA token with less than this many seconds left is refreshed. Defaults to 300.Default 300
RATE_LIMIT_MAXoptional · numberThe requests a client may make per rate-limit window. Defaults to 100.Default 100
RATE_LIMIT_ADDRESS_MAXoptional · numberWith OAuth, the requests per IP address per window, for those without a valid token. Clients in the cloud share addresses. Defaults to 1000.Default 1000
RATE_LIMIT_WINDOW_SECONDSoptional · numberThe rate-limit window, in seconds. Defaults to 60.Default 60

Every service's variables on one page: Configuration.