> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mcpblacksmith.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-Hosting

> Deploy your generated MCP server with Docker or on any cloud provider.

## Docker

Every generated server includes a production-ready `Dockerfile`:

```bash theme={null}
# Build
docker build -t my-api-mcp .

# Run with stdio transport
docker run --env-file .env my-api-mcp

# Run with SSE transport (network accessible)
docker run -p 8000:8000 --env-file .env my-api-mcp --transport sse
```

## Cloud deployment

The server is standard Python — deploy it anywhere you can run Python 3.11+:

* **AWS** — ECS, Lambda (with SSE transport), EC2
* **Google Cloud** — Cloud Run, GCE, GKE
* **Azure** — Container Apps, ACI, AKS
* **Railway, Render, Fly.io** — Container-based platforms
* **VPS** — Any Linux server with Python installed

### Example: Docker Compose

```yaml docker-compose.yml theme={null}
services:
  mcp-server:
    build: .
    ports:
      - "8000:8000"
    env_file:
      - .env
    command: ["python", "server.py", "--transport", "sse", "--port", "8000"]
    restart: unless-stopped
```

## Connecting remote MCP clients

When running with SSE or streamable-http transport, MCP clients connect over the network:

```json theme={null}
{
  "mcpServers": {
    "my-api": {
      "url": "http://your-server-host:8000/sse"
    }
  }
}
```

<Warning>
  If exposing over the internet, add a reverse proxy (nginx, Caddy) with TLS termination. The generated server does not include TLS by default.
</Warning>

<Card title="Don't want to manage infrastructure?" icon="cloud" color="hsl(199, 100%, 57%)" href="https://mcparmory.com">
  MCP Armory provides managed multi-tenant MCP server hosting.
</Card>
