
yomeru-mcp
io.github.Fiction000/yomeru-mcp
Find every legal way to read a book: owned copies, public-domain editions, and library holdings.
Documentation
yomeru-mcp
An MCP server that finds the fastest legal way to read a book today, in one call.
Give find_reading_options a title in any language, or an ISBN. It checks your own books, free editions, the National Diet Library's scans, and your local libraries, then says what you can read today and what you'd have to wait for.
What one call checks
- Books you already own, from a folder of Kindle highlight notes (optional).
- Free editions, judged under Japanese law by default: Aozora Bunko (青空文庫) and Project Gutenberg, each with the copyright basis.
- National Diet Library digitized books (国立国会図書館デジタルコレクション), including the out-of-print ones you can read at home through personal transmission (個人送信).
- Library holdings and loan status at the libraries you choose, with a link to each library's reservation page when it has one. This uses Calil (カーリル) and needs a free key.
- Translations and originals: the Japanese translations of a foreign book, and the original of a translated one, each with an ISBN where the catalogue has one and a confidence level.
The answer includes a recommendation (today and wait), every option it found, and a status for each source.
A source that didn't answer is never reported as "not available". Each one says found, not_found, partial, error, rate_limited or skipped, and the recommendation names whatever wasn't checked. A skipped source that doesn't apply to the work carries applicable: false and isn't named.
Without any API key you get owned books, free editions, NDL scans, and edition matching. Library loan status and reservation links need CALIL_APPKEY and YOMERU_LIBRARIES. Until both are set, the calil source says skipped, names the unset variable, and the recommendation repeats it.
Try it
npx -y yomeru-mcp find "蝸牛考" "柳田国男"
On 2026-12-05 this returned a 1930 scan anyone can read online (https://dl.ndl.go.jp/pid/1823865) and a 1980 scan readable only inside the National Diet Library. The catalogues change, so your answer may differ.
Install
The server runs over stdio as npx -y yomeru-mcp. Any MCP client that starts a stdio server can use it. In Cursor and other clients, set the command to npx and the arguments to -y yomeru-mcp.
Claude Code
claude mcp add yomeru -- npx -y yomeru-mcp
This adds the server to the current project only. To use it in every project, add --scope user before --. To share it through version control, add --scope project. Claude Code then writes .mcp.json in the project root and asks each person to approve the server:
{
"mcpServers": {
"yomeru": {
"type": "stdio",
"command": "npx",
"args": ["-y", "yomeru-mcp"]
}
}
}
Keep API keys out of .mcp.json. Set them in a local or user scope instead.
Codex
codex mcp add yomeru -- npx -y yomeru-mcp
This writes a [mcp_servers.yomeru] table to ~/.codex/config.toml. You can also write the table by hand. Configuration shows it with environment variables.
To look up a book without an MCP client:
npx -y yomeru-mcp find "Influence" Cialdini
npx -y yomeru-mcp find 9784414304220
The first run downloads the Aozora Bunko list (about 2 MB) and the Project Gutenberg catalogue (about 6 MB). Both are cached for a week.
Tools
| Tool | What it does |
|---|---|
find_reading_options | query (title or ISBN), optional author. Returns editions, reading options (owned, free, NDL digitized, library), a recommendation, a per-source status and the required attribution. |
list_libraries | pref, optional city. Lists Calil library system IDs to put in YOMERU_LIBRARIES. Needs CALIL_APPKEY. |
Configuration
All optional.
| Variable | Effect |
|---|---|
CALIL_APPKEY | Calil API key (free registration). Enables library lookups, with YOMERU_LIBRARIES. |
YOMERU_LIBRARIES | Comma-separated Calil system IDs, for example Tokyo_Setagaya,Tokyo_Meguro. |
YOMERU_KINDLE_DIR | A folder of Markdown notes with kindle-sync: front matter (as written by the Obsidian Kindle Highlights plugin). Used to say "you already own this". Read only; titles never leave your machine. |
YOMERU_JURISDICTION | JP (default) or US. Decides when a Project Gutenberg book counts as free. |
YOMERU_CACHE_DIR | Cache location. Default ~/.cache/yomeru-mcp. |
YOMERU_DEADLINE_MS | Time budget for one lookup, default 45000. A source with no answer by then is reported as error (unknown), never as not found, and keeps loading in the background so the next lookup is fast. |
Example with everything on, in Claude Code:
claude mcp add yomeru \
-e CALIL_APPKEY=your-key \
-e YOMERU_LIBRARIES=Tokyo_Setagaya \
-e YOMERU_KINDLE_DIR="$HOME/Obsidian/Kindle" \
-- npx -y yomeru-mcp
The same in Codex. Pass each variable as --env KEY=value before --:
codex mcp add yomeru \
--env CALIL_APPKEY=your-key \
--env YOMERU_LIBRARIES=Tokyo_Setagaya \
--env YOMERU_KINDLE_DIR="$HOME/Obsidian/Kindle" \
-- npx -y yomeru-mcp
The command writes this to ~/.codex/config.toml. TOML does not expand $HOME, so write the full path if you edit the file by hand:
[mcp_servers.yomeru]
command = "npx"
args = ["-y", "yomeru-mcp"]
[mcp_servers.yomeru.env]
CALIL_APPKEY = "your-key"
YOMERU_LIBRARIES = "Tokyo_Setagaya"
YOMERU_KINDLE_DIR = "/Users/you/Obsidian/Kindle"
Libraries and reservations
Run list_libraries with your prefecture and city to find system IDs, then set YOMERU_LIBRARIES. Each held copy comes with its branch, its loan state, a Calil link, and reserveUrl when Calil gives a reservation page.
You reserve on the library's own site, with your own library account. The server doesn't log in or place holds. Calil's API doesn't return the number of holds, so check the queue at the library (予約件数は図書館で確認).
National Diet Library digitized books
NDL Search states an access level for each scan. Every ndl_digital option carries it in access, with a note on who can use it.
access | Who can read it |
|---|---|
internet | Anyone online, without logging in. |
personal_transmission | Registered users of the National Diet Library with full registration (本登録) who live in Japan. How to register and use it. |
library_transmission | People using a participating library, on site and under that library's rules. |
ndl_onsite | Visitors to the National Diet Library, on its terminals. |
unknown | NDL stated no access level the server recognizes. Check the page. |
NDL marks one set of scans for both personal and library transmission, so those scans appear under both. Access levels can change. fetchedAt records the lookup, and NDL answers are cached for up to a day.
The server lists the newest 3 scans per access level and says in the ndl_digital source detail how many more it left out.
How "free" is decided
- Aozora Bunko: the library itself confirms each work is out of copyright, or that the rights holder allows free publication. Those works are offered as free.
- National Diet Library: a scan counts as free when NDL marks it open on the internet (インターネット公開).
- Project Gutenberg: Gutenberg clears works under US law, which is not the same as Japanese law. Under
JP, a Gutenberg book counts as free only when every author and translator died in 1957 or earlier. That covers Japan's old 50-year term plus the longest wartime extension for Allied-country authors, both of which ran out before Japan moved to 70 years at the end of 2018. Anything else is listed innotesas "free in the US, not confirmed in Japan".
If the Gutenberg catalogue can't be downloaded, the server answers from its older copy and says when that copy was fetched. A book missing from the older copy is reported as partial. With no copy at all, the source is error.
This tool isn't legal advice. It doesn't search or link to shadow libraries.
How editions are matched
- An ISBN query is looked up directly: National Diet Library (NDL Search) for Japanese ISBNs, Open Library for the rest.
- A title query searches NDL, and Open Library too unless the title contains kana or kanji. Only records whose main title matches and that share an author family name are kept.
- For a foreign book, NDL is searched for Japanese editions whose cataloguing notes (
原タイトル) name the original title. For a Japanese translation, Open Library is searched for the original. - NDL's digitized books are searched by title and author. A scan is offered only when its main title, or that title without a volume mark such as 上 or 下巻, matches and an author matches.
- Each edition carries a confidence:
isbn(you gave the ISBN),title_author(main title and author both match), orcandidate(title only, no author given).
Being a good API citizen
Requests to each service are serialized, spaced out (NDL 2s, Calil 2s, Open Library 1s), and identify this project in the User-Agent. NDL and Open Library answers are cached for a day. NDL's rate limit is answered with a backoff and then reported as rate_limited, never as an empty result. If you run this at volume, register your use with the National Diet Library first.
Data sources and attribution
Each response lists what it used in attribution. When showing library names or loan status from Calil, link to Calil, as its terms require.
- National Diet Library Search (国立国会図書館サーチ)
- Open Library
- Aozora Bunko (青空文庫)
- Project Gutenberg
- Calil (カーリル)
Develop
npm install
npm run build
npm test
The eval/ folder holds the golden-set scripts that measure matching accuracy against real catalogue records.
License
MIT
yomeru-mcpnpm install yomeru-mcp