UNPKG

@dollhousemcp/mcp-server

Version:

DollhouseMCP - A Model Context Protocol (MCP) server that enables dynamic AI persona management from markdown files, allowing Claude and other compatible AI assistants to activate and switch between different behavioral personas.

366 lines 8.97 kB
#!/usr/bin/env node import { type IndicatorConfig } from './config/indicator-config.js'; import { IToolHandler } from './server/index.js'; export declare class DollhouseMCPServer implements IToolHandler { private server; private personasDir; private personas; private activePersona; private currentUser; private apiCache; private collectionCache; private rateLimitTracker; private indicatorConfig; private githubClient; private githubAuthManager; private collectionBrowser; private collectionSearch; private personaDetails; private elementInstaller; private personaSubmitter; private updateManager?; private serverSetup; private personaExporter; private personaImporter?; private personaSharer; private portfolioManager; private migrationManager; private skillManager; private templateManager; private agentManager; constructor(); private initializePortfolio; /** * Initialize collection cache with seed data for anonymous browsing */ private initializeCollectionCache; private getPersonaIndicator; /** * Normalize element type to handle both singular (new) and plural (legacy) forms * This provides backward compatibility during the transition to v1.4.0 */ private normalizeElementType; /** * Sanitize metadata object to prevent prototype pollution * Removes any dangerous properties that could affect Object.prototype */ private sanitizeMetadata; private loadPersonas; listPersonas(): Promise<{ content: { type: string; text: string; }[]; }>; activatePersona(personaIdentifier: string): Promise<{ content: { type: string; text: string; }[]; }>; getActivePersona(): Promise<{ content: { type: string; text: string; }[]; }>; deactivatePersona(): Promise<{ content: { type: string; text: string; }[]; }>; getPersonaDetails(personaIdentifier: string): Promise<{ content: { type: string; text: string; }[]; }>; reloadPersonas(): Promise<{ content: { type: string; text: string; }[]; }>; listElements(type: string): Promise<{ content: { type: string; text: string; }[]; }>; activateElement(name: string, type: string): Promise<{ content: { type: string; text: string; }[]; }>; getActiveElements(type: string): Promise<{ content: { type: string; text: string; }[]; }>; deactivateElement(name: string, type: string): Promise<{ content: { type: string; text: string; }[]; }>; getElementDetails(name: string, type: string): Promise<{ content: { type: string; text: string; }[]; }>; reloadElements(type: string): Promise<{ content: { type: string; text: string; }[]; }>; renderTemplate(name: string, variables: Record<string, any>): Promise<{ content: { type: string; text: string; }[]; }>; executeAgent(name: string, goal: string): Promise<{ content: { type: string; text: string; }[]; }>; createElement(args: { name: string; type: string; description: string; content?: string; metadata?: Record<string, any>; }): Promise<{ content: { type: string; text: string; }[]; }>; editElement(args: { name: string; type: string; field: string; value: string | number | boolean | Record<string, any> | any[]; }): Promise<{ content: { type: string; text: string; }[]; }>; validateElement(args: { name: string; type: string; strict?: boolean; }): Promise<{ content: { type: string; text: string; }[]; }>; deleteElement(args: { name: string; type: string; deleteData?: boolean; }): Promise<{ content: { type: string; text: string; }[]; }>; browseCollection(section?: string, type?: string): Promise<{ content: { type: string; text: string; }[]; }>; searchCollection(query: string): Promise<{ content: { type: string; text: string; }[]; }>; getCollectionContent(path: string): Promise<{ content: { type: string; text: string; }[]; }>; installContent(inputPath: string): Promise<{ content: { type: string; text: string; }[]; }>; submitContent(contentIdentifier: string): Promise<{ content: { type: string; text: string; }[]; }>; getCollectionCacheHealth(): Promise<{ content: { type: string; text: string; }[]; }>; setUserIdentity(username: string, email?: string): Promise<{ content: { type: string; text: string; }[]; }>; getUserIdentity(): Promise<{ content: { type: string; text: string; }[]; }>; clearUserIdentity(): Promise<{ content: { type: string; text: string; }[]; }>; private getCurrentUserForAttribution; setupGitHubAuth(): Promise<{ content: { type: string; text: string; }[]; }>; checkGitHubAuth(): Promise<{ content: { type: string; text: string; }[]; }>; clearGitHubAuth(): Promise<{ content: { type: string; text: string; }[]; }>; /** * Poll for auth completion in the background */ private pollForAuthCompletion; createPersona(name: string, description: string, instructions: string, triggers?: string): Promise<{ content: { type: string; text: string; }[]; }>; editPersona(personaIdentifier: string, field: string, value: string): Promise<{ content: { type: string; text: string; }[]; }>; validatePersona(personaIdentifier: string): Promise<{ content: { type: string; text: string; }[]; }>; checkForUpdates(): Promise<{ content: { type: string; text: string; }[]; }>; updateServer(confirm: boolean): Promise<{ content: { type: string; text: string; }[]; }>; rollbackUpdate(confirm: boolean): Promise<{ content: { type: string; text: string; }[]; }>; getServerStatus(): Promise<{ content: { type: string; text: string; }[]; }>; convertToGitInstallation(targetDir?: string, confirm?: boolean): Promise<{ content: { type: string; text: string; }[]; }>; /** * Configure indicator settings */ configureIndicator(config: Partial<IndicatorConfig>): Promise<{ content: { type: string; text: string; }[]; }>; /** * Get current indicator configuration */ getIndicatorConfig(): Promise<{ content: { type: string; text: string; }[]; }>; /** * Export a single persona */ exportPersona(personaName: string): Promise<{ content: { type: string; text: string; }[]; }>; /** * Export all personas */ exportAllPersonas(includeDefaults?: boolean): Promise<{ content: { type: string; text: string; }[]; }>; /** * Import a persona */ importPersona(source: string, overwrite?: boolean): Promise<{ content: { type: string; text: string; }[]; }>; /** * Share a persona via URL */ sharePersona(personaName: string, expiryDays?: number): Promise<{ content: { type: string; text: string; }[]; }>; /** * Import from a shared URL */ importFromUrl(url: string, overwrite?: boolean): Promise<{ content: { type: string; text: string; }[]; }>; run(): Promise<void>; } //# sourceMappingURL=index.d.ts.map