mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-03-31 14:43:09 +00:00
Add new MCP tool that enables AI-powered workflow generation from natural language descriptions. Uses handler delegation pattern — hosting environments inject a GenerateWorkflowHandler via EngineOptions, self-hosted instances receive a hosted-only informational response. Handler flows through N8NMCPEngine → SingleSessionHTTPServer → N8NDocumentationMCPServer with helpers for createWorkflow, validateWorkflow, autofixWorkflow, and getWorkflow. Includes full tool documentation, tests, and corrected tools overview count. Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
95 lines
3.0 KiB
TypeScript
95 lines
3.0 KiB
TypeScript
import { InstanceContext } from '../types/instance-context';
|
|
import { GenerateWorkflowHandler } from '../types/generate-workflow';
|
|
import { EarlyErrorLogger } from '../telemetry/early-error-logger';
|
|
interface MCPServerOptions {
|
|
generateWorkflowHandler?: GenerateWorkflowHandler;
|
|
}
|
|
export declare class N8NDocumentationMCPServer {
|
|
private server;
|
|
private db;
|
|
private repository;
|
|
private templateService;
|
|
private initialized;
|
|
private cache;
|
|
private clientInfo;
|
|
private instanceContext?;
|
|
private previousTool;
|
|
private previousToolTimestamp;
|
|
private earlyLogger;
|
|
private disabledToolsCache;
|
|
private useSharedDatabase;
|
|
private sharedDbState;
|
|
private isShutdown;
|
|
private generateWorkflowHandler?;
|
|
constructor(instanceContext?: InstanceContext, earlyLogger?: EarlyErrorLogger, options?: MCPServerOptions);
|
|
close(): Promise<void>;
|
|
private initializeDatabase;
|
|
private initializeInMemorySchema;
|
|
private parseSQLStatements;
|
|
private ensureInitialized;
|
|
private dbHealthChecked;
|
|
private validateDatabaseHealth;
|
|
private getDisabledTools;
|
|
private setupHandlers;
|
|
private sanitizeValidationResult;
|
|
private validateToolParams;
|
|
private validateToolParamsBasic;
|
|
private validateExtractedArgs;
|
|
private coerceStringifiedJsonParams;
|
|
private listNodes;
|
|
private getNodeInfo;
|
|
private searchNodes;
|
|
private searchNodesFTS;
|
|
private searchNodesFuzzy;
|
|
private calculateFuzzyScore;
|
|
private getEditDistance;
|
|
private searchNodesLIKE;
|
|
private calculateRelevance;
|
|
private calculateRelevanceScore;
|
|
private rankSearchResults;
|
|
private listAITools;
|
|
private getNodeDocumentation;
|
|
private safeJsonParse;
|
|
private getDatabaseStatistics;
|
|
private buildOperationsTree;
|
|
private getNodeEssentials;
|
|
private getNode;
|
|
private handleInfoMode;
|
|
private handleVersionMode;
|
|
private getVersionSummary;
|
|
private getVersionHistory;
|
|
private compareVersions;
|
|
private getBreakingChanges;
|
|
private getMigrations;
|
|
private enrichPropertyWithTypeInfo;
|
|
private enrichPropertiesWithTypeInfo;
|
|
private searchNodeProperties;
|
|
private getPropertyValue;
|
|
private listTasks;
|
|
private validateNodeConfig;
|
|
private getPropertyDependencies;
|
|
private getNodeAsToolInfo;
|
|
private getOutputDescriptions;
|
|
private getCommonAIToolUseCases;
|
|
private buildToolVariantGuidance;
|
|
private getAIToolExamples;
|
|
private validateNodeMinimal;
|
|
private getToolsDocumentation;
|
|
connect(transport: any): Promise<void>;
|
|
private listTemplates;
|
|
private listNodeTemplates;
|
|
private getTemplate;
|
|
private searchTemplates;
|
|
private workflowPatternsCache;
|
|
private getWorkflowPatterns;
|
|
private getTemplatesForTask;
|
|
private searchTemplatesByMetadata;
|
|
private getTaskDescription;
|
|
private validateWorkflow;
|
|
private validateWorkflowConnections;
|
|
private validateWorkflowExpressions;
|
|
run(): Promise<void>;
|
|
shutdown(): Promise<void>;
|
|
}
|
|
export {};
|
|
//# sourceMappingURL=server.d.ts.map
|