

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# CLAUDE.md23This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.45## Essential Commands67### Development Commands8```bash9# Build the MCP server for prod (requires a URL or local file path for the OpenAPI spec)10yarn nx build mcp-server --specUrl=https://demo.dotcms.com/api/openapi.json1112# Development mode with hot reload13yarn nx serve mcp-server1415# Regenerate spec only (requires a URL or local file path)16yarn nx generate-spec mcp-server -- https://demo.dotcms.com/api/openapi.json1718# Run tests19yarn nx test mcp-server2021# Run linting22yarn nx lint mcp-server23```2425### Environment Setup2627Configure the MCP server via the `env` block in your MCP client config:2829```json30{31 "mcpServers": {32 "dotcms": {33 "command": "node",34 "args": [35 "/Users/fmontes/Developer/dotcms/core/core-web/dist/apps/mcp-server/stdio.js"36 ],37 "env": {38 "DOTCMS_URL": "http://localhost:8080",39 "AUTH_TOKEN": "eyJ0eXAiOiJKV1Qi..."40 }41 }42 }43}44```4546| Variable | Required | Description |47|---|---|---|48| `DOTCMS_URL` | Yes | Base URL of the dotCMS instance |49| `AUTH_TOKEN` | Yes | JWT Bearer token (generate in dotCMS → User Tools → API Tokens) |50| `SANDBOX_TIMEOUT` | No | Sandbox execution timeout in ms (default: `15000`) |5152## Architecture Overview5354This is a **Model Context Protocol (MCP) server** for dotCMS, built with [xmcp](https://xmcp.dev) (rspack-based framework). The server provides AI assistants with two tools to interact with dotCMS: **search** (explore API spec) and **execute** (make API calls).5556### Core Architecture5758**Framework**: xmcp auto-discovers tools from `src/tools/`. Each tool exports `schema`, `metadata`, and a default handler function.5960**Entry Point**: xmcp generates the entry point at build time (`dist/stdio.js`).6162**Build Pipeline**:631. `generate-spec` — fetches the OpenAPI spec from a dotCMS instance, processes it into `src/generated/spec.json` (dereferences $refs, filters to relevant endpoints)642. `xmcp build` — bundles everything with rspack into `dist/`6566**Tool Layer** (`src/tools/`):67- `search.ts` — Explore the OpenAPI spec via sandbox-executed JavaScript68- `execute.ts` — Make authenticated API calls via sandbox-executed JavaScript6970**Library Layer** (`src/lib/`):71- `executor.ts` — Orchestrates sandbox creation and adapter injection72- `http-client.ts` — Authenticated HTTP adapter (tokens injected by main thread, never in sandbox)73- `spec.ts` — Loads the pre-processed OpenAPI spec74- `types.ts` — TypeScript interfaces for adapters, sandbox config, execution context75- `sandbox/index.ts` — Runtime detection factory (`createSandbox`)76- `sandbox/interface.ts` — Sandbox interface definition77- `sandbox/bun-worker.ts` — Bun Web Worker sandbox78- `sandbox/node-worker.ts` — Node.js `worker_threads` sandbox7980### Key Patterns8182**Dual-Runtime Sandbox**: User code runs in Workers with automatic runtime detection. On Bun, uses native Web Workers (`Blob` + `URL.createObjectURL`). On Node.js, uses `worker_threads` (`new Worker(code, { eval: true })`). Runtime is detected via `typeof globalThis.Bun`. API tokens are never exposed to the sandbox — the main thread handles authentication via the adapter pattern.8384**Adapter Pattern**: The executor bridges sandbox code to the main thread:85- Sandbox calls `api.request(...)` which posts a message to the main thread86- Main thread executes the actual HTTP call with injected auth87- Result is posted back to the sandbox8889**Build-time Spec Processing**: `scripts/generate-spec.ts` fetches the OpenAPI spec from a URL (or reads a local file), dereferences it, filters to allowed endpoint prefixes, strips response schemas, and handles circular references. The developer must provide the spec URL or file path when running `generate-spec`.9091### Type System9293All interfaces are in `src/lib/types.ts`:94- `Adapter` / `AdapterMethod` — for extending sandbox capabilities95- `SandboxConfig` / `SandboxResult` — sandbox execution parameters and results96- `ExecutionContext` — adapters + variables passed to sandbox9798## MCP Tools Available99100### Search Tool101**Purpose**: Explore the dotCMS REST API specification102**Sandbox globals**: `spec` (the dereferenced OpenAPI spec object)103**Read-only**: Yes — no side effects104105### Execute Tool106**Purpose**: Make authenticated API calls to dotCMS107**Sandbox globals**: `api` (HTTP adapter), `pick`, `table`, `count`, `sum`, `first` (helpers)108**Side effects**: Yes — can create/modify/delete content109110## Development Guidelines111112### Adding New Tools1131. Create a new `.ts` file in `src/tools/`1142. Export `schema` (Zod object), `metadata` (ToolMetadata), and a default handler1153. xmcp auto-discovers it — no registration needed116117### Adding New Adapters1181. Implement the `Adapter` interface from `src/lib/types.ts`1192. Register it on the executor in the tool handler1203. Specify adapter names in `execute()` options121122### Testing123- Tests use Jest with Node.js environment124- Test files should follow `*.spec.ts` naming convention125- `generate-spec` target runs before tests (spec.json must exist)126127## Configuration128129The server is configured as an Nx application with:130- **Build**: `nx:run-commands` executor running `xmcp build`131- **Dev**: `nx:run-commands` running `xmcp dev` (hot reload)132- **Test**: `@nx/jest:jest` executor133- **Lint**: `@nx/eslint:lint` executor134- **Output**: `dist/apps/mcp-server/stdio.js`135
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| dotCMS/core.cursor/rules/e2e-rules.mdc · 949 | Cursor rules | setupteststylearch+5 | 89/100 | 14 days ago | |
| dotCMS/core.github/instructions/frontend.instructions.md · 949 | Copilot instructions | testlint-formatstylearch+3 | 61/100 | today | |
| dotCMS/coreCLAUDE.md · 949 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | today | |
| dotCMS/corecore-web/AGENTS.md · 949 | AGENTS.md | style | 63/100 | 14 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 949 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 14 days ago | |
| dotCMS/corecore-web/apps/dotcms-ui-e2e/AGENTS.md · 949 | AGENTS.md | setupstylearchtesting-strategy+2 | 78/100 | 14 days ago | |
| dotCMS/corecore-web/apps/dotcms-ui/AGENTS.md · 949 | AGENTS.md | buildteststyledependencies+3 | 94/100 | 14 days ago | |
| dotCMS/corecore-web/libs/block-editor/CLAUDE.md · 949 | CLAUDE.md | archdo-not | 69/100 | 14 days ago | |
| dotCMS/corecore-web/libs/new-block-editor/CLAUDE.md · 949 | CLAUDE.md | lint-formatstyledo-notagent-behaviour | 61/100 | 14 days ago | |
| dotCMS/corecore-web/libs/portlets/CLAUDE.md · 949 | CLAUDE.md | setupteststyleui+1 | 77/100 | 14 days ago | |
| dotCMS/corecore-web/libs/portlets/edit-ema/portlet/src/lib/store/CLAUDE.md · 949 | CLAUDE.md | teststylearchtypes+2 | 65/100 | 7 days ago | |
| dotCMS/corecore-web/libs/sdk/client/CLAUDE.md · 949 | CLAUDE.md | setupbuildtestlint-format+9 | 97/100 | 14 days ago | |
| dotCMS/corecore-web/libs/sdk/react/CLAUDE.md · 949 | CLAUDE.md | setupbuildtestlint-format+9 | 97/100 | 14 days ago | |
| dotCMS/coredotCMS/src/main/java/com/dotcms/rest/CLAUDE.md · 949 | CLAUDE.md | typesdatabaseapido-not+1 | 57/100 | 14 days ago | |
| dotCMS/coretest-jmeter/CLAUDE.md · 949 | CLAUDE.md | testarchsecurityperformance+2 | 77/100 | 14 days ago | |
| dotCMS/core.cursor/rules/frontend-context.mdc · 949 | Cursor rules | teststyledocs | 78/100 | today | |
| dotCMS/core.cursor/rules/java-context.mdc · 949 | Cursor rules | buildstyle | 44/100 | 14 days ago | |
| dotCMS/core.cursor/rules/test-context.mdc · 949 | Cursor rules | testtesting-strategy | 54/100 | today | |
| dotCMS/core.github/copilot-instructions.md · 949 | Copilot instructions | setupbuildtestlint-format+11 | 84/100 | 11 days ago | |
| dotCMS/core.cursor/rules/doc-updates.mdc · 949 | Cursor rules | docs | 30/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| dotCMS/corecore-web/CLAUDE.md · 949 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 14 days ago | |
| tphakala/birdnet-goCLAUDE.md · 1.6k | CLAUDE.md | buildtestlint-formatstyle+8 | 100/100 | today | |
| tyrchen/geektime-bootcamp-aiw7/genslides/backend/CLAUDE.md · 230 | CLAUDE.md | testlint-formatstylearch+6 | 100/100 | 9 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.5k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 14 days ago | |
| microsoft/playwrightCLAUDE.md · 95k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 7 days ago | |
| Adit-Jain-srm/NightmareNetCLAUDE.md · 46 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 14 days ago | |
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 7 days ago | |
| dotCMS/coreCLAUDE.md · 949 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | today |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/dotcms-core-core-web-apps-mcp-server-claude)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.