Skip to main content
< All Topics
Print

Chapter 30: MCP Integrations

Chapter 30: MCP Integrations

Last Updated: 2026-03

## 30.1 What MCP Is

MCP (Model Context Protocol) is an open protocol that allows AI assistants to connect to external tools and data sources. In Cursor, MCP servers appear as additional tools the AI can invoke — similar to function calling, but implemented as standalone server processes.

ITI uses MCP to give Cursor direct access to the n8n API without leaving the IDE.

30.2 The n8n MCP Server

The n8n MCP server exposes the n8n API as a set of tools that Cursor can call during a session. This enables:

  • Creating, validating, and publishing workflows from Cursor
  • Listing existing workflows and their status
  • Triggering test executions
  • Reading workflow logs

Configuration file: ~/.mcp.json (workspace root)


{
    "mcpServers": {
        "n8n": {
            "url": "http://localhost:5678/mcp-server/http",
            "headers": {
                "Authorization": "Bearer YOUR_N8N_API_KEY"
            }
        }
    }
}

Note: The n8n API key is stored in .mcp.json. This file should not be committed to Git if it contains credentials. Add it to .gitignore if needed.


30.3 n8n MCP Tool Reference

The MCP server exposes these tools:

Tool Purpose
get_sdk_reference Load the n8n Workflow SDK documentation
search_nodes Find n8n node types by keyword
get_node_types Get exact parameter definitions for specific nodes
get_suggested_nodes Get curated node recommendations for workflow technique categories
validate_workflow Validate workflow code before creating/updating
create_workflow_from_code Create a new workflow in n8n
update_workflow Update an existing workflow
publish_workflow Activate a workflow (make it live)
archive_workflow Deactivate and archive a workflow

30.4 Using MCP Tools in Cursor

MCP tools are invoked through the Cursor AI — you describe what you want and Cursor calls the appropriate MCP tool.

Example: Create a new workflow


"Create an n8n workflow that receives a webhook, calls the Dify API to retrieve 
relevant knowledge base content, then calls Claude to generate a response, 
and returns the response to the caller."

Cursor will:

  1. Call get_sdk_reference to load SDK patterns.
  2. Call search_nodes to find webhook, HTTP Request, and AI Agent nodes.
  3. Call get_node_types to get exact parameter definitions.
  4. Write the workflow code.
  5. Call validate_workflow to check for errors.
  6. Call create_workflow_from_code to save it.
  7. Call publish_workflow to activate it.

Example: Debug an existing workflow


"The iti-career-coach-session workflow is failing. Check its recent executions 
and tell me what's wrong."

30.5 Checking MCP Server Status

Verify the n8n MCP server is accessible:


curl -s http://localhost:5678/mcp-server/http \
  -H "Authorization: Bearer YOUR_N8N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"method": "tools/list", "params": {}}' | python3 -m json.tool

If this returns a list of tools, the MCP server is operational.


30.6 Adding New MCP Servers

To add a new MCP server:

  1. Install or configure the MCP server (see that server’s documentation).
  2. Add the server configuration to .mcp.json:

{
    "mcpServers": {
        "n8n": { ... existing config ... },
        "my-new-server": {
            "url": "http://localhost:PORT/mcp",
            "headers": {
                "Authorization": "Bearer TOKEN"
            }
        }
    }
}
  1. Restart Cursor to load the new server.
  2. Verify the server appears in Cursor’s MCP tool list.

30.7 MCP vs Direct API Calls

Approach Use When
MCP tool in Cursor Building or modifying n8n workflows during development
Direct API call (curl/code) Automated scripts, CI/CD, production integrations
n8n web UI Visual workflow editing, execution monitoring

Previous: Chapter 29 — Cursor Rules | Next: Chapter 31 — Team Roles

Table of Contents