Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Environment:1mcp app Agent Docker Deployment

From Leeroopedia
Knowledge Sources
Domains Infrastructure, Deployment
Last Updated 2026-10-29 00:00 GMT

Overview

Alpine-based Docker image with Node.js, pnpm, optional uv (Python) and bun for extended MCP server support — used for containerized 1MCP deployments.

Description

The Dockerfile defines a multi-stage build. The `build-stage` uses `node:${NODE_VERSION:-22}-alpine` to compile the TypeScript application. The `basic` production image installs only production dependencies via `pnpm install --frozen-lockfile --prod` and copies build artifacts. The `extended` image adds `curl`, `bash`, `ca-certificates`, `uv` (Python package manager, pinned to 0.9.2), `bun` (JavaScript runtime, pinned to 1.3.0), and Python 3.14.0 — enabling MCP servers that require Python or bun runtimes inside the container. The default port is 3050. Docker Compose files provide both production (`docker-compose.yml`) and development (`docker-compose.dev.yml`) configurations.

Usage

Use this environment when deploying 1MCP in a containerized environment. The `basic` image suffices for MCP servers that are pure Node.js or stdio-based. Use the `extended` image when MCP servers require Python (via `uv`) or bun. The `docker-compose.dev.yml` builds from the local Dockerfile with `target: extended`; the production `docker-compose.yml` pulls `ghcr.io/1mcp-app/agent:latest`.

System Requirements

Category Requirement Notes
OS Linux (Alpine 3.x) Base image is `node:*-alpine`
Docker Docker Engine 20.10+ Or any OCI-compatible runtime
Port 3050 Exposed in Dockerfile; mapped in docker-compose
Disk 500MB (basic), 1GB (extended) Extended includes Python and bun
RAM 256MB minimum More if running many MCP servers

Dependencies

System Packages (inside container)

  • `node` (from base image)
  • `pnpm` (via corepack)
  • `curl` (extended only)
  • `bash` (extended only)
  • `ca-certificates` (extended only)

Extended Image Additional Tools

  • `uv` = 0.9.2 (Python package manager)
  • `bun` = 1.3.0 (JavaScript runtime)
  • `python` = 3.14.0 (installed via `uv python install`)

Docker Compose Environment Variables

  • `ONE_MCP_HOST=0.0.0.0` (bind to all interfaces in container)
  • `ONE_MCP_PORT=3050` (or 3051 in dev)
  • `ONE_MCP_EXTERNAL_URL=http://127.0.0.1:3050` (external callback URL)
  • `ONE_MCP_LOG_LEVEL=debug` (dev only)
  • `ONE_MCP_CONFIG=/root/mcp.json` (dev: mounted from host)
  • `npm_config_registry` (optional mirror)
  • `UV_INDEX` / `UV_DEFAULT_INDEX` (optional Python package mirrors)

Credentials

Mount the host config directory to persist MCP server configurations and credentials:

  • `~/.config/1mcp/` → `/root/.config/1mcp` (config and session storage)
  • `./mcp.json` → `/root/mcp.json` (dev: explicit config file)

The following may be injected at runtime:

  • `ONE_MCP_ADMIN_USERNAME` / `ONE_MCP_ADMIN_PASSWORD`: Admin console bootstrap credentials
  • `https_proxy` / `http_proxy`: Proxy settings (passed as build args in dev)
  • OAuth tokens for upstream MCP servers (stored in the mounted config directory)

Quick Install

# Production: pull latest image
docker compose up -d

# Development: build from local Dockerfile with extended target
docker compose -f docker-compose.dev.yml up -d --build

# Or build manually with a specific Node version
docker build --build-arg NODE_VERSION=24 -t 1mcp-agent .

# Run with extended tools (uv, bun, python)
docker build --target extended -t 1mcp-agent-extended .

Code Evidence

Multi-stage build from `Dockerfile:3-4`:

ARG NODE_VERSION
FROM node:${NODE_VERSION:-22}-alpine AS build-stage

Extended image tool installation from `Dockerfile:56-70`:

ARG UV_VERSION=0.9.2
ARG BUN_VERSION=1.3.0
ARG PYTHON_VERSION=3.14.0
RUN curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh | sh && \
  uv python install ${PYTHON_VERSION} --default

Production docker-compose volume mount from `docker-compose.yml:7`:

volumes:
  - ~/.config/1mcp/:/root/.config/1mcp

Common Errors

Error Message Cause Solution
`port is already allocated: 3050` Another process using port 3050 Change `ONE_MCP_PORT` or the host port mapping
`uv: not found` Using `basic` image instead of `extended` Build with `--target extended`
`ECONNREFUSED 127.0.0.1:3050` from outside container `ONE_MCP_HOST` defaults to localhost Set `ONE_MCP_HOST=0.0.0.0` in environment
Config not persisting === Volume mount path mismatch === Mount `~/.config/1mcp/` to `/root/.config/1mcp`

Compatibility Notes

  • Basic vs Extended: The `basic` image is smaller and sufficient for Node.js-only MCP servers. The `extended` image adds ~300MB for Python and bun support.
  • Node version: Dockerfile defaults to Node 22 if `NODE_VERSION` is not passed, while `.node-version` pins 24 for CI/local. Pass `--build-arg NODE_VERSION=24` for alignment.
  • Registry mirrors: The compose files include commented-out `npm_config_registry` and `UV_INDEX` for users in regions with mirror requirements. Uncomment as needed.
  • Proxy: Build-time proxy is supported via `https_proxy`/`http_proxy` build args in `docker-compose.dev.yml`.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment