# Host your MCP server. In one sentence.

> Deploy your MCP server as a remote HTTPS endpoint for Claude, ChatGPT and Cursor, in one sentence from Claude Code or Codex. Always on, secrets managed.

Web page: https://agentlab.cresclab.com/en/deploy/mcp-server  
繁體中文 (Markdown): https://agentlab.cresclab.com/deploy/mcp-server.md

MCP server hosting · Agent Lab Deploy

Say one sentence in Claude Code, Codex or Cursor and your local MCP server becomes an HTTPS endpoint Claude, ChatGPT and Cursor can reach.

[Host an MCP server free](https://app.agentlab.cresclab.com/?lang=en&intent=deploy) [Jump to the Dockerfile](https://agentlab.cresclab.com/en/deploy/mcp-server#recipe)

A Claude Code conversation: the user asks the agent to deploy their local MCP server to Agent Lab; the agent creates the app, generates an auth token and returns the remote URL once the build passes.

Why remote

## A local MCP server only works on your machine.

Deploy it remote: everyone shares one server, one change updates all.

### Always on, no cold starts

Always-on containers keep MCP streaming connections alive.

### Secrets on the platform

Passwords, API keys and tokens are project secrets, never in source.

### A database next door

PostgreSQL in the same workspace, connection written into the environment.

Choosing

## Cloudflare Workers vs a VPS vs Agent Lab

Three ways to host a remote MCP server compared

| What matters to you | Agent Lab Deploy | Cloudflare Workers | Your own VPS |
| --- | --- | --- | --- |
| How it runs | Always-on container, any language | Edge function, mostly JS/TS | Always on, you run it |
| Python (FastMCP) | Runs as is | Limited | Yes |
| Long-lived connections / SSE | Supported | Needs Durable Objects | Supported |
| Database | PostgreSQL in the same workspace | D1 / external | Install your own |
| Setup | One sentence to an AI tool | wrangler deploy | SSH, Docker, reverse proxy, TLS |

How

## Connect → one sentence → get the URL → add it to your tools

1. ### Connect Agent Lab
   One MCP line in Claude Code, Codex or Cursor, then sign in.
2. ### Say one sentence
   The agent creates the app, generates an auth token and builds.
3. ### Get the /mcp URL
   The build returns https://<name>--<org>.hosting.agentlab.run/mcp.
4. ### Add it to your AI tools
   Add it in Claude, ChatGPT or Cursor with the bearer token; Pro for always-on and a custom domain.

Copy and go

## The Dockerfile and the sentence

Any language: serve HTTP on $PORT, expose /mcp, run as non-root (example: Python FastMCP).

Dockerfile

### Dockerfile

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

# server.py
# from fastmcp import FastMCP
# import os
# mcp = FastMCP("my-tools")
# @mcp.tool
# def lookup_order(order_id: str) -> dict: ...
# mcp.run(transport="http", host="0.0.0.0", port=int(os.environ["PORT"]))
```

- `PORT` the port to listen on
- `MCP_TOKEN` from sites_secrets_generate; no bearer, 401
- `DATABASE_URL` written by databases_connect_app

PROMPT

### Say this to your AI tool

```
Read https://app.agentlab.cresclab.com/agent/deploy.md and deploy this MCP server to Agent Lab with the Dockerfile at agentlab.cresclab.com/en/deploy/mcp-server: listen on $PORT at /mcp, generate MCP_TOKEN with sites_secrets_generate for bearer auth. Give me the URL and how to add it to Claude and Cursor.
```

FAQ

## Before you host an MCP server

**How do I deploy an MCP server remotely?**

Use streamable HTTP, listen on $PORT, expose /mcp, write a Dockerfile and ask Claude Code, Codex or Cursor to deploy it to Agent Lab. Add the https URL it returns as a remote MCP server in Claude, ChatGPT or Cursor.

**How much does it cost to host an MCP server?**

Free runs one size-S MCP server that sleeps after 15 idle minutes, at no charge. Pro is US$29 a month before tax for always-on and a custom domain, with US$14 of monthly usage credit, enough for one size-S app all month.

**How do I add auth to an MCP server?**

Simplest: generate an MCP_TOKEN with sites_secrets_generate and check the Authorization header. For outside users with their own consent, implement OAuth 2.1.

**Can I host Python and TypeScript MCP servers?**

Both. FastMCP (Python), the official TypeScript SDK, Go or anything with a Dockerfile serving HTTP on $PORT deploys.

**How is this different from Cloudflare Workers?**

Workers are edge functions for light TypeScript tools. Agent Lab runs always-on containers, so Python, long-lived connections and database tools run as is.
