Wat is MCP (Model Context Protocol)?
Het Model Context Protocol (MCP) is een open standaard die AI-modellen in staat stelt om veilig te communiceren met externe tools, API's en data bronnen. Ontwikkeld door Anthropic, is MCP snel de standaard geworden voor AI tool integraties.
n8n ondersteunt MCP sinds recente versies met twee nodes:
- MCP Client: Verbind n8n met externe MCP servers
- MCP Server Trigger: Stel n8n workflows beschikbaar als MCP tools
Waarom MCP belangrijk is
MCP maakt het mogelijk om AI-assistenten zoals Claude Desktop, Cline en andere tools te laten interacteren met je eigen systemen, databases en API's zonder custom integraties te bouwen.
Top use cases voor MCP in n8n
1. Claude Desktop integratie
Gebruik Claude Desktop om je n8n workflows aan te sturen. Claude kan:
- Workflows activeren via natuurlijke taal commando's
- Data opvragen uit je databases
- Rapporten genereren en versturen
- Complex automatiseringstaken uitvoeren
2. Cline (VS Code) integratie
Cline is een AI coding assistant in VS Code. Met MCP kan Cline:
- Je n8n workflows aanroepen tijdens coding
- Automatisch data fetchen voor development
- Deployments triggeren
- Testing automatiseren
3. Custom AI assistants
Bouw je eigen AI assistant die gebruikmaakt van je bedrijfsdata en workflows via MCP.
MCP Client: Verbind n8n met externe MCP servers
Met de MCP Client node kan n8n verbinding maken met elke MCP-compatibele server en diens tools gebruiken.
Stap 1: MCP Client node toevoegen
- Voeg een MCP Client node toe aan je workflow
- Configureer de MCP server URL
- Voeg authentication headers toe (indien nodig)
Stap 2: MCP server configureren
Voorbeeld configuratie voor verschillende MCP servers:
Claude Desktop MCP Server
// MCP Client node configuration
{
"serverType": "stdio",
"command": "npx",
"args": ["-y", "@anthropic/claude-desktop-mcp"],
"env": {
"ANTHROPIC_API_KEY": "=credentials.anthropic_api_key"
}
}
Remote MCP Server (HTTP)
// MCP Client node configuration
{
"serverType": "http",
"url": "https://api.example.com/mcp",
"headers": {
"Authorization": "Bearer your_api_key"
}
}
Stap 3: Tools gebruiken
Na verbinding kun je de beschikbare tools selecteren en gebruiken in je workflow:
- Klik op de MCP Client node
- Zie de lijst met beschikbare tools
- Selecteer de gewenste tool
- Configureer parameters
- Voer uit
Voorbeeld: GitHub MCP server
Verbind n8n met GitHub via MCP:
// MCP Client node - GitHub
{
"serverType": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "=credentials.github_token"
}
}
// Beschikbare tools:
// - search_repositories
// - get_repository
// - create_issue
// - create_pull_request
// - list_commits
// - ...
MCP Server Trigger: Stel n8n workflows bloot als MCP tools
Met de MCP Server Trigger node kun je je n8n workflows beschikbaar maken als tools voor externe AI-assistenten.
Stap 1: MCP Server Trigger node toevoegen
- Voeg een MCP Server Trigger node toe aan je workflow
- Definieer de tools die je wilt blootstellen
- Configureer authentication (optioneel)
Stap 2: Tools definiëren
Definieer welke acties je workflow kan uitvoeren:
// MCP Server Trigger - tool definities
{
"tools": [
{
"name": "get_customer_data",
"description": "Haal klantgegevens op uit CRM",
"inputSchema": {
"type": "object",
"properties": {
"customer_id": {
"type": "string",
"description": "Klant ID"
},
"include_orders": {
"type": "boolean",
"description": "Inclusief bestelgeschiedenis"
}
},
"required": ["customer_id"]
}
},
{
"name": "create_invoice",
"description": "Maak een nieuwe factuur",
"inputSchema": {
"type": "object",
"properties": {
"customer_id": {
"type": "string"
},
"amount": {
"type": "number"
},
"description": {
"type": "string"
}
},
"required": ["customer_id", "amount"]
}
}
]
}
Stap 3: Workflow implementeren
Implementeer de logica voor elke tool in je workflow:
// Code node - implementeer tool logic
const toolName = $input.item.json.tool;
const toolInput = $input.item.json.input;
if (toolName === 'get_customer_data') {
// Haal klantdata uit database
const customer = await getCustomer(toolInput.customer_id);
if (toolInput.include_orders) {
customer.orders = await getOrders(toolInput.customer_id);
}
return { json: customer };
}
if (toolName === 'create_invoice') {
// Maak factuur
const invoice = await createInvoice({
customerId: toolInput.customer_id,
amount: toolInput.amount,
description: toolInput.description
});
return { json: invoice };
}
Stap 4: Workflow activeren
Activeer de workflow. Je krijgt een MCP endpoint URL:
https://your-n8n-instance.com/webhook/mcp/your-workflow-id
Claude Desktop configureren met n8n MCP server
Nu je n8n workflow beschikbaar is als MCP server, kun je Claude Desktop configureren om deze te gebruiken.
Stap 1: Claude Desktop config file openen
Open of maak het configuratiebestand:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Stap 2: MCP server toevoegen
{
"mcpServers": {
"n8n-customer-tools": {
"type": "http",
"url": "https://your-n8n-instance.com/webhook/mcp/your-workflow-id",
"headers": {
"Authorization": "Bearer your-api-key"
}
}
}
}
Stap 3: Claude Desktop herstarten
Herstart Claude Desktop om de nieuwe MCP server te laden.
Stap 4: Gebruiken in Claude
Je kunt nu in Claude Desktop je n8n tools gebruiken:
Gebruiker: "Haal de klantgegevens op voor klant ID 12345"
Claude: [gebruikt get_customer_data tool via MCP]
"Ik heb de klantgegevens opgehaald:
- Naam: Jan de Vries
- Email: jan@example.com
- Laatste bestelling: 2 februari 2026
- Totaal aantal bestellingen: 15"
Cline (VS Code) configureren met n8n MCP server
Cline is een krachtige AI coding assistant in VS Code die MCP ondersteunt.
Stap 1: Cline extension installeren
- Open VS Code
- Ga naar Extensions
- Zoek "Cline"
- Installeer de extension
Stap 2: MCP server configureren
Open Cline instellingen en voeg je n8n MCP server toe:
// Cline MCP configuratie
{
"mcpServers": {
"n8n-dev-tools": {
"type": "streamableHttp",
"url": "https://your-n8n-instance.com/webhook/mcp/your-workflow-id",
"headers": {
"Authorization": "Bearer your-api-key"
}
}
}
}
Stap 3: Gebruiken in Cline
Voorbeeld workflow tijdens development:
Developer: "Maak een nieuwe factuur van €500 voor klant ABC123"
Cline: [gebruikt create_invoice tool via MCP]
"Ik heb de factuur aangemaakt:
- Factuurnummer: INV-2026-0892
- Bedrag: €500
- Klant: ABC123
- Status: Concept
Wil je de factuur versturen?"
Geavanceerde MCP use cases
1. Multi-tool AI agent
Combineer meerdere MCP tools in één workflow:
// Workflow: Klant onboarding automatisering
1. MCP Client (GitHub): Haal repository op
2. MCP Client (Slack): Haal team info op
3. MCP Client (Notion): Maak project board
4. MCP Client (Email): Verstuur welcome email
5. MCP Client (Database): Maak klant account
6. Code node: Genereer rapport
7. MCP Client (Google Sheets): Update tracking sheet
2. Bidirectionele integratie
Gebruik n8n als MCP server én client:
// Workflow architecture
Claude Desktop
↓ MCP request
n8n MCP Server Trigger
↓ Process
MCP Client node (GitHub)
↓ Get data
Code node (transformation)
↓ Process
MCP Client node (Slack)
↓ Send result
Claude Desktop receives response
3. Enterprise MCP gateway
Bouw een centrale MCP gateway voor je organisatie:
- Centralized authentication: Eén punt voor API key management
- Rate limiting: Voorkom overload
- Audit logging: Track alle MCP aanroepen
- Transformations: Normaliseer data formaten
- Caching: Verbeter performance
MCP security best practices
1. Authentication
Gebruik altijd authentication voor je MCP servers:
// MCP Server Trigger - authentication
{
"authentication": {
"type": "header",
"headerName": "Authorization",
"headerValue": "Bearer {{credentials.mcp_api_key}}"
}
}
2. Rate limiting
Bescherm je MCP servers tegen misbruik:
// Code node - rate limiting
const rateLimiter = {
maxRequests: 100,
windowMs: 60000, // 1 minuut
requests: new Map()
};
const clientId = $input.item.json.clientId;
const now = Date.now();
if (!rateLimiter.requests.has(clientId)) {
rateLimiter.requests.set(clientId, []);
}
const requests = rateLimiter.requests.get(clientId);
const recentRequests = requests.filter(time => now - time < rateLimiter.windowMs);
if (recentRequests.length >= rateLimiter.maxRequests) {
throw new Error('Rate limit exceeded');
}
recentRequests.push(now);
rateLimiter.requests.set(clientId, recentRequests);
3. Input validation
Valideer alle input van MCP clients:
// Code node - input validatie
const Joi = require('joi');
const schema = Joi.object({
customer_id: Joi.string().required(),
amount: Joi.number().positive().required(),
description: Joi.string().max(500).required()
});
const { error, value } = schema.validate($input.item.json.input);
if (error) {
throw new Error(`Invalid input: ${error.details[0].message}`);
}
4. Audit logging
Log alle MCP activiteit:
// Code node - audit logging
const auditLog = {
timestamp: new Date().toISOString(),
tool: $input.item.json.tool,
input: $input.item.json.input,
client: $input.item.json.clientId,
user: $input.item.json.user,
result: 'success',
duration: executionTime
};
// Schrijf naar database of log service
await writeAuditLog(auditLog);
Beschikbare MCP servers
Officiële MCP servers
| Server | Functie | Installatie |
|---|---|---|
| GitHub | Repository management, issues, PR's | @modelcontextprotocol/server-github |
| Filesystem | Bestandssysteem toegang | @modelcontextprotocol/server-filesystem |
| PostgreSQL | Database queries | @modelcontextprotocol/server-postgres |
| SQLite | Lokale database | @modelcontextprotocol/server-sqlite |
| Brave Search | Web search | @modelcontextprotocol/server-brave-search |
| Google Maps | Location services | @modelcontextprotocol/server-google-maps |
Community MCP servers
Er zijn talloze community-built MCP servers beschikbaar voor:
- Slack, Discord, Teams
- Google Workspace (Sheets, Drive, Calendar)
- Notion, Linear, Jira
- AWS services (S3, Lambda, EC2)
- OpenAI, Anthropic, Google AI
- En veel meer...
Troubleshooting MCP integraties
Issue 1: Connection refused
Error: MCP server connection refused
Oplossingen:
- Controleer of MCP server actief is
- Verify URL en port
- Check firewall settings
- Verify authentication credentials
Issue 2: Tool not found
Error: Tool 'xyz' not found
Oplossingen:
- Controleer tool naam (case-sensitive)
- Verify tool is exposed in MCP Server Trigger
- Check inputSchema definition
- Restart n8n workflow
Issue 3: Authentication failed
Error: 401 Unauthorized
Oplossingen:
- Verify API key is correct
- Check header format:
Bearer your-key - Verify credentials in n8n
- Check credential sharing permissions
MCP vs. n8n native integraties
Wanneer kies je voor MCP vs. native n8n integraties?
| Criteria | Native n8n nodes | MCP integraties |
|---|---|---|
| Use binnen n8n | ✅ Optimaal | ✅ Goed |
| Use buiten n8n (Claude, Cline) | ❌ Niet mogelijk | ✅ Ideaal |
| Eenvoudige setup | ✅ Makkelijk | ⚠️ Complexer |
| Performance | ✅ Direct | ⚠️ Extra laag |
| Flexibiliteit | ✅ Native features | ✅ Universeel |
Aanbeveling: Gebruik native n8n nodes voor interne automatisering. Gebruik MCP wanneer je AI-assistenten buiten n8n toegang wilt geven tot je workflows.
Conclusie
MCP (Model Context Protocol) is een krachtige standaard die n8n verbindt met de bredere AI ecosystem. Of je nu Claude Desktop, Cline of andere AI tools gebruikt, MCP maakt het mogelijk om je n8n workflows te integreren op een veilige en gestandaardiseerde manier.
Key takeaways:
- MCP Client node: Verbind n8n met externe MCP servers
- MCP Server Trigger node: Stel n8n workflows bloot als MCP tools
- Claude Desktop integratie: Natuurlijke taal interface voor je workflows
- Cline integratie: AI coding assistant met workflow toegang
- Security: Altijd authentication, rate limiting en validatie gebruiken
Klaar om te beginnen? Probeer een simpele MCP integratie met Claude Desktop en ontdek de mogelijkheden. Begin met een basis workflow en breid langzaam uit.
Heb je vragen over MCP implementatie? Laat een reactie achter of neem contact op via onze support.