mcp-cve-intelligence-server-lite-test
Version:
Lite Model Context Protocol server for comprehensive CVE intelligence gathering with multi-source exploit discovery, designed for security professionals and cybersecurity researchers - Alpha Release
139 lines • 4.21 kB
TypeScript
/**
* Centralized Configuration Management System
* Single source of truth for all application configuration
*/
import type { ExploitIndicatorsConfig, EPSSConfig } from '../types/cve.js';
import type { CLIOptions } from '../types/cli.js';
export interface LoggingConfig {
level: 'error' | 'warn' | 'info' | 'debug';
dir: string;
maxFiles: number;
maxFileSizeMB: number;
enableConsole: boolean;
enableFile: boolean;
}
export interface TransportConfig {
type: 'stdio' | 'http';
http: {
port: number;
host: string;
enableCors: boolean;
compressJson: boolean;
sessionManagement: boolean;
};
}
export interface ServerConfig {
name: string;
version: string;
environment: 'development' | 'production' | 'test';
processTitle: string;
}
export interface SourceConfig {
name: string;
baseUrl: string;
apiKeyRequired: boolean;
apiKeyEnvVar?: string;
authHeaderType: 'token' | 'apiKey' | 'bearer';
authHeaderName: string;
requestTimeout: number;
retryAttempts: number;
retryDelay: number;
priority: number;
enabled: boolean;
endpoints: Record<string, string>;
features: string[];
}
export interface SecurityConfig {
apiKeys: {
nvd?: string;
github?: string;
mitre?: string;
[key: string]: string | undefined;
};
rateLimits: {
default: {
requests: number;
windowMs: number;
};
nvd: {
requests: number;
windowMs: number;
};
github: {
requests: number;
windowMs: number;
};
mitre: {
requests: number;
windowMs: number;
};
};
}
export interface PerformanceConfig {
cache: {
enabled: boolean;
ttlSeconds: number;
maxSize: number;
};
timeouts: {
default: number;
search: number;
details: number;
};
concurrency: {
maxConcurrentRequests: number;
requestBatchSize: number;
};
}
export interface AppConfig {
server: ServerConfig;
transport: TransportConfig;
logging: LoggingConfig;
security: SecurityConfig;
performance: PerformanceConfig;
sources: Record<string, SourceConfig>;
exploitIndicators?: ExploitIndicatorsConfig;
epss?: EPSSConfig;
}
declare class EnvironmentManager {
private static instance;
private constructor();
static getInstance(): EnvironmentManager;
get(name: string, defaultValue?: string): string | undefined;
getRequired(name: string): string;
getNumber(name: string, defaultValue: number): number;
getBoolean(name: string, defaultValue: boolean): boolean;
getEnum<T extends string>(name: string, validValues: T[], defaultValue: T): T;
set(name: string, value: string): void;
setIfNotSet(name: string, value: string): void;
}
declare class ConfigurationManager {
private static instance;
private config;
private builder;
private constructor();
static getInstance(): ConfigurationManager;
load(): AppConfig;
get(): AppConfig;
reload(): AppConfig;
getEnvironment(): EnvironmentManager;
validate(): {
valid: boolean;
errors: string[];
};
}
export declare const configManager: ConfigurationManager;
export declare const envManager: EnvironmentManager;
export declare function setEnvironmentFromCLI(options: CLIOptions): void;
export declare function getConfigurationSummary(): string;
export declare function getAppConfiguration(): AppConfig;
export declare function getEnvironmentVariable(name: string, defaultValue?: string): string | undefined;
export declare function setEnvironmentVariable(name: string, value: string): void;
export declare function setEnvironmentIfNotSet(name: string, value: string): void;
export declare const DEFAULT_HEADERS: {
readonly 'User-Agent': "mcp-cve-intelligence-server-lite-test/0.1.0-alpha.0-20250803T114838 (Security Research - CVE Intelligence Server)";
readonly Accept: "application/json";
readonly 'Accept-Language': "en-US,en;q=0.9";
};
export {};
//# sourceMappingURL=index.d.ts.map