Meta MCP Server Trigger icon

Meta MCP Server Trigger

Exposeert n8n tools als een MCP Server endpoint

Meta MCP Server Trigger

AI-generated

Summary

Starts an MCP (Model Context Protocol) server endpoint inside n8n that exposes the tools connected to its AI Tool input to MCP clients over SSE or Streamable HTTP. A workflow execution is triggered each time a client calls a tool.

Inputs

  • authentication — How clients authenticate: None (default), Bearer Auth (uses httpBearerAuth credential) or Header Auth (uses httpHeaderAuth credential).
  • path (required) — Base webhook path for the MCP server. In node version 2 the same path serves GET (SSE setup), POST (messages / Streamable HTTP) and DELETE (end session). Version 1 appends /sse and /messages.

Output shape

On tool calls (tools/call), emits one item per executed tool call, with json containing name, arguments, bonnieHeaders, result, and isError (only on failure). If no calls were logged, emits a single empty item. Other MCP requests (initialize, list tools, DELETE, SSE setup) get their responses directly and do not start workflow data.

The response to the MCP client is written directly (noWebhookResponse). Tool arguments are merged with any request headers beginning with x-bonnie-, which are converted to lowercase underscore keys (e.g. x_bonnie_foo), passed to the tool, and also available through an AsyncLocalStorage context. Tool names must be unique or the node throws an error. Tool results are returned to the client as text (objects are JSON-stringified); tool errors are returned as isError content. Each tool's meta (from the source node's 'meta' parameter, plus source node name/type) is included in the tools list. Sessions are held in memory; POSTs with an unknown session ID that aren't Streamable HTTP initialization attempts create a new session.

Examples

Example 1: Expose n8n tools to an MCP client such as Claude Desktop without authentication

Authentication: None; Path: my-mcp; connect Tool nodes to the Tools input; point the client at the production URL.

Example 2: Protect the MCP server with a bearer token

Authentication: Bearer Auth with an httpBearerAuth credential; Path: secure-mcp; clients send Authorization: Bearer .

Example 3: Pass per-request context to tools

Client sends headers like x-bonnie-user-id; tools receive x_bonnie_user_id in their arguments, and the trigger output includes it under bonnieHeaders.

Links

Discussion