How to host a remote MCP server

Updated

Most MCP servers start life as a local process that Claude Desktop or Cursor launches over stdio. That works on your machine and nowhere else. A remote MCP server speaks HTTP instead, so any client — Claude on the web, ChatGPT, a teammate's Cursor — can connect to it by URL. This guide takes a Python MCP server from local to remote in three steps.

1. Switch to the Streamable HTTP transport

With the official Python SDK (pip install mcp) the change is one argument. Bind to 0.0.0.0 so the server is reachable from outside the container:

# server.py
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("demo", host="0.0.0.0", port=8000)

@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers."""
    return a + b

if __name__ == "__main__":
    mcp.run(transport="streamable-http")

The MCP endpoint is now http://localhost:8000/mcp. Run it locally and point MCP Inspector at it to check the tools show up. In TypeScript, the equivalent is the SDK's StreamableHTTPServerTransport mounted on an Express route.

2. Put it in a Docker image

# Dockerfile
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["python", "server.py"]

3. Push it and get an HTTPS URL

Sign in to APPISH, copy the push command from your Dashboard and add a port_8000 tag so we know where the server listens:

docker buildx build --platform linux/amd64 \
  -t push.to.appi.sh/<your-push-id>/app:port_8000 \
  --push .

A few seconds later your server answers at https://<your-slot>.appi.sh/mcp, with a valid TLS certificate and no tunnel running on your laptop.

4. Connect a client

Secrets and access

A public URL means anyone who finds it can call your tools. If a tool touches a paid API or private data, check a bearer token in the request and pass the expected value as an environment variable. Values with special characters go in an env64_ tag, base64url-encoded:

-t push.to.appi.sh/<your-push-id>/app:env64_API_TOKEN___<base64url-value>

The docs have the encoding one-liners for every shell.

A free slot runs for 4 hours per deployment and can be extended from the Dashboard with one click. For a server your team relies on every day, use a paid slot. MCP servers that keep state should store it in an external database: containers have no persistent disk.

More guides