Skip to content
← All projects

Feature Book[02]

Organisation
Personal product
My role
Sole engineer
Timeline
Live
Links
featurebook.vercel.app ↗
Private repo · code walkthrough on request

[A documentation workspace where an agent writes the docs and a human keeps editing them. An MCP server lets Claude document a codebase straight into the workspace: point it at a repository, approve the page tree, and the pages land where they stay editable in the browser.]

OAuth 2.1Dynamic client registration, no keys to paste
5Core capabilities, from MCP server to revocable access

Stack

Next.js 15Nextra 4BlockNoteTypeScriptPostgreSQLPrismaShadCN

Features

[01]

MCP Documentation Server

Claude connects over OAuth 2.1 with dynamic client registration — no key to paste. The client discovers the authorization server from an unauthenticated 401, registers itself, and the token it receives is scoped to the workspaces that user belongs to and nothing else.

[02]

Section-Level Updates

Docs are updated one section at a time: getPageOutline for the block id, then updatePageSection. The call never carries the rest of the document, so an edit cannot silently drop a paragraph it was not asked about.

[03]

Conflict Detection

updatePageSection refuses with a conflict rather than reverting a page that moved between the read and the write — the agent is told to re-read instead of overwriting a human edit.

[04]

Persisted Block Editor

BlockNote in two forms — embeddable in MDX pages, and persisted to Postgres under /projects. Every page has read-only version restore points, and the page tree lives in the layout so it survives navigation.

[05]

Revocable Access

Every connected client is listed under Settings → MCP access, named after the client. Revoking one is a click and stops that client immediately without touching the others; headless clients get a personal access token from the same panel.

What I did

  1. Enforced a hard server boundary: `app/` never imports Prisma, it calls server/actions. Everything server-only lives under server/, with lib/ as the shared middle importable from both.
  2. Built round-trip verification for the editor: blocks:check pushes a document through a real editor instance and diffs it, catching blocks the editor would silently drop.
  3. Added `sections:backfill` and `sections:verify` to re-derive every page's Section rows and prove they still reassemble into the original document.
  4. Found and fixed an untypechecked corner of the repo — tsconfig included only **/*.ts, leaving the four scripts that write to the database unchecked; one had been silently broken by bad import paths.
  5. Documented a schema-migration route that avoids Prisma's shadow database, which would otherwise create and drop against an instance whose public schema belongs to another app.