Skip to main content
Find my setup
Language: English

Remote MCP servers: where to host them and how to lock them down

A remote MCP server lets AI assistants use your tools over the internet. It is a small web service with one HTTPS address, so a modest virtual server is enough to run it.

The hard part is security, because anything the server can reach, the assistant can reach too. The MCP specification asks servers to check where each request comes from and to require proper authentication.

The steps below follow the MCP specification of 28 July 2026, the official Python SDK and n8n's documentation, all read on 27 October 2026.

A black plug in a white wall socket on a plain grey wall
An MCP server is a standard socket that AI assistants plug into to reach your tools. Photo: Jan van der Wolf, Pexels.

Who this is for

  • you want an AI assistant to use your own tools or data over the internet
  • you are choosing between a small server, n8n and a platform service
  • you need to lock the server down before you share it

Not for you if you only use MCP servers on your own computer: the local stdio kind needs no hosting.

Key numbers

  • 403 HTTP status the answer the specification requires when a request's Origin header is not allowed Official page,
  • 8000 port where the official Python SDK serves its example, at the /mcp path Official page,
  • 3.11 Python the oldest Python version the official SDK supports Official page,

What a remote MCP server is

MCP, the Model Context Protocol, is a standard way for an assistant to discover and call tools. A local server talks to the assistant on the same computer; a remote one answers over the network.

Remote servers use the Streamable HTTP transport: one address, such as https://example.com/mcp, that accepts POST requests. It arrived in the specification of March 2025 and replaced the older HTTP-and-SSE transport.

How an assistant reaches your tools through a remote MCP server Only the HTTPS address faces the internet.
How an assistant reaches your tools through a remote MCP serverAI assistant Claude, n8n or another MCPclient HTTPS with atoken Reverse proxy HTTPS and a token check localconnection MCP server listens on the serveritself only what itneeds Your tools files, databases, APIs
  1. AI assistant (Claude, n8n or another MCP client): connects to Reverse proxy (HTTPS with a token).
  2. Reverse proxy (HTTPS and a token check): connects to MCP server (local connection).
  3. MCP server (listens on the server itself): connects to Your tools (only what it needs).
  4. Your tools (files, databases, APIs)

Three ways to host one

A small server suits your own code; n8n suits tools you already build as workflows.

Three routes to a remote MCP server (from the MCP SDK and n8n documentation, 27 Oct 2026)
Your own code on a servern8n's MCP Server TriggerA platform service
What you writePython or TypeScript with the official SDKworkflows, attached as toolsyour own code, in a container
Authenticationa token at the proxy, or OAuthnone, a bearer token or a header, built inthe platform's settings plus your own
Best forcustom tools and full controltools that already live in n8nteams that deploy containers already

Step by step on a small server

These steps use the official Python SDK, which needs Python 3.11 or newer. The example tool is our own and tells the assistant the server's time; replace it with your tools.

bash

curl -LsSf https://astral.sh/uv/install.sh | sh
uv init mcp-demo && cd mcp-demo
uv add "mcp[cli]"

Save this as server.py:

python

from datetime import datetime, timezone
from mcp.server import MCPServer

mcp = MCPServer("Server clock")

@mcp.tool()
def utc_time() -> str:
    """Return the server's current time in UTC."""
    return datetime.now(timezone.utc).isoformat()

Start it with the SDK's own command. It serves the MCP address at http://localhost:8000/mcp:

bash

uv run mcp run server.py --transport streamable-http

Then put HTTPS and a token check in front with Caddy. Requests without the right token get a 401 answer and never reach the server:

text

mcp.example.com {
    @noauth not header Authorization "Bearer choose-a-long-random-token"
    respond @noauth 401
    reverse_proxy 127.0.0.1:8000
}

Keep port 8000 closed in the firewall, so only the proxy on the same server can reach it. Run the server as a system service, or in tmux, so it keeps running after you log out.

n8n as an MCP server

n8n's MCP Server Trigger node turns an n8n workflow into an MCP server. Tools attached to it, including whole workflows through the Custom n8n Workflow Tool node, become tools the assistant can call.

  • It supports Streamable HTTP and the older SSE transport, but not stdio, by n8n's documentation.
  • It has a test address and a production address; the production one works once you publish the workflow.
  • Authentication is built in: none, a bearer token or a custom header.
  • In queue mode with several webhook replicas, all /mcp traffic must go to one dedicated replica, or connections break.

n8n's MCP Client Tool node works the other way round, letting n8n's own agents use outside MCP servers. Our guide to self-hosting n8n with Docker sets up the server.

Adding authentication

The specification makes authorisation optional, but asks HTTP servers that offer it to follow its OAuth 2.1-based flow. Servers that support it must publish their protected resource metadata (RFC 9728).

For a server only you use, the simplest lock is a long secret token checked by the proxy. It works if your MCP client can send a fixed header. For a server many people sign in to, OAuth is the specification's own route.

n8n's documentation notes one surprise: claude.ai's custom connectors ask you to sign in to n8n even when the trigger's authentication is set to none.

Security checklist

  1. Serve the MCP address over HTTPS only, through a reverse proxy.
  2. Require a token or OAuth for every request; the specification asks for proper authentication.
  3. Check that your server or SDK rejects requests from unexpected Origin headers, which the specification requires.
  4. Keep the MCP server itself on 127.0.0.1, behind the proxy.
  5. Give each tool only the access it needs: read-only database users, narrow API keys, one folder.
  6. Log every tool call, so you can see what the assistant did.

What it costs

A small MCP server like the one above needs very little: the smallest plan in the boxes below is enough to start (our reading). The tools it calls may need more, so size the server for them.

Small servers for an MCP server and a reverse proxy. Prices checked on 25 Oct 2026.
PlanPriceNew-customer offerLink
Hostinger KVM 1 1 vCPU, 4 GB $6.49/month 24-month term, paid up front; Black Friday first-term price, then $11.99 checked 25 Oct 2026 Black Friday prices on VPS plans and AI automation apps, for the first subscription term only checked 30 Oct 2026 Visit
DigitalOcean Basic Droplet, 2 vCPUs, 4 GiB 2 vCPU, 4 GB $24/month billed per second (60-second minimum), capped at this monthly price · VAT not stated checked 25 Oct 2026 New accounts get a $5 credit that lasts 90 days and covers every product except SaaS add-ons checked 29 Oct 2026 Visit
UpCloud Starter, 2 CPU cores, 4 GB 2 vCPU, 4 GB €12/month billed by the starting hour, at most 28 days a month; no minimum term checked 25 Oct 2026 No offer Visit
Contabo Cloud VPS 4 4 vCPU, 8 GB €4.40/month 24-month term, paid up front; the price applies to the first 24 months and to the EU region in Germany; other regions cost more each month checked 25 Oct 2026 No offer Visit

Some of the lowest prices need a long term paid in advance; the term is under each price.

If you already run n8n, the trigger adds no new server. Our n8n requirements guide sizes it, and our agent platform guide compares n8n with Dify and Langflow.

How we checked

We read the MCP specification of 28 July 2026 and its security best practices on 27 October 2026. The same day we read the official Python SDK's README and n8n's documentation for its MCP nodes. The example server is our own.

Our own measurements will be added here, with their dates, when our test bench runs them.

Mistakes to avoid

  • Exposing the MCP port directly

    Instead: Put HTTPS and a token check in front; keep the port closed.

  • Giving tools broad access

    Instead: Anything a tool can reach, the assistant can reach.

  • Leaving n8n's trigger set to no authentication

    Instead: Use the bearer or header option.

  • Running several n8n webhook replicas without routing

    Instead: Send all /mcp traffic to one replica, as n8n's documentation says.

Other questions

What is a remote MCP server?

A small web service that lets AI assistants call your tools over the internet, through one HTTPS address such as https://example.com/mcp.

Can n8n be an MCP server?

Yes. Its MCP Server Trigger node exposes tools and workflows to MCP clients, with bearer or header authentication built in.

Does a remote MCP server need authentication?

The specification makes it optional but asks servers to implement proper authentication. Without it, anyone who finds the address can use your tools.

Sources and test notes

Every page read on 27 October 2026. The example server and the Caddy configuration are our own.

Back to AI agent hosting