Files
remote-mcp-manager/CLAUDE.md
T
dasemuandClaude Sonnet 5.5 4b3c8f213a feat: add a panel button to update the manager itself
The manager clones SELF_UPDATE_REPO_URL, builds a new image in the shared build queue and
hands over to a short-lived updater container (new image) that swaps the manager container,
health-checks it and rolls back on failure. Exposed as GET/POST /api/system behind requireAuth;
installation changes answer 409 while an update runs. Session cookie is now SameSite=Lax.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 05:45:25 +02:00

2.6 KiB

CLAUDE.md

Overview

Self-hosted manager for MCP servers: install one from a GitHub repo URL, build it with Nixpacks, run it in a container, and expose it at an authenticated /mcp/<slug> URL. npm workspaces monorepo: apps/server (Express + TypeScript API) and apps/web (React + Vite UI).

Commands

  • Install: npm install
  • Dev (server): npm run dev:server
  • Dev (web): npm run dev --workspace apps/web
  • Test: npm test (runs apps/server's vitest suite; apps/web has no tests yet)
  • Build (server): npm run build --workspace apps/server
  • Build (web): npm run build --workspace apps/web
  • Lint: none configured — CI type-checks via each workspace's build (tsc)

Architecture

Operator installs an MCP server from a repo URL; the server clones it, builds it with Nixpacks, runs it as a sibling container on a shared Docker network (mcp-net), and proxies authenticated requests to it. See README.md for the full flow and docs/ for details.

Conventions

  • TypeScript, strict mode, ES modules (type: "module") in both workspaces.
  • Tests live next to the code as *.test.ts, run with vitest.
  • Secrets (env vars, bearer tokens) are encrypted at rest with AES-256-GCM (apps/server/src/crypto/secrets.ts).

Workflow quirks

  • This repo is hosted on Gitea; CI workflows live in .gitea/workflows/, not .github/workflows/.
  • Local dev requires Podman with a docker-compatible socket (see README) because the manager itself must run as a container attached to mcp-net to reach sibling MCP containers.

Deployment

  • Production: docker compose up -d --build behind your own reverse proxy for TLS (see README).
  • See LESSONS.md before touching the build/container pipeline — several non-obvious gotchas (Nixpacks binary extraction, BuildKit/buildx, cgroup delegation) are recorded there.

Gotchas

  • Builds run one at a time; no per-installation resource override (see README "Known limitations").
  • The manager enforces its own memory/socket limits (docs/operations.md); keep every new long-lived resource bounded.
  • Local Node 24 cannot compile better-sqlite3@11, so npm test fails on the host: run the suite in a node:20 container (podman run ... docker.io/library/node:20-slim, repo copied without node_modules).
  • .gitea/workflows/ci.yml only runs if this repo's Gitea instance has Actions enabled with a runner.
  • Self-update (panel button) needs SELF_UPDATE_REPO_URL and only works when the manager runs in a container; the swap is done by a helper container (system/selfUpdateHelper.ts), not by the manager itself. Keep the helper standalone (no config/db imports). See docs/operations.md.