chore: add pre-built dist folder for npx usage

This commit is contained in:
thesved
2025-12-04 20:22:02 +02:00
committed by Romuald Członkowski
parent a70d96a373
commit 5057481e70
716 changed files with 48021 additions and 0 deletions

8
dist/n8n/MCPApi.credentials.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
import { ICredentialType, INodeProperties } from 'n8n-workflow';
export declare class MCPApi implements ICredentialType {
name: string;
displayName: string;
documentationUrl: string;
properties: INodeProperties[];
}
//# sourceMappingURL=MCPApi.credentials.d.ts.map

1
dist/n8n/MCPApi.credentials.d.ts.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"MCPApi.credentials.d.ts","sourceRoot":"","sources":["../../src/n8n/MCPApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,qBAAa,MAAO,YAAW,eAAe;IAC5C,IAAI,SAAY;IAChB,WAAW,SAAa;IACxB,gBAAgB,SAAS;IACzB,UAAU,EAAE,eAAe,EAAE,CAwC3B;CACH"}

53
dist/n8n/MCPApi.credentials.js vendored Normal file
View File

@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MCPApi = void 0;
class MCPApi {
constructor() {
this.name = 'mcpApi';
this.displayName = 'MCP API';
this.documentationUrl = 'mcp';
this.properties = [
{
displayName: 'Server URL',
name: 'serverUrl',
type: 'string',
default: 'http://localhost:3000',
placeholder: 'http://localhost:3000',
description: 'The URL of the MCP server',
},
{
displayName: 'Authentication Token',
name: 'authToken',
type: 'string',
typeOptions: {
password: true,
},
default: '',
description: 'Authentication token for the MCP server (if required)',
},
{
displayName: 'Connection Type',
name: 'connectionType',
type: 'options',
options: [
{
name: 'HTTP',
value: 'http',
},
{
name: 'WebSocket',
value: 'websocket',
},
{
name: 'STDIO',
value: 'stdio',
},
],
default: 'http',
description: 'How to connect to the MCP server',
},
];
}
}
exports.MCPApi = MCPApi;
//# sourceMappingURL=MCPApi.credentials.js.map

1
dist/n8n/MCPApi.credentials.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"MCPApi.credentials.js","sourceRoot":"","sources":["../../src/n8n/MCPApi.credentials.ts"],"names":[],"mappings":";;;AAKA,MAAa,MAAM;IAAnB;QACE,SAAI,GAAG,QAAQ,CAAC;QAChB,gBAAW,GAAG,SAAS,CAAC;QACxB,qBAAgB,GAAG,KAAK,CAAC;QACzB,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,uBAAuB;gBAChC,WAAW,EAAE,uBAAuB;gBACpC,WAAW,EAAE,2BAA2B;aACzC;YACD;gBACE,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACX,QAAQ,EAAE,IAAI;iBACf;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,uDAAuD;aACrE;YACD;gBACE,WAAW,EAAE,iBAAiB;gBAC9B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,KAAK,EAAE,MAAM;qBACd;oBACD;wBACE,IAAI,EAAE,WAAW;wBACjB,KAAK,EAAE,WAAW;qBACnB;oBACD;wBACE,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,OAAO;qBACf;iBACF;gBACD,OAAO,EAAE,MAAM;gBACf,WAAW,EAAE,kCAAkC;aAChD;SACF,CAAC;IACJ,CAAC;CAAA;AA7CD,wBA6CC"}

13
dist/n8n/MCPNode.node.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
export declare class MCPNode implements INodeType {
description: INodeTypeDescription;
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
private getMCPClient;
private callMCPTool;
private listMCPTools;
private readMCPResource;
private listMCPResources;
private getMCPPrompt;
private listMCPPrompts;
}
//# sourceMappingURL=MCPNode.node.d.ts.map

1
dist/n8n/MCPNode.node.d.ts.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"MCPNode.node.d.ts","sourceRoot":"","sources":["../../src/n8n/MCPNode.node.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAErB,MAAM,cAAc,CAAC;AAItB,qBAAa,OAAQ,YAAW,SAAS;IACvC,WAAW,EAAE,oBAAoB,CA+H/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;YAwEzD,YAAY;YAUZ,WAAW;YAUX,YAAY;YASZ,eAAe;YAUf,gBAAgB;YAShB,YAAY;YAUZ,cAAc;CAQ7B"}

260
dist/n8n/MCPNode.node.js vendored Normal file
View File

@@ -0,0 +1,260 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MCPNode = void 0;
const n8n_workflow_1 = require("n8n-workflow");
const mcp_client_1 = require("../utils/mcp-client");
const bridge_1 = require("../utils/bridge");
class MCPNode {
constructor() {
this.description = {
displayName: 'MCP',
name: 'mcp',
icon: 'file:mcp.svg',
group: ['transform'],
version: 1,
description: 'Interact with Model Context Protocol (MCP) servers',
defaults: {
name: 'MCP',
},
inputs: ['main'],
outputs: ['main'],
credentials: [
{
name: 'mcpApi',
required: true,
},
],
properties: [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Call Tool',
value: 'callTool',
description: 'Execute an MCP tool',
},
{
name: 'List Tools',
value: 'listTools',
description: 'List available MCP tools',
},
{
name: 'Read Resource',
value: 'readResource',
description: 'Read an MCP resource',
},
{
name: 'List Resources',
value: 'listResources',
description: 'List available MCP resources',
},
{
name: 'Get Prompt',
value: 'getPrompt',
description: 'Get an MCP prompt',
},
{
name: 'List Prompts',
value: 'listPrompts',
description: 'List available MCP prompts',
},
],
default: 'callTool',
},
{
displayName: 'Tool Name',
name: 'toolName',
type: 'string',
required: true,
displayOptions: {
show: {
operation: ['callTool'],
},
},
default: '',
description: 'Name of the MCP tool to execute',
},
{
displayName: 'Tool Arguments',
name: 'toolArguments',
type: 'json',
required: false,
displayOptions: {
show: {
operation: ['callTool'],
},
},
default: '{}',
description: 'Arguments to pass to the MCP tool',
},
{
displayName: 'Resource URI',
name: 'resourceUri',
type: 'string',
required: true,
displayOptions: {
show: {
operation: ['readResource'],
},
},
default: '',
description: 'URI of the MCP resource to read',
},
{
displayName: 'Prompt Name',
name: 'promptName',
type: 'string',
required: true,
displayOptions: {
show: {
operation: ['getPrompt'],
},
},
default: '',
description: 'Name of the MCP prompt to retrieve',
},
{
displayName: 'Prompt Arguments',
name: 'promptArguments',
type: 'json',
required: false,
displayOptions: {
show: {
operation: ['getPrompt'],
},
},
default: '{}',
description: 'Arguments to pass to the MCP prompt',
},
],
};
}
async execute() {
const items = this.getInputData();
const returnData = [];
const operation = this.getNodeParameter('operation', 0);
const credentials = await this.getCredentials('mcpApi');
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
try {
let result;
switch (operation) {
case 'callTool':
const toolName = this.getNodeParameter('toolName', itemIndex);
const toolArgumentsJson = this.getNodeParameter('toolArguments', itemIndex);
const toolArguments = JSON.parse(toolArgumentsJson);
result = await this.callMCPTool(credentials, toolName, toolArguments);
break;
case 'listTools':
result = await this.listMCPTools(credentials);
break;
case 'readResource':
const resourceUri = this.getNodeParameter('resourceUri', itemIndex);
result = await this.readMCPResource(credentials, resourceUri);
break;
case 'listResources':
result = await this.listMCPResources(credentials);
break;
case 'getPrompt':
const promptName = this.getNodeParameter('promptName', itemIndex);
const promptArgumentsJson = this.getNodeParameter('promptArguments', itemIndex);
const promptArguments = JSON.parse(promptArgumentsJson);
result = await this.getMCPPrompt(credentials, promptName, promptArguments);
break;
case 'listPrompts':
result = await this.listMCPPrompts(credentials);
break;
default:
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`);
}
returnData.push({
json: result,
pairedItem: itemIndex,
});
}
catch (error) {
if (this.continueOnFail()) {
returnData.push({
json: {
error: error instanceof Error ? error.message : 'Unknown error',
},
pairedItem: itemIndex,
});
continue;
}
throw error;
}
}
return [returnData];
}
async getMCPClient(credentials) {
const client = new mcp_client_1.MCPClient({
serverUrl: credentials.serverUrl,
authToken: credentials.authToken,
connectionType: credentials.connectionType || 'websocket',
});
await client.connect();
return client;
}
async callMCPTool(credentials, toolName, args) {
const client = await this.getMCPClient(credentials);
try {
const result = await client.callTool(toolName, args);
return bridge_1.N8NMCPBridge.mcpToN8NExecutionData(result).json;
}
finally {
await client.disconnect();
}
}
async listMCPTools(credentials) {
const client = await this.getMCPClient(credentials);
try {
return await client.listTools();
}
finally {
await client.disconnect();
}
}
async readMCPResource(credentials, uri) {
const client = await this.getMCPClient(credentials);
try {
const result = await client.readResource(uri);
return bridge_1.N8NMCPBridge.mcpToN8NExecutionData(result).json;
}
finally {
await client.disconnect();
}
}
async listMCPResources(credentials) {
const client = await this.getMCPClient(credentials);
try {
return await client.listResources();
}
finally {
await client.disconnect();
}
}
async getMCPPrompt(credentials, promptName, args) {
const client = await this.getMCPClient(credentials);
try {
const result = await client.getPrompt(promptName, args);
return bridge_1.N8NMCPBridge.mcpPromptArgsToN8N(result);
}
finally {
await client.disconnect();
}
}
async listMCPPrompts(credentials) {
const client = await this.getMCPClient(credentials);
try {
return await client.listPrompts();
}
finally {
await client.disconnect();
}
}
}
exports.MCPNode = MCPNode;
//# sourceMappingURL=MCPNode.node.js.map

1
dist/n8n/MCPNode.node.js.map vendored Normal file

File diff suppressed because one or more lines are too long