Skip to main content
Glama

mdreview-service

A containerized markdown review microservice. An agent POSTs markdown, gets back a review URL for a human, and polls feedback over HTTP. One service handles many reviews, isolated by id. No per-process spawning, no shared filesystem with the agent.

Landing page: mdreview.space (served from GitHub Pages via .github/workflows/pages.yml; source in web/site/).

Docs: mdreview.space/docs: onboarding, how-to, and troubleshooting, rendered through the service's own markdown renderer (source in web/site/docs/).

Getting started: hosted or self-hosted

Two ways to use mdreview; pick one.

1. Hosted (online). A managed instance runs at mdreview.space (app at app.mdreview.space). Sign in with any email address (you get a one-time link; there is no invite list). Three ways to connect your agent.

claude.ai custom connector (no token). In claude.ai open Settings, Connectors, Add custom connector and enter:

https://app.mdreview.space/mcp

Claude opens the mdreview sign-in; enter your email, follow the one-time link and approve the connection on the consent page. It works in claude.ai on the web, Desktop and mobile. Revoke it any time on the Account page.

Claude Code plugin. Inside Claude Code run:

/plugin marketplace add ranawaqas-ai/mdreview-service
/plugin install mdreview@mdreview

It prompts for a token (mint one on the Account page after signing in) and keeps it in your keychain. Plugin updates arrive through /plugin update; the wrapper does not update itself inside a plugin.

Installer. On the machine running your agent (needs the claude CLI + python3), with a token from the Account page:

curl -fsSL https://mdreview.space/install.sh | MDREVIEW_TOKEN=mdr_xxx sh

That fetches the stdlib-only MCP wrapper into ~/.mdreview and registers it with Claude Code at user scope; quit and reopen Claude Code and you are connected. Omit MDREVIEW_TOKEN=… to be prompted for it instead. (To wire it up by hand, or for a non-Claude-Code MCP client, see MCP server.)

2. Self-hosted (local). Clone and run it yourself (no account, no auth, on localhost). See Run, then point your agent's MCP MDREVIEW_BASE at http://localhost:8137. This is the path if you want everything on your own machine.

Stdlib Python only (tiny image, no pip installs). Self-contained: the marked, Mermaid, KaTeX, highlight.js, and footnote renderers are vendored and served from /static, so the browser needs no CDN. The viewer renders Markdown the way a Jekyll/MathJax site does: LaTeX math (inline $…$ / \(…\), display $$…$$ / \[…\]; prose/currency $ left literal), Mermaid diagrams, GFM footnotes ([^id] refs → an ordered back-ref section), and syntax-highlighted fenced code (a dual-scheme theme that reads on light and dark panes).

Related MCP server: docscanner-mcp

Run

make up        # serves on http://localhost:8137
# or:
docker build -f infra/Dockerfile -t mdreview-service .
docker run -d -p 8137:8080 -v mdreview-data:/data mdreview-service

make up (compose) is the canonical local-docker path; it serves on 8137 and reuses the named mdreview-data volume, so a rebuild/recreate preserves your reviews.

Health check: curl localhost:8137/healthz -> {"ok":true}.

Feedback and source persist in the /data volume across restarts.

Migrating a legacy hand-run container

If you have an older instance started by hand (docker run on a nonstandard port such as :8139), move it onto the canonical compose flow without losing data: the mdreview-data volume is reused as-is:

docker rm -f mdreview     # stop the hand-run container (the mdreview-data volume survives)
make up                   # compose recreates it on 8137, mounting the same mdreview-data volume

Because the compose volume is now declared with an explicit name: mdreview-data (not a project-prefixed infra_mdreview-data), make up mounts the very volume your old container owned. Confirm with curl localhost:8137/healthz and check your reviews are still listed.

The flow

  1. Agent: POST /api/reviews {markdown, title} -> {id, review_url, feedback_url, ...}

  2. Agent hands review_url to a human.

  3. Human opens it, selects text or clicks a paragraph number, types notes (auto-saved).

  4. Agent polls GET /api/reviews/{id}/status then GET /api/reviews/{id}/feedback.

  5. Agent applies edits and PUT /api/reviews/{id}/source {markdown} -> the human's page live-reloads and addressed notes are struck through. Repeat as needed.

Config (env)

Var

Default

Meaning

PORT

8080

in-container listen port

MDREVIEW_DATA

/data

storage dir (mount a volume)

MDREVIEW_PUBLIC_BASE

empty

if set (e.g. https://review.example.com), review_url/feedback_url use it; otherwise the request Host header is used

MDREVIEW_ENABLE_LATEX

off

opt-in: enable the LaTeX paper review mode (see below). Requires the mdreview-service-latex image (Tectonic); the default slim image has no LaTeX toolchain

Operator guides

The runbooks that used to live here, moved out so this page stays readable:

Guide

What it covers

HTTP API

Every route, request and response shape

MCP server

Running the stdio server, smoke tests

LaTeX paper review

Enabling it, templates, the compile loop, the image runbook

Watcher

The agent watcher, trusted-base mode, containerized runs

Design system

§01-§10, the UI rules that tickets cite

Autonomous runs

How agents ship changes here

Notes

  • Multi-tenant by id, so concurrent reviews never collide. No auth (intended for trusted / local networks); put it behind a reverse proxy with auth if exposing it.

  • The dashboard (/) and GET /api/reviews list across all reviews: fine for the trusted-network posture, but a reason to keep auth in front when exposed.

  • The MCP wrapper above was designed in docs/future-mcp.md, kept as its design/decision record.

  • For agent integration details, see CLAUDE.md.

  • A non-Docker, per-file CLI version lives in ../mdreview (writes feedback to a file next to the source). This service is the networked, multi-session form.

License

Apache License 2.0.

Privacy Policy

The hosted service at app.mdreview.space stores your account email, your reviews and comments, and sign-in security records. It uses no analytics or tracking cookies, does not sell your data and does not use it to train AI models. The full policy, including retention, deletion and third-party services, is at https://mdreview.space/privacy/. Questions go to rana.waqas.works@gmail.com. A self-hosted instance keeps all data on your machine.

Available Tools

21 tools
attach_assetAttach assetAInspect

Attach an image to a review so the viewer serves and renders it. Pass the file bytes as content_b64 (base64) and name as the exact src the draft uses (for example "/assets/x.png" or "fig/y.svg"). Attach once; it survives every update_source revision. On the local stdio server you can pass path instead, a local file path the wrapper reads and encodes for you, which keeps large files out of the conversation. A remote server cannot read your files, so it needs content_b64. Returns the stored name and the served url.

Inputs: id (required), name (required), path, content_b64.

create_commentCreate commentAInspect

Author a NEW comment on a document, anchored to a quoted phrase — use this to leave review feedback at a specific spot (you act as a reviewer). Pass quoted_text = the exact phrase from the source to anchor to (the viewer highlights it wherever it occurs) and text = your comment. Omit quoted_text for a document-level (unanchored) note. Attributed to role (default agent). After this, the reviewer (or you) can reply/resolve it like any thread.

Inputs: text (required), document_id (required), role, quoted_text.

create_reviewCreate reviewAInspect

Create a review from markdown; returns the id and the review and feedback urls. The viewer renders GFM, Mermaid diagrams (mermaid fenced blocks), LaTeX math ($...$ inline, $$...$$ display), GFM footnotes, syntax-highlighted fenced code (label the language) and images (attach them with attach_asset). A flow, decision tree, state machine or architecture reads best as a mermaid diagram, since a plain code fence renders as monospace text. Optional project, session and source_path record where the draft came from, for the dashboard. kind="latex" (default "markdown") makes a research-paper review instead: markdown then carries raw LaTeX (a single .tex document), shown in a split viewer with a live server-compiled PDF, and the markdown rules do not apply. If the content is LaTeX (a .tex source_path, or a body with \documentclass or \begin{document}), set kind="latex"; a latex-enabled server rejects the create otherwise. kind cannot change later. Recreating a review in the other format makes a new review with a new id and url, and its comments and history do not carry over.

Inputs: markdown (required), kind, title, project, +3 more.

delete_commentDelete commentA
Destructive
Inspect

Permanently deletes a comment and its whole thread. This cannot be undone. Use it to remove a comment created by mistake; resolve_comment marks a real comment addressed and keeps it in the Resolved panel.

Inputs: comment_id (required), document_id (required).

delete_reviewDelete reviewB
Destructive
Inspect

Delete a review and its data.

Inputs: id (required).

get_commentGet commentA
Read-only
Inspect

Fetch one comment thread in full — every reply plus the status_history (the open -> resolved -> reopened transitions).

Inputs: comment_id (required), document_id (required).

get_feedbackGet review feedbackA
Read-only
Inspect

Get a review's human feedback: structured notes (now including a projection of the comments) plus the rendered markdown block. For the full threads use list_comments.

Inputs: id (required).

get_git_urlGet review git URLA
Read-only
Inspect

Returns a git clone URL for a review's history: one commit per past round plus a live tip commit, so git log, git diff and git blame work with standard tools. Only available when the server has git-tracked history enabled; otherwise the call returns 404. Read-only: no push, no branching.

Inputs: id (required).

get_historyGet review historyA
Read-only
Inspect

List a review's past rounds; with round, fetch one past draft plus the feedback it received.

Inputs: id (required), round.

get_reviewGet reviewB
Read-only
Inspect

Get one review's metadata.

Inputs: id (required).

get_sourceGet review sourceA
Read-only
Inspect

Get a review's current source — the draft you edit (markdown, or raw LaTeX for a kind=latex review). Read it before applying feedback when you didn't keep the draft in memory (e.g. a resumed session). By default the result is the raw document verbatim, exactly as before. Pass with_revision=true to instead get a JSON envelope {"source": ..., "revision": N}: the revision is the optimistic-concurrency token for update_source's expected_revision, issued atomically with this read (same response), so use THIS — never a separate get_status poll — as the token source when you plan a guarded save.

Inputs: id (required), with_revision.

get_statusGet review statusA
Read-only
Inspect

Cheap poll: a review's source_updated, feedback_updated, and comments_updated timestamps. Watch comments_updated for new/changed comment threads. Also carries revision and can_edit (#288) — but for a guarded update_source take the revision from get_source(with_revision=true), the read that gave you the text, never from this poll. source_updated_by (#289) names who authored the current draft: "reviewer" means the human edited the document since your last write, so re-read the source before saving; "agent" (the default) means the last write was yours.

Inputs: id (required).

hand_backHand review backAInspect

Hand the turn back to the reviewer. Sets turn=reviewer on the review, so the viewer's banner reads 'Agent updated the draft, your turn' (state=done, the default) or 'Agent needs you' (state=blocked, used when you replied with a question instead of finishing); message is shown in that banner. Use it after update_source and the replies or resolves on the comments you addressed, or when blocked; for blocked, pair it with a comment reply that asks the question. Reopening a comment is a reviewer action in the viewer, not an agent action. Not available on a kind=latex review, which has no turn baton.

Inputs: message (required), document_id (required), state.

list_assetsList review assetsB
Read-only
Inspect

List a review's attached assets (name, stored name, served url, bytes, ctype).

Inputs: id (required).

list_commentsList commentsA
Read-only
Inspect

List comments on a document, filtered by status: open (default), resolved, reopened or all. Reply to a comment to discuss it; resolve it once it is addressed.

Inputs: document_id (required), status.

list_reviewsList reviewsA
Read-only
Inspect

List every review with its status (awaiting/feedback/resolved), note counts, and revision.

Inputs: no named parameters.

ping_workingSignal agent is workingAInspect

Claim or renew your lease on a review while you hold the turn. Find work by polling list_reviews / get_status for reviews you own with turn=='agent'; on one, call ping_working right away and then periodically while you work, so the viewer shows 'Agent is working…' instead of a stale 'Agent may have stopped' hint. owner is YOUR opaque session id; a review already leased by a DIFFERENT owner returns an error (HTTP 409) — back off and skip it (another agent holds it). Does NOT change whose turn it is. Not available on a kind=latex review: there is no turn baton in latex mode.

Inputs: owner (required), document_id (required), message.

reply_to_commentReply to commentAInspect

Add a reply to a comment WITHOUT resolving it. Use this when a comment is a question or needs discussion, or to respond before you decide — resolve only once the issue is actually addressed.

Inputs: text (required), comment_id (required), document_id (required).

resolve_commentResolve commentAInspect

Mark a comment resolved once you've actually addressed it. justification is OPTIONAL — provide a short note (appended to the thread, attributed to you, the agent) to explain what you did, or omit to resolve silently; a clear note is recommended because the reviewer can REOPEN the thread, so it reduces back-and-forth. On resolve the comment leaves the active document and moves to the Resolved panel. You never reopen — after a reviewer reopens, you'll see the comment again via list_comments (status reopened/open) and can reply or resolve again.

Inputs: comment_id (required), document_id (required), justification.

server_infoServer infoA
Read-only
Inspect

Reports this running MCP server's name, version, protocol_version, tools_hash, tool_count and tool_names. It describes only the running process and makes no call to the service. A human or CI compares tools_hash to python3 mcp_server.py --print-version on disk; if they differ, the running process is stale and the MCP client should be reconnected to load the new code. An MCP-only agent has no on-disk value to compare with, so it cannot make that check itself.

Inputs: no named parameters.

update_sourceUpdate review sourceA
Destructive
Inspect

Push a revised draft (applied edits). Snapshots a history round and live-reloads the human's page. A markdown review is rendered as in create_review (Mermaid, math, highlighted code). For a kind=latex review the draft is raw LaTeX (a single .tex document) and the server recompiles it to PDF on each push. The human can edit the document too, so save with a guard: read via get_source(with_revision=true) and pass that revision as expected_revision. A stale revision fails with HTTP 409 and writes nothing. On a 409, re-read the source, re-apply your change onto the new text and save with the fresh revision; never resend the earlier draft, which would silently overwrite the human's edit. Omitting expected_revision is an unconditional write.

Inputs: id (required), markdown (required), expected_revision.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 21 tools

    Disambiguation4/5

    Most tools target clearly distinct resource+action pairs (review, source, comment, asset, turn). The only real friction is the read surface: get_review vs get_status vs get_source vs get_feedback, and get_feedback vs list_comments/get_comment overlap slightly, though the descriptions explicitly steer ('for the full threads use list_comments', 'use get_source(with_revision=true) not this poll'). Those caveats make the boundaries learnable but not frictionless.

    Naming Consistency4/5

    The set is dominated by a clean verb_noun snake_case pattern (list_reviews, create_review, get_source, update_source, resolve_comment, delete_comment, attach_asset). Three outliers — hand_back, ping_working, server_info — are idiomatic and self-describing, so they read as minor deviations rather than a broken convention.

    Tool Count3/5

    21 tools is heavy for a review service; the comment CRUD block (create/list/get/reply/resolve/delete) plus four read variants on one review account for most of the surface. Each tool is well motivated, but coordination extras (hand_back, ping_working, server_info, get_git_url) push it into borderline territory where a few could collapse into options on existing calls.

    Completeness4/5

    Coverage is strong: full review lifecycle, optimistic-concurrency source updates, history and git backends, assets, comment threads with resolve/reopen, and turn/lease coordination. Gaps are small — assets can be attached and listed but not removed, review metadata is immutable (kind, project), and reopen is deliberately reviewer-only, all workable around.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides lightweight documentation review tools including issue detection, readability scoring, style checking, and document summarization for integration with MCP-compatible clients.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables reviewing Markdown files in a browser with inline annotations, submitting or cancelling reviews, and returning structured feedback through the review_markdown MCP tool.
      MIT