dorfteich/apps/api/package.json
Claude Fable 5 04e21a0aac
All checks were successful
CD / Build and push images (push) Successful in 3m50s
CI / Lint, typecheck, test (push) Successful in 4m2s
CI / Build container images (push) Has been skipped
CD / Deploy to Test (push) Successful in 11s
CD / Smoke tests against Test (push) Successful in 1m14s
CD / Promote to Int (push) Successful in 13s
CI / Auth e2e pack (push) Successful in 5m37s
CI / Import/export fidelity gate (push) Successful in 47s
Built-in MCP endpoint (Streamable HTTP) on top of the public API (#105)
AI clients talk to the instance directly at /api/mcp — under the /api/
path (deviation from the issue's literal /mcp) so every existing reverse
proxy already routes it; no deployment changes anywhere.

- Transport: official @modelcontextprotocol/sdk server, STATELESS — each
  POST builds a fresh server+transport pair, no session store, replicas
  stay trivial; GET/DELETE answer 405. Auth per PAT bearer (#104 tokens),
  per-token rate limit (429 + Retry-After).
- Own switches, independent of REST: instance mcp.enabled (admin
  settings, default off; off = 404, feature invisible) + pond setting
  mcpEnabled (pond-settings toggle, default off) — pinned independent in
  both directions by tests.
- Tools (thin wrappers over the #104 services, same permission gates,
  audit-logged writes): list_ponds, list_pages, read_page, search,
  create_page, update_page (replace semantics through the collab-owned
  restore path — open editors converge), add_comment, list_labels,
  set_page_labels (exact replace), export_pond (link to the REST ZIP).
  Tool errors carry the api error codes; results carry stable slugs/ids.
  MCP resources stay the documented stage-2 stretch goal.
- Deliberately on the SDK's low-level Server API with a hand-written tool
  table (mcp-tools.ts): the typed registerTool generics drove tsc out of
  memory in a program this size; manual Zod validation keeps the wire
  behavior explicit.
- PublicApiService exposure filtering parameterized ('api' | 'mcp',
  shared pondFeatureEnabled helper) — one implementation, two switches.
- Docs: "Connect Claude Code / MCP clients" section in public-api.md
  (claude mcp add one-liner + mcp-remote bridge for stdio clients).

Verification: 8-test e2e pack driving the real MCP SDK client over
Streamable HTTP against a listening api (initialize + tools/list, switch
independence in both directions, anonymous/garbage 401, opt-in 404
semantics, page roundtrip incl. restore-NOTIFY, labels/comments, read
scope blocked from writes with scope_required); live check through the
web proxy against the seeded stack (tools list, create, read, update,
search — LIVE CHECK PASSED); full api suite 61/61 files green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EwZ4jR4KFAPvpjWevfUGX1
2026-07-12 11:36:02 +02:00

71 lines
2.0 KiB
JSON

{
"name": "@dorfteich/api",
"version": "0.0.0",
"private": true,
"description": "Dorfteich REST API server",
"license": "MIT",
"scripts": {
"build": "prisma generate && nest build",
"start": "node dist/main.js",
"start:dev": "prisma generate && nest start --watch",
"typecheck": "tsc --noEmit",
"test": "vitest run --passWithNoTests",
"db:migrate:dev": "prisma migrate dev",
"db:seed": "tsx prisma/seed.ts",
"fixtures:regenerate": "tsx prisma/fixtures/regenerate.ts",
"search:reindex": "tsx src/search/reindex.cli.ts"
},
"dependencies": {
"@dorfteich/plugin-sdk": "workspace:*",
"@dorfteich/shared": "workspace:*",
"@modelcontextprotocol/sdk": "^1.29.0",
"@nestjs/common": "^11.0.0",
"@nestjs/core": "^11.0.0",
"@nestjs/platform-express": "^11.0.0",
"@prisma/client": "^6.3.0",
"archiver": "^7.0.1",
"argon2": "^0.44.0",
"cookie-parser": "^1.4.7",
"dompurify": "^3.4.11",
"fflate": "^0.8.3",
"fractional-indexing": "^4.0.0",
"i18next": "^26.3.4",
"jsdom": "^26.1.0",
"multer": "^2.1.1",
"nestjs-pino": "^4.3.0",
"nodemailer": "^9.0.3",
"pg": "^8.22.0",
"pino": "^9.6.0",
"pino-http": "^10.4.0",
"prisma": "^6.3.0",
"prosemirror-model": "^1.25.9",
"prosemirror-state": "^1.4.4",
"prosemirror-view": "^1.42.0",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.0",
"y-prosemirror": "^1.3.7",
"y-protocols": "^1.0.7",
"yjs": "^13.6.31",
"zod": "^3.25.76"
},
"devDependencies": {
"@nestjs/cli": "^11.0.0",
"@nestjs/testing": "^11.0.0",
"@swc/core": "^1.10.0",
"@types/archiver": "^6.0.4",
"@types/cookie-parser": "^1.4.10",
"@types/express": "^5.0.0",
"@types/jsdom": "^28.0.3",
"@types/multer": "^2.0.0",
"@types/nodemailer": "^8.0.1",
"@types/pg": "^8.20.0",
"@types/supertest": "^6.0.0",
"pdf-parse": "^2.4.5",
"pino-pretty": "^13.0.0",
"supertest": "^7.0.0",
"tsx": "^4.19.0",
"unplugin-swc": "^1.5.0",
"vitest": "^3.0.0"
}
}