Sponsored by Deepsite.site

n8n API MCP Server

Created By
jasondsmith729 months ago
MCP Server for interacting with an n8n instance
Content

n8n API MCP Server

A Model Context Protocol (MCP) server designed to interact with a self-hosted n8n instance.

This server provides tools to:

  • Execute calls to the n8n API.
  • Search for n8n API endpoints using a local database populated from an OpenAPI specification.
  • Store and retrieve frequently used or successful API calls using a "Fast Memory" database for quicker natural language access.

Features

Databases

  • API Specification Database (api_spec.db): Stores details about n8n API endpoints, loaded from an OpenAPI/Swagger JSON file. Used by search and detail tools.
  • Fast Memory Database (fast_memory.db): Caches successful API calls linked to natural language queries. Allows for quick retrieval of previously used calls and suggests saving new successful calls.

Tools

  • search_api_endpoints: Search the local API spec database for endpoints matching a query (path, summary, description, tags).
  • get_api_endpoint_details: Retrieve detailed information (parameters, request body, responses) for a specific endpoint (path and method) from the local API spec database.
  • execute_api_call: Execute an API call to the configured n8n instance. Checks Fast Memory first; if not found, prompts to save the call to Fast Memory upon success.
  • natural_language_api_search: Search for API calls using natural language. Checks Fast Memory first, then falls back to searching the API spec database based on the query.
  • save_to_fast_memory: Manually save an API call (path, method, params, data) along with its original natural language query and a description to the Fast Memory database.
  • list_fast_memory: List entries currently stored in the Fast Memory database, optionally filtering by a search term.
  • delete_from_fast_memory: Delete a specific entry from the Fast Memory database by its ID.
  • clear_fast_memory: Remove all entries from the Fast Memory database.
  • load_api_spec_from_json: Load or update the API Specification database (api_spec.db) by parsing an OpenAPI/Swagger JSON file.
  • send_raw_api_request: Execute an API call using a raw request string (e.g., "GET /workflows?limit=5"). Uses the same underlying logic as execute_api_call, including Fast Memory checks and save prompts.

Setup

  1. Clone the repository:
    git clone https://github.com/jasondsmith72/N8N-api-MCP.git
    cd N8N-api-MCP
    
  2. Install dependencies:
    npm install
    
  3. Build the server:
    npm run build
    
    This compiles the TypeScript code to JavaScript in the build directory.

Configuration

This server requires environment variables to connect to your n8n instance. These are typically set in your MCP client's configuration file (e.g., cline_mcp_settings.json).

  • N8N_URL: The base URL of your n8n instance (e.g., http://your-n8n.example.com). Defaults to http://localhost:5678 if not set.
  • N8N_API_KEY: Your n8n API key for authentication.

Loading the API Specification

Before using the search tools (search_api_endpoints, natural_language_api_search), you need to populate the API Specification database.

  1. Obtain the OpenAPI (Swagger) JSON specification file for your n8n version. This might be available from the n8n documentation or potentially downloadable from your instance (e.g., /api/v1/docs-json).
  2. Use the load_api_spec_from_json tool, providing the absolute path to the downloaded JSON file:
    load_api_spec_from_json(json_file_path="C:\\path\\to\\your\\n8n-openapi.json")
    

Installation for Cline / Claude Desktop

Add the following configuration to your cline_mcp_settings.json (adjust the path to index.js based on your clone location):

{
  "mcpServers": {
    "... other servers ...": {},
    "n8n-api-mcp": {
      "command": "node",
      "args": [
        "C:\\MCP-Servers\\N8N-api-MCP\\build\\index.js" // <-- Update this path if needed
      ],
      "env": {
        "N8N_URL": "YOUR_N8N_INSTANCE_URL", // e.g., "http://192.168.1.100:5678"
        "N8N_API_KEY": "YOUR_N8N_API_KEY_HERE"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

(Remember to replace YOUR_N8N_INSTANCE_URL and YOUR_N8N_API_KEY_HERE with your actual values)

Development

For development with auto-rebuild on file changes:

npm run watch

Debugging

Use the MCP Inspector for easier debugging:

npm run inspector

The Inspector provides a web interface to view MCP communication.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Serper MCP ServerA Serper MCP Server
CursorThe AI Code Editor
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Tavily Mcp
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
ChatWiseThe second fastest AI chatbot™
Playwright McpPlaywright MCP server
DeepChatYour AI Partner on Desktop
WindsurfThe new purpose-built IDE to harness magic