Co-Reading MCP
Co-Reading MCP is a durable shared reading room where Claude and a human can import, read, annotate, track, and exchange notes around books.
Import EPUB/TXT/Markdown books via single or chunked base64 uploads, and delete/archive books with confirmation.
List books and chunks, read chunks with prev/next links, continue from the next unread chunk, and search across book text.
Create and list Claude margin annotations anchored to passages, and reply under existing annotations.
Submit open human notes to Claude with session-aware chunk context, then list/read submission batches.
Mark chunks read and retrieve per-book or overall reading progress.
Collect, list, open, save, dismiss, and browse ritual reading cards/bookmarks for completed sections or shared passages.
Run it as an MCP server over stdio or remote HTTP/SSE, with an optional bundled reader UI and REST API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Co-Reading MCP Show me the next unread chunk."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Co-Reading MCP
A local MCP server that gives Claude a durable reading room:
import EPUB or plain text into stable chunks while preserving EPUB spine/chapter boundaries
list books and chunks
read chunk-by-chunk with
prevId/nextIdcontinue directly from the next unread chunk
search across a book with cached chunk text
write margin annotations
stage user notes, submit them to Claude once, and attach Claude replies under them
track reading progress
surface small shared-margin cards when human and Claude stop at the same passage
return a small finish ritual when a book is completed
The goal is not one-shot summarization. The goal is a shared reading surface where a human and Claude can both read, leave anchored notes, and resume smoothly. Human notes can also stay private until the reader chooses to share them with Claude.
For a step-by-step setup and usage flow, see docs/user-guide.md.
Quick Start
Requirements:
Node.js 18+
Python 3.10+ for the import scripts
cd co-reading-mcp
cp -R data.example data
node src/server.jsIf you also want a human-friendly reading surface, start the bundled reader:
npm run readerOpen http://127.0.0.1:8787. This serves a small reference reader and local HTTP API while also keeping the MCP stdio server active in the same process. In Claude Desktop / Claude Code you can point the MCP command at src/http.js instead of src/server.js when you want one process to handle both:
{
"mcpServers": {
"co-reading": {
"command": "node",
"args": ["/absolute/path/to/co-reading-mcp/src/http.js"],
"env": {
"READING_MCP_DATA_DIR": "/absolute/path/to/co-reading-mcp/data",
"READING_HTTP_PORT": "8787"
}
}
}
}The reader's Library header includes an import button for EPUB, TXT, or Markdown files. Browser imports upload the file directly to the co-reading server, so they also work with remote claude.ai setups where chat attachments are isolated from the MCP server filesystem.
For Claude Desktop / Claude Code, configure the MCP server as a stdio command:
{
"mcpServers": {
"co-reading": {
"command": "node",
"args": ["/absolute/path/to/co-reading-mcp/src/server.js"],
"env": {
"READING_MCP_DATA_DIR": "/absolute/path/to/co-reading-mcp/data"
}
}
}
}Related MCP server: mcp-ebook-read
Remote Server
For VPS, reverse-proxy, tunnel, or remote MCP clients, run one process:
READING_MCP_DATA_DIR=./data MCP_AUTH_TOKEN="change-me" npm run start:sseThe same port serves the human reader, REST API, and remote MCP transports:
https://your-domain.example/: reference reader UIhttps://your-domain.example/?token=change-me: reader UI with auth saved in a cookie (convenience shortcut — the token appears in the first request URL; avoid on shared devices or high-security setups)https://your-domain.example/api/*: reader REST APIhttps://your-domain.example/mcp: remote MCP JSON-RPC endpoint for custom connectorshttps://your-domain.example/sse: legacy MCP SSE transporthttps://your-domain.example/.well-known/oauth-protected-resource/mcp: MCP resource metadata for connector discovery
Environment variables:
MCP_SSE_PORTorPORT: listen port, default3100MCP_SSE_HOST: listen host, default0.0.0.0MCP_AUTH_TOKEN: bearer token required by remote clientsMCP_CORS_ORIGIN: CORS origin. WhenMCP_AUTH_TOKENis set, defaults to*; when unset, defaults to no CORS headers (blocks cross-origin requests)MCP_MAX_BODY_BYTES: max JSON-RPC POST body size, default25000000READING_IMPORT_MAX_BYTES: max EPUB/TXT upload size, default25000000
For Claude custom connectors, prefer the /mcp URL. /sse remains available for older MCP clients that still expect the SSE + /messages flow.
Do not expose the remote server on the public internet without HTTPS and MCP_AUTH_TOKEN. When MCP_AUTH_TOKEN is set, the reader, static assets, /api/*, /sse, /messages, /mcp, and /health require the token. Open the reader once with /?token=...; the server sets a same-site cookie and the reader stores the token for API calls. If you use nginx, Caddy, or cloudflared, proxy /, /api/*, /sse, /messages, /mcp, and /.well-known/* to the same local process and make sure streaming responses are not buffered.
Import Books
Plain text:
python3 scripts/import_text.py ./book.txt --title "Book Title" --author "Author" --out ./data/booksPlain text can also preserve section headings with a multiline regex:
python3 scripts/import_text.py ./book.txt \
--title "Book Title" \
--heading-regex "^第[一二三四五六七八九十百零〇0-9]+[章节回].*$"If a loose heading regex catches navigation labels or other tiny sections, add
--min-section-chars 100 or a similar threshold.
EPUB:
python3 scripts/import_epub.py ./book.epub --out ./data/booksAdd --keep-images to keep pictures and formula images (useful for textbooks). Images are copied to data/books/<book-id>/assets/, the text gets [[img:assets/<file>]] placeholders, and <sup>/<sub> become Unicode (t², x₀). Chunk ids and titles stay the same as a text-only import, so re-importing an existing book with images (same bookId with overwrite: true, or the script with the same --book-id) keeps its progress and notes attached to the same chunks (an older note whose quote crossed an image or a superscript keeps its margin card but may lose its in-text highlight). The bundled reader renders the placeholders as images; MCP clients see them as plain text.
Claude can also import books through MCP, which is useful on claude.ai or mobile devices where the user cannot SSH into the server:
reading_import_book: one EPUB/TXT as a base64 payloadreading_import_begin/reading_import_part/reading_import_finish: chunked upload for larger files
For example, after a user drops book.epub into a Claude chat, Claude can read the file, base64-encode it, and call reading_import_book:
{
"filename": "book.epub",
"dataBase64": "...",
"bookId": "optional-stable-id"
}TXT imports can pass the same heading options as the command-line script:
{
"filename": "book.txt",
"dataBase64": "...",
"title": "Book Title",
"headingRegex": "^Chapter\\s+\\w+"
}The import tools write into data/books immediately; no server restart is needed.
An import through the reader or MCP never changes or removes a book that is already in the library unless it passes overwrite: true. The result's status says what happened:
imported: a new book.unchanged: the same content is already there under that id; nothing was written.imported-new-id: nobookIdwas given and the id derived from the title (an EPUB's own title, otherwise the file name) belongs to a different book, so this one became<id>-2,<id>-3, … (existingBookIdnames the book that was in the way). Two different uploads both calleddownload.epubboth survive.replaced:overwrite: true. The new version is built first and only then swapped in, and the previous folder moves todata/trash/books/...(archivedAt). If the import fails, the old book stays as it was. Notes and progress stay with thebookId, so they still line up if the chunk ids do.
An explicit bookId that already exists is refused unless overwrite: true is passed. The command-line scripts below are lower level: they write straight into --out and reuse a folder with the same id.
Both importers create:
data/books/<book-id>/
manifest.json
chunks/
ch00.txt
ch01.txtKeep manual backups of a book folder outside data/books: every folder there with a manifest.json is listed as a book.
EPUB imports keep each spine item as a section boundary. If an EPUB stores the whole book in a single spine item, the importer falls back to internal h1/h2/h3 headings. If a chapter is longer than --max-chars, only that chapter is split into Chapter Title Part 1/N, Part 2/N, and so on.
Runtime state is stored outside book content:
data/
annotations.jsonl
progress.json
reading_sessions.json
snapshots/2026-05-22/ copies of the files above (plus cards.jsonl) from before that day's first writeBefore the first write of each day (server local time), the server copies annotations.jsonl, progress.json, reading_sessions.json, and cards.jsonl into data/snapshots/YYYY-MM-DD/, and keeps the newest 14 of those folders. Set READING_SNAPSHOT_KEEP to keep another number, or 0 to turn snapshots off. To roll back, stop the servers and copy the files from a snapshot folder over the ones in data/.
reading_submit_user_notes includes full chunk text once per sessionId by default, then sends only new notes for the same chunk in that session. Use a new sessionId when Claude starts a new conversation/session so the relevant chunk context is sent again.
A line in annotations.jsonl that can't be parsed (for example a write cut off by a crash or a full disk) is skipped on read, and the next append starts on a new line, so it never takes a neighbouring note with it. The next full rewrite of the file moves the damaged line to annotations.corrupt.jsonl instead of dropping it. cards.jsonl and submissions.jsonl are handled the same way.
Tools
reading_list_booksreading_list_chunksreading_read_chunkreading_continuereading_search_chunksreading_import_bookreading_import_beginreading_import_partreading_import_finishreading_import_cancelreading_delete_bookreading_annotate_passagereading_list_annotationsreading_export_annotationsreading_submit_user_notesreading_list_submissionsreading_read_submissionreading_reply_to_annotationreading_mark_readreading_card_inboxreading_card_collectionreading_open_cardreading_save_cardreading_dismiss_cardreading_list_cardsreading_collect_cardreading_get_progress
See docs/mcp-tools.md and docs/data-format.md. For the intended Claude workflow, see docs/claude-workflow.md.
Frontend Integration
The bundled reader is intentionally small: it is a reference UI, not a required frontend. Existing apps can talk to the same local HTTP API:
GET /api/booksDELETE /api/books/:bookIdGET /api/books/:bookId/chunksGET /api/books/:bookId/chunks/:chunkIdGET|HEAD /api/books/:bookId/asset/assets/<file>(images kept by--keep-images)GET /api/continue?bookId=...GET /api/annotations?bookId=...&chunkId=...POST /api/annotationsGET /api/books/:bookId/annotations.md(all of one book's notes as Markdown, open notes included)POST /api/repliesPOST /api/submit-notesPOST /api/mark-readGET /api/search?q=...&bookId=...POST /api/import
A chunk token [[img:assets/<file>]] maps to /api/books/<encodeURIComponent(bookId)>/asset/assets/<file>. The route uses the same auth as the rest of /api/* (bearer header or the reader cookie), only serves files inside the book's assets/ folder, refuses .., encoded slashes, and symlinks that leave the folder, and sends Cache-Control: private, max-age=604800 with an ETag (If-None-Match gets a 304).
Human notes are saved as open local notes first. Pressing "Send to Claude" calls reading_submit_user_notes, includes chunk context according to the session policy, marks those notes submitted, and avoids resending the same open notes.
Deleting a book removes it from the active library and archives the book folder plus related progress, annotations, submissions, and cards under data/trash/books/.... Trash is pruned after 30 days by default; set READING_TRASH_RETENTION_DAYS=0 to keep trash forever.
Small ritual cards/bookmarks can be collected with reading_collect_card. Claude can then use reading_card_inbox like a quiet bookmark inbox, open a visual card with reading_open_card, save it as a local image with reading_save_card, or clear it with reading_dismiss_card. They are meant for completed sections, shared-margin moments, quiet passages worth carrying forward, and a separate Last Fold card when the final chunk of a book is marked read.
By default the card renderer stays zero-dependency and falls back to SVG. For the polished PNG cards, install Playwright's Chromium renderer once:
npm i -D playwright
npm run install:card-rendererPrivacy
This repo is designed so private content stays in data/, which is ignored by git. data.example/ contains only toy text.
Contributors
GPT
Claude
Koshi
Elsewhere: paintings, songs, and an interview Claude made with nerolette — claude-n-koshi.cc/nerolette · paper-boats.
Available Tools
26 toolsreading_annotate_passageA
Write a Claude margin annotation anchored to a quote in a chunk. Human private notes should be created through the HTTP reader API, not this MCP tool.
Inputs: note (required), quote (required), bookId (required), chunkId (required), +5 more.
reading_card_collectionBRead-only
Browse collected reading cards as a paginated collection without opening every image.
Inputs: limit, bookId, offset.
reading_card_inboxBRead-only
Show unread collected reading-card prompts, like a small bookmark inbox.
Inputs: limit, bookId.
reading_collect_cardC
Collect a small ritual reading card/bookmark so it can be revisited later.
Inputs: art, note, quote, scope, +10 more.
reading_continueARead-only
Continue reading from the next unread chunk. If bookId is omitted, use the most recently read book.
Inputs: bookId.
reading_delete_bookADestructive
Delete a book from the active library and archive its book folder plus related progress, annotations, submissions, and cards under data/trash. Requires confirm: true.
Inputs: bookId (required), confirm (required).
reading_dismiss_cardA
Dismiss one collected reading card from the card inbox without deleting it.
Inputs: cardId (required).
reading_get_progressARead-only
Get reading progress for one book or all books.
Inputs: bookId.
reading_import_beginB
Start a chunked EPUB/TXT import. Use this when the file is too large for one reading_import_book request.
Inputs: filename (required), title, author, bookId, +6 more.
reading_import_bookA
Import one EPUB or TXT file from base64 content into the reading library. Use this for files small enough for one MCP request.
Inputs: filename (required), dataBase64 (required), title, author, +6 more.
reading_import_cancelA
Cancel a chunked import and delete its temporary upload file.
Inputs: uploadId (required).
reading_import_finishB
Finish a chunked import and add the uploaded EPUB/TXT to the reading library.
Inputs: uploadId (required).
reading_import_partA
Append one base64 file part to an active chunked import.
Inputs: uploadId (required), dataBase64 (required), index.
reading_list_annotationsARead-only
List annotations, optionally filtered by book, chunk, kind, or author.
Inputs: kind, author, bookId, status, +2 more.
reading_list_booksARead-only
List imported books with progress and annotation counts.
Inputs: no named parameters.
reading_list_cardsCRead-only
List collected ritual reading cards/bookmarks for completed sections or shared margin moments.
Inputs: limit, scope, bookId, source, +1 more.
reading_list_chunksARead-only
List chunks for a book in reading order.
Inputs: bookId (required).
reading_list_submissionsBRead-only
List human note submission batches that have been shared with Claude.
Inputs: limit, bookId, chunkId, sessionId.
reading_mark_readA
Mark a chunk as read and update last-read progress.
Inputs: bookId (required), chunkId (required).
reading_open_cardARead-only
Open one collected reading card and return it as an image for Claude to view.
Inputs: cardId (required).
reading_read_chunkARead-only
Read one book chunk and return prevId/nextId.
Inputs: bookId (required), chunkId (required).
reading_read_submissionBRead-only
Read one human note submission batch including notes and context.
Inputs: submissionId (required).
reading_reply_to_annotationC
Attach a Claude reply under an existing user or Claude annotation.
Inputs: note (required), parentId (required), kind, mood, +4 more.
reading_save_cardA
Render one collected reading card to a local image file and return its absolute path.
Inputs: cardId (required).
reading_search_chunksBRead-only
Search book chunks by keyword.
Inputs: query (required), limit, bookId.
reading_submit_user_notesA
Submit open user notes for Claude review. By default, include each chunk's full text once per session and mark notes submitted so they are not sent again.
Inputs: bookId, chunkId, sessionId, contextMode, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 26 tools
Each tool has a clear and distinct purpose, targeting specific actions like annotating, collecting, reading, importing, or listing resources. There is no ambiguity or overlap between tools.
All tools follow a consistent 'reading_verb_noun' pattern, using snake_case and imperative verbs, making the naming predictable and easy to understand.
With 26 tools, the count is slightly above the ideal range, but it is justified by the comprehensive scope covering import, reading, annotation, cards, and submissions. Each tool appears necessary for the full feature set.
The tool surface covers the main lifecycle of reading and annotation, including import, chunk reading, annotations, cards, and submissions. Minor gaps like update/delete operations for annotations exist, but core workflows are well-supported.
Related MCP Connectors
MCP server for Serena — tasks, notes & projects from Claude, Codex, Cursor & ChatGPT.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Hosted Web Crawler MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- FlicenseAqualityDmaintenanceAn MCP server that exposes a fully offline RAG library of books (PDFs, EPUBs, markdown, text) to Claude, enabling hybrid search and retrieval of contextualized chunks via read-only tools.51-
- AlicenseBqualityDmaintenanceA local MCP server that lets LLM agents read EPUB books and PDF documents with outline-first navigation, precise node reads, and local SQLite persistence.292MIT
- AlicenseAqualityDmaintenanceAn MCP server that splits PDFs by chapters/sections and reads them in Claude-friendly chunks. Enables structured reading of large PDF documents.6MIT
- FlicenseAqualityBmaintenanceA local MCP server for low-token co-reading: import a book, split it into chapter-sized chunks, read it chunk by chunk, and keep notes so a session can resume without re-reading the whole book.12-