Skip to content

Reviewing decks with Peitho

The review server hosts published decks, lets anyone comment on any element or fix a text inline, and exposes that feedback to coding agents through MCP. Without options it runs for one person on 127.0.0.1; to share decks with others, turn on SSO sign-in and per-deck roles as described in auth.md.

1. Start the server

peitho serve                       # http://127.0.0.1:8790, data in ./peitho-data
peitho serve --addr 0.0.0.0:8790 --url http://my-host:8790 --data /srv/peitho
URL What
/ list of decks with open comments and pending edits
/d/<id> latest version with the review widget
/d/<id>/v/<n> an older version
/d/<id>/raw the plain single-file HTML, without the widget
/mcp MCP server (Streamable HTTP)
/api/... JSON API used by the widget and the CLI

2. Publish a deck

peitho publish slides.md -m "first draft"

The deck folder (Markdown and assets, without dist/ and hidden files) is uploaded, built by the server and stored as version 1 of a new deck. A .peitho.json file next to the deck remembers the server and deck id, so the next peitho publish creates version 2 of the same deck. Use --new to start another deck, --server or PEITHO_SERVER to target another server, and peitho pull <id> to download a deck's source.

3. Review

Open /d/<id> and press Review (or C). Then click any element of the slide:

  • Comment: a thread anchored to the element's stable id (intro.p2...). Others can reply and resolve it.
  • Edit text: change the text directly on the slide and save. The change is recorded as a pending edit (before/after) for the author or the agent to apply to the source.

The panel shows this slide's threads, or every open thread with Showing: all slides. Elements with open comments carry a counter. Replies from agents are tagged agent and appear without reloading.

4. Let your coding agent fix the deck

Add the MCP server to your agent:

claude mcp add --transport http peitho http://127.0.0.1:8790/mcp      # Claude Code

With sign-in on, run /mcp in Claude Code and choose Authenticate the first time (see auth.md).

For VS Code / GitHub Copilot, add to .vscode/mcp.json:

{ "servers": { "peitho": { "type": "http", "url": "http://127.0.0.1:8790/mcp" } } }

Then ask: "fix deck 1" (or use the fix_deck prompt, /mcp__peitho__fix_deck 1 in Claude Code). The agent:

  1. calls get_feedback: open comments and pending edits grouped by slide, with each slide's Markdown;
  2. edits the source (in the deck folder if you are in it, else from get_deck);
  3. publishes (peitho publish or the publish_deck tool);
  4. answers each thread with resolve_comment or asks a question with reply_comment, and marks edits applied or rejected with set_edit_status.

MCP tools

Tool Does
list_decks decks with counts of open comments and pending edits
get_feedback start here: what to fix, grouped by slide
get_deck metadata, full Markdown, files, slides, versions
get_source_file one source file (images are base64)
get_slide one slide's Markdown, notes, comments and edits
list_comments, list_edits filtered by status
reply_comment, resolve_comment answer and close threads
set_edit_status mark an inline edit applied or rejected
publish_deck build and publish a new version from Markdown (+ files)

Notifications

The server can post what happens on decks to webhooks: new comments, replies (from people or agents), resolved or reopened comments, and new versions. Set the URLs, comma-separated, in PEITHO_WEBHOOKS (or --webhooks, but the URLs are secrets: prefer the variable):

PEITHO_WEBHOOKS=https://hooks.slack.com/services/T000/B000/XXXX peitho serve
  • Slack (hooks.slack.com, an incoming webhook) and Google Chat (chat.googleapis.com, a space webhook) get a one-line message with a link to the deck, and the start of the comment.
  • Any other URL gets the event as JSON: kind (comment, reply, status, version), deckId, deckTitle, url, version, commentId, slide, author, agent, body, status, time. With PEITHO_WEBHOOK_SECRET set, each request carries X-Peitho-Signature: sha256=<hex HMAC-SHA256 of the body>. Use it to plug in Teams workflows, email relays or your own bot.

Every event goes to every webhook. Delivery is in the background, with three attempts; failures are logged without the URL.

Storage

Everything lives in the data folder as plain files: decks/<id>/deck.json, decks/<id>/v<n>/index.html and source.zip, and decks/<id>/review.json for comments and edits. Back it up by copying the folder. With --database (see deploy.md) the same documents live in PostgreSQL tables instead.