@simonecoelhosfo/optimizely-mcp-server
Version:
Optimizely MCP Server for AI assistants with integrated CLI tools
109 lines • 3.85 kB
TypeScript
/**
* Main entry point for Optimizely MCP Server
* @description Initializes and starts the MCP server with StdioServerTransport
*
* CRITICAL: This entry point is designed for MCP StdioServerTransport compatibility.
* It uses file-based logging and stderr for debugging to prevent stdout contamination
* which would break the MCP JSON-RPC 2.0 communication protocol.
*
* @author Optimizely MCP Server
* @version 1.0.0
*/
/**
* Main MCP Server class for Optimizely integration
* @description Orchestrates the MCP server initialization, configuration loading,
* and component integration while maintaining separation between business logic
* and MCP protocol concerns.
*/
export declare class OptimizelyMCPServer {
private server;
private config;
private apiHelper;
private cacheManager;
private optimizelyTools;
private syncScheduler;
private isInitialized;
private databaseResetRequired;
private cacheEmpty;
/**
* Creates a new OptimizelyMCPServer instance
* @description Sets up the MCP server with appropriate capabilities
*/
constructor();
/**
* Initializes the server components in the correct order
* @description Loads configuration, sets up logging, initializes Optimizely components
* @throws {Error} When initialization fails
* @private
*/
private initialize;
/**
* Sets up MCP server request handlers
* @description Registers handlers for tools and resources according to MCP protocol
* @private
*/
private setupServerHandlers;
private ensureInitialized;
/**
* Transform rule structure to match Feature Experimentation API requirements
* @param rule - Raw rule object from user input
* @returns Transformed rule object compatible with FX API
*/
private transformRuleForFeatureExperimentation;
/**
* Checks if a banner should be added for the given entity type
* @param entityType - The entity type to check
* @returns True if the entity type is a child entity that should get a banner
*/
private shouldAddBanner;
/**
* Adds template mode banner for all entity-related tools
* @param toolName - The name of the tool being called
* @param entityType - The entity type being listed or retrieved
* @param result - The original result from the tool
* @returns Result with template mode banner added
*/
private addTemplateModeBannerForAllTools;
/**
* Adds template mode banner to list_entities and get_entity_details responses
* @param entityType - The entity type being listed or retrieved
* @param result - The original result from the tool
* @returns Result with template mode banner added (if applicable)
*/
private addTemplateModeBanner;
/**
* Extracts project context from tool arguments
*/
private extractProjectContext;
/**
* Generates tool-specific AI metadata
*/
private getToolSpecificAIMeta;
/**
* Extracts result count from various response patterns
*/
private extractResultCount;
/**
* Starts the MCP server with StdioServerTransport
* @description Sets up stdio transport and starts the server
* @throws {Error} When server startup fails
*/
start(): Promise<void>;
/**
* Gracefully shuts down the server
* @description Closes connections and flushes logs
*/
shutdown(): Promise<void>;
/**
* Helper method to extract the number of projects queried for response wrapper metadata
* @private
*/
private extractProjectsQueried;
}
/**
* Main execution function
* @description Entry point that starts the MCP server and handles graceful shutdown
*/
declare function main(): Promise<void>;
export { main };
//# sourceMappingURL=index.d.ts.map