Skip to main content
Run the IBM i MCP Server as a container using the official pre-built images from GitHub Container Registry. Supports amd64, arm64, and ppc64le architectures.

Quick Start

The commands below start a server for clients on the same machine. The server answers at http://localhost:3010/mcp and is not reachable from other hosts.
Verify the server is running:
Two parts of this command control who can reach the server:
  • -p 127.0.0.1:3010:3010 publishes the port on the host’s loopback address only. -p 3010:3010 publishes it on every host interface, which makes an unauthenticated server that holds IBM i credentials reachable from the network.
  • MCP_ALLOW_UNAUTHENTICATED_HTTP=true accepts running without authentication. Without this variable or an MCP_AUTH_MODE setting, a container that holds IBM i credentials exits at startup. Network Exposure and Authentication describes both settings.
Replace the DB2i_* values with your actual IBM i credentials. Never commit credentials to source control.

Network Exposure and Authentication

The server holds the IBM i credentials it is started with. Any client that can send it a request can run SQL with those credentials. Two checks limit which clients can do so.

Host header validation

Every request must address the server as localhost, 127.0.0.1, or a name listed in MCP_ALLOWED_HOSTS. A request that uses any other name receives 403 Forbidden: Host not allowed. The check applies to every route, including /healthz. The check blocks DNS rebinding: a web page changes the DNS record for its own hostname to 127.0.0.1 after loading, then sends requests from the browser to the server on the visitor’s machine. Those requests carry the page’s hostname in the Host header and are rejected. MCP_ALLOWED_HOSTS accepts a comma-separated list. The 403 response body does not include the rejected name; the container log does.

Startup check for unauthenticated servers

The image sets MCP_HTTP_HOST=0.0.0.0, which published ports require. A server bound this way, holding IBM i credentials, with no authentication configured, is usable by anyone who can reach the port. The server refuses this configuration and exits with:
“IBM i credentials” means DB2i_* variables or a tools YAML, since YAML sources: entries carry their own connection details. Set one of the following:
Do not set MCP_HTTP_HOST=127.0.0.1 for a container. Docker and Podman forward published ports to the container’s network interface, not to its loopback address, so a server bound to 127.0.0.1 inside the container is unreachable from the host. Limit exposure with -p 127.0.0.1:3010:3010 instead. The repository’s .env.example sets MCP_HTTP_HOST=127.0.0.1; remove that line from any .env file passed to a container.

Built-in IBM i Sign-On

With MCP_AUTH_MODE=oauth and no OAUTH_ISSUER_URL, users sign on with their IBM i user profile and the container holds no service account password. Read Built-in IBM i Sign-On first; this section covers what is specific to a container. A container binds 0.0.0.0, and in this mode the server does not listen for passwords in clear on a network interface. Give it its own TLS listener by mounting a certificate and key:
  • No DB2i_USER, DB2i_PASS or DB2i_IGNORE_UNAUTHORIZED. DB2i_PASS stops startup in this mode. DB2i_IGNORE_UNAUTHORIZED=true stops it together with DB2i_SERVER_CERT_FILE; without a certificate file it turns verification of the Mapepire certificate off, so users’ passwords go to a server whose identity is not checked.
  • The mounted files must be readable by the container’s user (appuser, not root).
  • --no-healthcheck. The image’s built-in health check requests http://127.0.0.1:3010/healthz, which a TLS listener does not answer, so the container would be reported unhealthy. Check https://mcp.example.com:3010/healthz from outside instead.
  • One container. Sign-ons are held in the memory of one process. Do not run replicas, and expect every user to sign on again after the container restarts.
  • Client addresses. Depending on how the container runtime publishes the port, the server may see the address of the runtime’s bridge gateway instead of each client’s own address (common on Docker Desktop). All users then share one address for OAUTH_SIGNON_ALLOWED_CIDRS, the code address binding and the per-address rate limit, and that address is a private one, which the default OAUTH_SIGNON_ALLOWED_CIDRS admits. The server cannot detect this at startup. On Linux, --network host avoids it.
Send admin commands inside the container, where OAUTH_ADMIN_SOCKET is already in the environment:
A TLS-terminating proxy in another container is on another host as far as the server is concerned: keep the server’s TLS listener, have the proxy connect with https, and list the proxy’s address in MCP_TRUSTED_PROXIES.

Available Images

Images are published to GitHub Container Registry on each release. Multi-architecture tags select the image for the host’s architecture; single-architecture tags pin one platform.
Running on IBM Power Systems? Use the ppc64le image to run the MCP server natively on the same hardware as your IBM i partition — no emulation overhead.

Using an Environment File

Store the configuration in a .env file:
Then run with the env file:

Mounting Custom SQL Tools

To use your own YAML tool configurations, mount them into the container:
The :ro flag mounts the directory as read-only inside the container, which is a security best practice.
The image’s working directory is /app and the server entry point is packages/server/dist/index.js. Start the server with node packages/server/dist/index.js, as the image’s default command does. Do not use npx ibmi-mcp-server inside the container: the server’s package is @ibm/ibmi-mcp-server, and when the unscoped name does not resolve locally, npx tries to download a package by that name from the registry. A mounted tools directory counts as IBM i credentials for the startup check, because YAML sources: entries carry connection details. The .env file must set MCP_AUTH_MODE or MCP_ALLOW_UNAUTHENTICATED_HTTP=true.

Docker Compose

For a more complete setup, use Docker Compose to run the MCP server alongside supporting services.

Standalone Server

Create a docker-compose.yml:
The .env file is the one from Using an Environment File. The image contains no curl, so the healthcheck uses Node’s built-in fetch. It addresses the server as 127.0.0.1 and passes the Host check. The image ships the same check as a built-in HEALTHCHECK (see Health Checks), so the healthcheck: block is optional; keep it to change the timing. Other services in the same Compose file reach the server as http://ibmi-mcp-server:3010/mcp; that name must be listed in MCP_ALLOWED_HOSTS. Start the service:

With MCP Context Forge Gateway

The repository includes a full-stack Docker Compose configuration with MCP Context Forge — a gateway that provides tool federation, authentication, rate limiting, and an admin UI.
Before starting the stack, edit .env:
  • Set DB2i_HOST, DB2i_USER, and DB2i_PASS.
  • Set MCP_ALLOWED_HOSTS=ibmi-mcp-server. The gateway addresses the server by container name.
  • Set MCP_AUTH_MODE, or set MCP_ALLOW_UNAUTHENTICATED_HTTP=true. The stack mounts the repository’s tools/ directory, which counts as IBM i credentials for the startup check.
  • Remove the MCP_HTTP_HOST=127.0.0.1 line. Compose passes .env to the container, and that value makes the server unreachable through the published port.
This starts the following services:
The MCP Context Forge Gateway image must be built locally before starting the stack. See the MCP Context Forge docs for build instructions.

Container Management

Viewing Logs

Stopping and Removing

Health Checks

The server exposes a health endpoint at /healthz:
The health endpoint is subject to the Host check. Both commands above address the server by a loopback name and pass. A probe that addresses the server by IP address, such as a Kubernetes probe using the pod IP, receives 403. Set a Host: localhost header on such probes; the repository’s OpenShift deployment manifest does this. The image has a built-in HEALTHCHECK: every 30 seconds it requests http://127.0.0.1:$MCP_HTTP_PORT/healthz (port 3010 by default) with a 5-second timeout, a 15-second start period and 3 retries. docker ps shows the result as healthy or unhealthy. A container run with MCP_TRANSPORT_TYPE=stdio has no HTTP endpoint and reports unhealthy unless it is started with --no-healthcheck. Kubernetes and OpenShift ignore the image’s HEALTHCHECK; use probes there.

Logs

Logs go to the container’s output (docker logs). The server also writes rotating log files to /home/appuser/.ibmi-mcp-server/logs unless LOGS_DIR points elsewhere. With a read-only root file system (--read-only) that directory cannot be created: the server prints one warning and logs to stderr only. Mount a volume or tmpfs at LOGS_DIR to keep log files.

Building from Source

The image is built from packages/server/Dockerfile with the repository root as the build context. The root is required because the npm workspaces layout keeps a single package-lock.json there.
To run the local image, substitute ibmi-mcp-server:local for ghcr.io/ibm/ibmi-mcp-server:latest in any command on this page. The Dockerfile has three stages:
  1. builder — installs all workspace dependencies and runs npm run build -w @ibm/ibmi-mcp-server
  2. prod-deps — installs the server’s production dependencies only; the CLI workspace is excluded
  3. runner — copies node_modules from prod-deps and the compiled packages/server/dist from builder, then starts node packages/server/dist/index.js
.dockerignore keeps node_modules/, dist/, .git/, .github/, .claude/, agents/, and .env files out of the build context.
The image is built on node:22-bookworm-slim and runs as a non-root user (appuser) that owns its home directory, /home/appuser. Port 3010 is exposed by default.

Troubleshooting

Check the container logs for error details:
Common causes:
  • The log contains Refusing to start. See the next entry.
  • Missing or incorrect DB2i_* environment variables
  • Mapepire not running on the IBM i system
  • Network connectivity issues to IBM i host
The server holds IBM i credentials, has no authentication configured, and is bound to 0.0.0.0. It refuses this combination. Set MCP_AUTH_MODE=oauth, or set MCP_ALLOW_UNAUTHENTICATED_HTTP=true and publish the port with -p 127.0.0.1:3010:3010. See Network Exposure and Authentication.
The jwt mode was removed. Use MCP_AUTH_MODE=oauth with MCP_RESOURCE_URL and OAUTH_ISSUER_URL. See OAuth Authentication.
Forbidden: Host not allowed. means the client addresses the server by a name that is not localhost and is not listed in MCP_ALLOWED_HOSTS. The container log records the rejected name. Add it to MCP_ALLOWED_HOSTS and restart the container.Forbidden: Origin not allowed. means the request came from a browser page whose origin is not listed in MCP_ALLOWED_ORIGINS. Add the origin, for example MCP_ALLOWED_ORIGINS=http://localhost:3000. The sign-in page of the built-in IBM i sign-on needs no entry: the origin of MCP_RESOURCE_URL is always accepted. If its form is refused with this message, MCP_RESOURCE_URL is not the URL users open in their browser.
Verify the container can reach your IBM i system (the image has no nc; use Node):
If using Docker Desktop on macOS/Windows, ensure the IBM i host is reachable from within the VM.
If port 3010 is already in use on the host, map to a different host port. (If the port is taken inside the container, the server exits with Port 3010 on 0.0.0.0 is already in use; it does not move to another port.)
The container runs as a non-root user. Ensure mounted files are readable:
On SELinux-enabled systems (RHEL/Fedora), add the :z flag: