mirror of
https://github.com/Dasemu/remote-mcp-manager.git
synced 2026-11-26 15:26:27 +00:00
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>
2.6 KiB
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(runsapps/server's vitest suite;apps/webhas 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 tomcp-netto reach sibling MCP containers.
Deployment
- Production:
docker compose up -d --buildbehind your own reverse proxy for TLS (see README). - See
LESSONS.mdbefore 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, sonpm testfails on the host: run the suite in anode:20container (podman run ... docker.io/library/node:20-slim, repo copied withoutnode_modules). .gitea/workflows/ci.ymlonly runs if this repo's Gitea instance has Actions enabled with a runner.- Self-update (panel button) needs
SELF_UPDATE_REPO_URLand 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). Seedocs/operations.md.