agentleFS
strausmannstrausmann/mcp-dockhand/CLAUDE.md

mcp-dockhand

CLAUDE.md76 starsChanged 8 months agoMITView on GitHub

MCP Server (Model Context Protocol) für Dockhand Docker Management. Wrapt die Dockhand REST API in 130+ MCP-Tools mit Streamable HTTP Transport.

The file

We split this CLAUDE.md into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Commit-Messages: Conventional Commits (feat, fix, docs, chore, refactor)

    line 80

≈ “Common” is an estimate: at least 1 in 5 of the 28,633 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md — MCP-Dockhand Server

Projektübersicht

MCP Server (Model Context Protocol) für Dockhand Docker Management. Wrapt die Dockhand REST API in 130+ MCP-Tools mit Streamable HTTP Transport.

Tech Stack

  • Runtime: Node.js 22+
  • Sprache: TypeScript (strict mode)
  • MCP SDK: @modelcontextprotocol/sdk
  • Validierung: Zod (aktuell v3, Migration auf v4 geplant)
  • Build: npm run build (tsc)
  • Typecheck: npm run typecheck
  • Tests: Vitest (geplant — siehe Issue für Test-Suite)
  • Docker: Multi-stage Build, non-root User, Healthcheck

Verzeichnisstruktur

src/
├── index.ts           # Entry Point, Express Server
├── server.ts          # MCP Server Factory (Multi-Session)
├── auth/              # Dockhand Session-Authentifizierung
├── client/            # HTTP Client mit Cookie-Management
├── tools/             # Tool-Definitionen (130+)
│   ├── containers.ts  # Container-Management (27 Tools)
│   ├── stacks.ts      # Stack-Management (21 Tools)
│   ├── images.ts      # Image-Management (9 Tools)
│   ├── networks.ts    # Netzwerk-Management (7 Tools)
│   ├── volumes.ts     # Volume-Management (9 Tools)
│   ├── git-stacks.ts  # Git-Stack-Management (15 Tools)
│   ├── environments.ts # Environment-Management (18 Tools)
│   ├── users.ts       # User/Rollen-Management (20 Tools)
│   ├── system.ts      # System/Health/Metrics (19 Tools)
│   └── ...            # Weitere Tool-Dateien
├── types/             # TypeScript-Typen
└── utils/             # Hilfsfunktionen

Konventionen

Code-Stil

  • Alle Tool-Parameter mit Zod validieren
  • encodeURIComponent() auf ALLEN Pfad-Parametern (Container-IDs, Stack-Namen etc.)
  • Environment-ID als environmentId (number) — IMMER als Query-Parameter ?env=
  • Session-basierte Auth — automatisches Re-Login bei 401
  • SSE für Deploy-Operationen (postSSE Methode)

Tool-Definition Pattern

server.tool(
  'tool_name',
  'Beschreibung was das Tool tut',
  {
    environmentId: z.number().describe('Environment ID (required)'),
    name: z.string().describe('Resource name'),
    // Optionale Parameter:
    option: z.string().optional().describe('Optional parameter'),
  },
  async ({ environmentId, name, option }) => {
    const client = await getClient(session);
    const result = await client.get(`/api/endpoint/${encodeURIComponent(name)}`, { env: environmentId });
    return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
  }
);

Bekannte Probleme (Audit 29.03.2026)

  • Issue #16: Inkonsistentes encodeURIComponent bei Pfad-Parametern
  • Issue #17: Generische config/settings statt typisierter Parameter
  • Zod v3 → v4 Migration nötig (Breaking Change bei Dependabot PR #13)

Git

  • Commit-Messages: Conventional Commits (feat, fix, docs, chore, refactor)
  • Changelog: Keep a Changelog Format (CHANGELOG.md)
  • Externe Beiträge: Release-Notes bekommen automatisch einen „Contributors“-Abschnitt (scripts/release/contributor-notes.mjs) aus GitHub-noreply-Autoren und Co-authored-by-Zeilen. Nutzt ein Contributor eine private E-Mail-Adresse, einen Trailer Thanks: @login in einen Commit des PRs aufnehmen.
  • Releases: Semver Tags (v1.0.0) → GHCR Image Build
  • Branches: main + feature/fix Branches, PRs für Änderungen

CI/CD

  • CI: Typecheck bei jedem Push/PR (npm run typecheck)
  • Release: Docker Build + Push zu GHCR bei Tag-Push
  • Dependabot: Wöchentlich (npm, GitHub Actions, Docker)
  • API Change Detection: Wöchentlich Montag 06:00 UTC

Dockhand API

  • Server: Dockhand v1.0.22+ (SvelteKit + Bun)
  • Auth: Cookie-basiert (dockhand_session)
  • Base URL: Konfigurierbar via DOCKHAND_URL env var
  • Alle Endpoints: Environment-scoped via ?env=<id> Query-Parameter
  • API Schema: docs/dockhand-openapi.json — single pinned source (upstream Finsys/dockhand commit; PINNED_DOCKHAND_OPENAPI_COMMIT in src/openapi/pinned.ts mirrors SOURCE_COMMIT in scripts/fetch-openapi.mjs) for routes, query params AND body contracts. Refreshed via scripts/fetch-openapi.mjs, re-fetched nightly by .github/workflows/api-schema-sync.yml (no-op unless the pin changed).
  • API Change Gate: npm run api:validate is a hard, PR-blocking gate in ci.yml (route/query mismatches plus BODY_PARAM_MISSING_REQUIRED fail the build; other body-contract findings stay advisory). .github/workflows/drift-bump.yml runs weekly, bumps the pin toward upstream main, and opens a PR (no auto-merge) so drift surfaces on review.
  • Not yet done: version-gating (comparing the live Dockhand server version against the pinned spec version) is a separate follow-up, not implemented here.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.