How to Host an MCP Server Without Writing Code
Hosting an MCP server means putting it somewhere the web can reach it. With n8n's MCP Server Trigger node, you can do that without code.
- published
MCP is an open standard for connecting AI apps to outside systems. MCP servers expose your data and tools. To host an MCP server is to put it somewhere the web can reach. Then a client far away can connect at any time. This guide covers how to do that with n8n, without writing code. For a wider look at the node at the center of it, see the n8n MCP server.
What hosting an MCP server means
A local MCP server runs as a process on one machine. A hosted one runs as an endpoint with a URL. The MCP specification says hosts are LLM apps that start connections. It says servers are services that provide context and capabilities. The two talk using JSON-RPC 2.0 messages. When the server is hosted, that talk happens over the web, not inside one computer.
Why client work needs a reachable server
A client's AI app needs to reach the server from wherever it runs. A hosted server gives you one URL to share. If you want to see what a server built this way can hold, read MCP server examples.
Your hosting options with n8n: Cloud vs self-hosting
The docs recommend n8n Cloud if you are not experienced at managing servers. Self-hosting takes real know-how with servers, containers, and security. Mistakes can cause data loss, security holes, and downtime.
If you do self-host, the docs recommend Docker for most needs. They say the one-line setup suits a quick start on Linux or macOS. They say Docker Compose is best for production, with databases and other services. The npm install leaves you managing Node.js versions and dependencies yourself. You can also host n8n on providers such as AWS and Azure.
One detail matters for any self-host. The docs say the Docker command creates a volume to store data that lasts. It is mounted to the /home/node/.n8n folder, so data survives restarts. Updates mean pulling the latest image, then stopping and starting the container.
The MCP Server Trigger node: your hosted MCP endpoint
The docs say the MCP Server Trigger node lets n8n act as an MCP server. It is an entry point into n8n for MCP clients. It only connects to and runs tool nodes. You can expose n8n workflows to clients with the Custom n8n Workflow Tool node. If you are starting from scratch, our guide on how to build an MCP server walks through that part.
The node has two MCP URLs, test and production. n8n registers a production MCP URL when you publish the workflow. A production URL does not show workflow data. You can still view production runs.
Making your MCP URL reachable and stable
The docs say webhooks for external trigger nodes need n8n to be reachable from the web. That is the core of hosting. On a self-hosted copy, outside clients must be able to reach n8n from the web.
By default, the Path field on this node comes filled with a random MCP URL path. The path is yours to choose, which helps if you want the endpoint URL to stay the same over time. That helps when a client has saved the URL and you do not want it to change.
Authentication and client consent
The docs say you can require authentication for clients connecting to your MCP URL. Do this before you hand a URL to a client.
Consent matters on the host side too. The MCP specification says users must consent to and understand all data access and operations. It says users must stay in control of what data is shared and what actions are taken. It also says hosts must get clear user consent before invoking any tool. Tools run code, so they must be handled with care. You cannot control the client's host app, so make sure the person using it understands what your server exposes.
Running in queue mode and behind a proxy
Two setups need care. The docs say the node works as expected in queue mode with a single webhook replica. In queue mode with multiple webhook replicas, you must send all /mcp* requests to one webhook replica set aside for them. Behind a reverse proxy like nginx, you must turn off proxy buffering for the MCP endpoint.
Connecting clients to your hosted server
The node can serve clients over Server-Sent Events (SSE) or streamable HTTP. The docs say this node doesn't support the standard input/output (stdio) transport. The docs say you can connect Claude Desktop to the node by running a gateway that proxies SSE messages to stdio.
For agents built in n8n, read about the n8n AI agent. If you want the full picture of a server that stays on one machine, see our page on a local MCP server.