Skip to main content
This guide covers the production operating model for mcpjungle. When teams want shared access to MCPs in an enterprise environment, Mcpjungle should run in enterprise mode with a dedicated PostgreSQL database That is the mode intended for teams, internal platforms and organizations running Mcpjungle for shared MCP access. If your goal is simply to use MCPs locally for yourself, development mode is usually a better fit.

Start in enterprise mode

You can enable enterprise mode in three ways:

Initialize the server once

After the first boot in enterprise mode, run mcpjungle init-server once from your client machine to create the initial admin identity and authenticate your CLI. For the exact bootstrap flow and command details, see: For a shared deployment, the recommended pattern is:
  1. Run the standard ghcr.io/mcpjungle/mcpjungle:latest image.
  2. Keep the CLI installed separately on operator machines.
  3. Point Mcpjungle at a separate PostgreSQL instance or cluster.

Run with Docker

For production, use the standard (minimal) Mcpjungle image. It is based on distroless/base and contains only the mcpjungle binary. Supply your database connection string with the DATABASE_URL environment variable:
For production, deploy a separate managed Postgres cluster and point DATABASE_URL at it rather than running Postgres in the same container. See Configure Mcpjungle’s database for all database options.

Reverse proxies and localhost protection

If you put a reverse proxy in front of MCPJungle, check how it sets the upstream Host header. The MCP gateway enables DNS rebinding protection. When a connection reaches MCPJungle on a loopback address, such as 127.0.0.1 or ::1, the gateway requires a localhost value in the HTTP Host header. A public hostname in that header causes the MCP transport to return 403 Forbidden.
A proxy on the same host can trigger this protection if it forwards to http://127.0.0.1:8080 while preserving Host: mcp.example.com. After authentication succeeds, MCP requests can fail with Forbidden: invalid Host header "mcp.example.com".
For loopback upstream connections, configure your proxy to send a local Host value, such as localhost:8080. Clients can continue connecting to the public URL, for example https://mcp.example.com/mcp. For example, inside your existing Nginx server configuration, the /mcp location can use:
proxy_buffering off allows streaming responses to reach the client promptly. Adapt the backend address and port to your deployment. If your existing configuration uses proxy_set_header Host $host, replace that directive in the affected location. Apply the same upstream Host-header policy to any group MCP endpoints or legacy SSE endpoints you proxy over loopback. Setting X-Forwarded-Host alone does not satisfy this check; the gateway inspects Host. The check also applies to loopback connections when MCPJungle listens on all interfaces (0.0.0.0). Connections reaching MCPJungle on a non-loopback address, such as a container-network address, are not rejected by this particular check. Assess the backend connection as seen by MCPJungle, rather than assuming all proxies or container deployments need a Host-header change. For background, see the MCP transport security guidance and the upstream localhost-protection option.

Graceful shutdown

Mcpjungle handles SIGTERM for graceful shutdown. It closes all active stateful sessions, flushes telemetry, and stops accepting new connections before exiting. Send SIGTERM to stop the server cleanly:
docker stop sends SIGTERM by default, so no extra flags are needed.

What enterprise mode enables

Even in enterprise mode, you can override metrics with OTEL_ENABLED=false if needed, though that is not the recommended default for shared deployments.

Database

Configure PostgreSQL correctly for production use.

Observability

Scrape Prometheus-compatible metrics from the /metrics endpoint.

Governance overview

Understand enterprise mode, tokens, clients, and users.

Access control

Give each MCP client access only to the servers it should reach.