UNPKG

mcp-web-ui

Version:

Ultra-lightweight vanilla JavaScript framework for MCP servers - Zero dependencies, perfect security, 2-3KB bundle size

102 lines 2.78 kB
/** * UIServer Configuration System * Enables configuration-driven server behavior following Generic Component Architecture */ export interface UIServerConfig { server: { bindAddress: string; enableCompression: boolean; enableRateLimit: boolean; maxRequestSize: string; }; proxyMode?: boolean; serverName?: string; security: { enableCSP: boolean; allowedOrigins: string[]; sessionTimeout: number; enableSanitization: boolean; }; resources: { css: { strategy: 'auto' | 'manual' | 'schema-driven'; baseTheme: string; customThemes: ThemeConfig[]; loadOrder: string[]; mcpServerDirectory?: string; }; javascript: { framework: string[]; components: ComponentLoadConfig[]; enableBundling: boolean; }; static: StaticResourceConfig; }; templates: { engine: 'vanilla' | 'custom'; customTemplates: TemplateConfig[]; enableCaching: boolean; defaultLayout: string; }; plugins: { enabled: string[]; config: Record<string, any>; }; } export interface ThemeConfig { name: string; files: string[]; conditions?: { schemaTitle?: string[]; componentTypes?: string[]; }; source?: 'framework' | 'mcp-server'; priority: number; } export interface ComponentLoadConfig { name: string; files: string[]; dependencies: string[]; loadCondition: (schema: { components: Array<{ type: string; }>; }) => boolean; } export interface TemplateConfig { name: string; path: string; conditions?: { schemaTitle?: string[]; componentTypes?: string[]; }; } export interface PluginConfig { name: string; enabled: boolean; config: Record<string, any>; loadOrder: number; } export interface StaticResourceConfig { directories: string[]; cacheControl: string; enableCompression: boolean; mcpServerDirectories?: string[]; } /** * Default configuration following progressive enhancement principles */ export declare const DEFAULT_UI_SERVER_CONFIG: UIServerConfig; /** * Configuration builder for easy setup */ export declare class UIServerConfigBuilder { private config; static create(): UIServerConfigBuilder; withTheme(theme: ThemeConfig): UIServerConfigBuilder; withPlugin(name: string, config: any): UIServerConfigBuilder; withCustomCSS(name: string, conditions: ThemeConfig['conditions']): UIServerConfigBuilder; withStaticDirectory(dir: string): UIServerConfigBuilder; build(): UIServerConfig; } //# sourceMappingURL=UIServerConfig.d.ts.map