Files
n8n-mcp/src/n8n/MCPApi.credentials.ts
czlonkowski 1f8140c45c Implement n8n-MCP integration
This commit adds a complete integration between n8n workflow automation and the Model Context Protocol (MCP):

Features:
- MCP server that exposes n8n workflows as tools, resources, and prompts
- Custom n8n node for connecting to MCP servers from workflows
- Bidirectional bridge for data format conversion
- Token-based authentication and credential management
- Comprehensive error handling and logging
- Full test coverage for core components

Infrastructure:
- TypeScript/Node.js project setup with proper build configuration
- Docker support with multi-stage builds
- Development and production docker-compose configurations
- Installation script for n8n custom node deployment

Documentation:
- Detailed README with usage examples and API reference
- Environment configuration templates
- Troubleshooting guide

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-07 15:43:02 +00:00

51 lines
1.1 KiB
TypeScript

import {
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class MCPApi implements ICredentialType {
name = 'mcpApi';
displayName = 'MCP API';
documentationUrl = 'mcp';
properties: INodeProperties[] = [
{
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',
},
];
}