mcp-context-engineering
Version:
The intelligent context optimization system for AI coding assistants. Built with Cole's PRP methodology, Context Portal knowledge graphs, and production-ready MongoDB architecture.
140 lines (139 loc) • 4.4 kB
TypeScript
import { z } from 'zod';
/**
* Environment Configuration Schema with Zod Validation
* Ensures all required environment variables are present and valid
*/
export declare const EnvironmentSchema: z.ZodObject<{
MONGODB_URI: z.ZodString;
MONGODB_DATABASE: z.ZodString;
MONGODB_MAX_POOL_SIZE: z.ZodDefault<z.ZodNumber>;
MONGODB_SERVER_SELECTION_TIMEOUT_MS: z.ZodDefault<z.ZodNumber>;
MONGODB_SOCKET_TIMEOUT_MS: z.ZodDefault<z.ZodNumber>;
VOYAGE_API_KEY: z.ZodString;
OPENAI_API_KEY: z.ZodString;
NODE_ENV: z.ZodDefault<z.ZodEnum<["development", "production", "test"]>>;
LOG_LEVEL: z.ZodDefault<z.ZodEnum<["error", "warn", "info", "debug"]>>;
VECTOR_SEARCH_INDEX_NAME: z.ZodDefault<z.ZodString>;
VECTOR_DIMENSIONS: z.ZodDefault<z.ZodNumber>;
MCP_SERVER_NAME: z.ZodDefault<z.ZodString>;
MCP_SERVER_VERSION: z.ZodDefault<z.ZodString>;
ENABLE_CACHE: z.ZodDefault<z.ZodBoolean>;
CACHE_TTL_SECONDS: z.ZodDefault<z.ZodNumber>;
DEBUG_RESEARCH_ENGINE: z.ZodDefault<z.ZodBoolean>;
DEBUG_PRP_GENERATION: z.ZodDefault<z.ZodBoolean>;
DEBUG_MONGODB_OPERATIONS: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
MONGODB_URI?: string;
MONGODB_DATABASE?: string;
MONGODB_MAX_POOL_SIZE?: number;
MONGODB_SERVER_SELECTION_TIMEOUT_MS?: number;
MONGODB_SOCKET_TIMEOUT_MS?: number;
VOYAGE_API_KEY?: string;
OPENAI_API_KEY?: string;
NODE_ENV?: "development" | "production" | "test";
LOG_LEVEL?: "error" | "warn" | "info" | "debug";
VECTOR_SEARCH_INDEX_NAME?: string;
VECTOR_DIMENSIONS?: number;
MCP_SERVER_NAME?: string;
MCP_SERVER_VERSION?: string;
ENABLE_CACHE?: boolean;
CACHE_TTL_SECONDS?: number;
DEBUG_RESEARCH_ENGINE?: boolean;
DEBUG_PRP_GENERATION?: boolean;
DEBUG_MONGODB_OPERATIONS?: boolean;
}, {
MONGODB_URI?: string;
MONGODB_DATABASE?: string;
MONGODB_MAX_POOL_SIZE?: number;
MONGODB_SERVER_SELECTION_TIMEOUT_MS?: number;
MONGODB_SOCKET_TIMEOUT_MS?: number;
VOYAGE_API_KEY?: string;
OPENAI_API_KEY?: string;
NODE_ENV?: "development" | "production" | "test";
LOG_LEVEL?: "error" | "warn" | "info" | "debug";
VECTOR_SEARCH_INDEX_NAME?: string;
VECTOR_DIMENSIONS?: number;
MCP_SERVER_NAME?: string;
MCP_SERVER_VERSION?: string;
ENABLE_CACHE?: boolean;
CACHE_TTL_SECONDS?: number;
DEBUG_RESEARCH_ENGINE?: boolean;
DEBUG_PRP_GENERATION?: boolean;
DEBUG_MONGODB_OPERATIONS?: boolean;
}>;
export type Environment = z.infer<typeof EnvironmentSchema>;
/**
* Validate and parse environment variables
* Throws detailed error if validation fails
*/
export declare function validateEnvironment(): Environment;
/**
* Get validated environment configuration
* Call this once at startup
*/
export declare const env: {
MONGODB_URI?: string;
MONGODB_DATABASE?: string;
MONGODB_MAX_POOL_SIZE?: number;
MONGODB_SERVER_SELECTION_TIMEOUT_MS?: number;
MONGODB_SOCKET_TIMEOUT_MS?: number;
VOYAGE_API_KEY?: string;
OPENAI_API_KEY?: string;
NODE_ENV?: "development" | "production" | "test";
LOG_LEVEL?: "error" | "warn" | "info" | "debug";
VECTOR_SEARCH_INDEX_NAME?: string;
VECTOR_DIMENSIONS?: number;
MCP_SERVER_NAME?: string;
MCP_SERVER_VERSION?: string;
ENABLE_CACHE?: boolean;
CACHE_TTL_SECONDS?: number;
DEBUG_RESEARCH_ENGINE?: boolean;
DEBUG_PRP_GENERATION?: boolean;
DEBUG_MONGODB_OPERATIONS?: boolean;
};
/**
* MongoDB configuration derived from environment
*/
export declare const mongoConfig: {
uri: string;
database: string;
options: {
maxPoolSize: number;
serverSelectionTimeoutMS: number;
socketTimeoutMS: number;
maxIdleTimeMS: number;
retryWrites: boolean;
retryReads: boolean;
};
};
/**
* AI Services configuration
*/
export declare const aiConfig: {
voyage: {
apiKey: string;
model: string;
dimensions: number;
};
openai: {
apiKey: string;
model: string;
dimensions: number;
};
};
/**
* Vector search configuration
*/
export declare const vectorConfig: {
indexName: string;
dimensions: number;
similarity: "cosine";
};
/**
* Debug configuration
*/
export declare const debugConfig: {
researchEngine: boolean;
prpGeneration: boolean;
mongodbOperations: boolean;
};