@iflow-mcp/ejmockler-brutalist
Version:
Deploy Claude, Codex & Gemini CLI agents to demolish your work before users do. Real file analysis. Brutal honesty. Now with conversation continuation & intelligent pagination.
79 lines • 2.74 kB
TypeScript
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { BrutalistServerConfig } from './types/brutalist.js';
/**
* BrutalistServer - Composition root for the Brutalist MCP Server
*
* This class has been refactored to follow the Single Responsibility Principle.
* Responsibilities are now delegated to specialized modules:
* - ResponseFormatter: Handles all response formatting and pagination
* - HttpTransport: Manages HTTP server and CORS
* - ToolHandler: Handles roast tool execution, caching, and conversation continuation
*/
export declare class BrutalistServer {
server: McpServer;
config: BrutalistServerConfig;
private cliOrchestrator;
private responseCache;
private formatter;
private toolHandler;
private httpTransport?;
private activeSessions;
private readonly MAX_SESSIONS;
private readonly SESSION_TTL_MS;
private sessionCleanupTimer?;
constructor(config?: BrutalistServerConfig);
start(): Promise<void>;
private startStdioServer;
private startHttpServer;
getActualPort(): number | undefined;
stop(): Promise<void>;
/**
* Clean up stale sessions that exceed TTL
*/
private cleanupStaleSessions;
/**
* Ensure session capacity doesn't exceed MAX_SESSIONS
* Evicts oldest sessions when capacity is reached
*/
ensureSessionCapacity(): void;
cleanup(): Promise<void>;
/**
* Handle streaming events from CLI agents
*/
private handleStreamingEvent;
/**
* Handle progress updates from CLI agents
*/
private handleProgressUpdate;
/**
* Register all MCP tools
*
* TOOL REDUCTION STRATEGY: Only expose 4 gateway tools instead of 15.
* The unified `roast` tool with domain parameter replaces all 11 roast_* tools.
* This reduces cognitive load for AI agents while maintaining full functionality.
*/
private registerTools;
/**
* Register special tools (debate, roster, unified roast)
*/
private registerSpecialTools;
/**
* Handle unified roast tool - routes to appropriate domain handler
*/
private handleUnifiedRoast;
/**
* Handle debate tool execution with constitutional position anchoring.
* Uses 2 randomly selected agents (or user-specified) with explicit PRO/CON positions.
*/
private handleDebateToolExecution;
/**
* Execute CLI debate with constitutional position anchoring.
* 2 agents, explicit PRO/CON positions, context compression between rounds.
*/
private executeCLIDebate;
/**
* Synthesize debate results into formatted output
*/
private synthesizeDebate;
}
//# sourceMappingURL=brutalist-server.d.ts.map