gutenberg-mcp-server
Provides tools to search, browse, and retrieve books and full plain texts from Project Gutenberg's library of public-domain works.
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., "@gutenberg-mcp-serversearch for 'Moby Dick' by Herman Melville"
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.
Public Hosted Server: https://gutenberg.caseyjhand.com/mcp
Overview
Project Gutenberg's library of 78,000+ public-domain books, cataloged through the Gutendex API and served from a Gutenberg content mirror. Search by title, author, topic, or language, fetch full book metadata, and retrieve plain-text content in offset/limit chunks for long works from any MCP client. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
Tools
Tool | Description |
| Search the catalog by title, author, topic, language, or author lifespan, with pagination and popularity sorting |
| Fetch complete metadata for a book by ID — authors, translators, editors, full formats map, subjects, copyright status |
| Retrieve a book's plain-text content stripped of license boilerplate, with offset/limit chunking |
| Browse the most-downloaded books, optionally filtered by language or topic |
Related MCP server: books-catalog
Capability reference
gutenberg_search_books tool
Free-text
querymatches titles and author names;topicmatches subjects/bookshelves separately fromqueryFilters:
languages(ISO 639-1 codes),author_year_start/author_year_endlifespan range,idsfor a batch lookup by known ID listsort:popular(default, by download count) orascending/descendingby Gutenberg IDPaginated — up to 32 books per page;
totalCountandhasMoredrive further pagesEach result carries
has_plain_textto pre-filter before callinggutenberg_get_textTyped failures:
no_results,page_out_of_range,catalog_unavailable
gutenberg_get_book tool
Returns the full
formatsmap (MIME type → download URL) — plain text, HTML, EPUB, cover imageAuthors, translators, and editors each carry birth/death years
has_plain_textconfirms a UTF-8 plain-text format exists;media_typedistinguishes text books from audio ("Sound")summaryis the first entry of Gutendex'ssummariesarray — both arenull/empty when Gutendex has noneTyped failures:
not_found,catalog_unavailable
gutenberg_get_text tool
offset/limitchunking (limit 1–50,000, default 20,000) for works that routinely run 500KB–2MBStrips the standard Gutenberg license header and footer before chunking
Prefers UTF-8 plain text; falls back to an HTML-to-text conversion (
sourceFormatreports which)Response carries
totalChars,length,remainingChars,hasMore— uselength, notlimit, to compute the nextoffset, since paragraph-boundary trimming can return slightly less than requestedprovenancecarries the Gutenberg ID, title, and license URL for attributionTyped failures:
not_found,audio_book(refusesmedia_type "Sound"),no_text_format,offset_out_of_range,text_fetch_failed,catalog_unavailable
gutenberg_browse_popular tool
Returns up to 32 titles (
limit, default 20) ordered by download count, most popular firstOptional
languagesandtopicfilters, applied togethertotalInCataloggives full context (e.g. "top 20 of 60,000")Enrichment reports whether results were truncated and the download-count ceiling of the least-popular book shown, pointing to
gutenberg_search_booksto page through the restTyped failures:
no_results,catalog_unavailable
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Gutenberg-specific:
Catalog search and metadata via Gutendex, an unofficial but stable JSON API over the Gutenberg dataset
Single-book lookups (
gutenberg_get_book,gutenberg_get_text) read from a local SQLite+FTS5 catalog mirror when it holds the record, falling back to the live Gutendex API otherwiseFull plain-text retrieval from a Project Gutenberg content mirror that permits automated access, with transparent UTF-8/HTML fallback
Tenant-scoped text caching — book text is fetched once per tenant and served from cache for subsequent chunk reads
No API key required
Agent-friendly output:
has_plain_textflag on every search/browse result lets agents pre-filter before attempting text retrievalPrecise chunking contract on
gutenberg_get_text—offset,length,totalChars,remainingChars,hasMorefor reliable sequential readsprovenanceand discriminatedsourceFormatfields on every text response, for attribution and fidelity awarenessgutenberg_browse_popularenrichment reports truncation state and the download-count ceiling of omitted results
Getting started
Public Hosted Instance
A public instance is available at https://gutenberg.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"gutenberg-mcp-server": {
"type": "streamable-http",
"url": "https://gutenberg.caseyjhand.com/mcp"
}
}
}Self-Hosted / Local
No API key required. Add the following to your MCP client configuration file:
{
"mcpServers": {
"gutenberg-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/gutenberg-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"gutenberg-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/gutenberg-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with Docker:
{
"mcpServers": {
"gutenberg-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"ghcr.io/cyanheads/gutenberg-mcp-server:latest"
]
}
}
}For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcpPrerequisites
Bun v1.3.0 or higher (or Node.js v24+).
No API key required — Project Gutenberg data is freely available.
Installation
Clone the repository:
git clone https://github.com/cyanheads/gutenberg-mcp-server.gitNavigate into the directory:
cd gutenberg-mcp-serverInstall dependencies:
bun installConfigure environment:
cp .env.example .env
# edit .env if you need to override any defaultsConfiguration
Variable | Description | Default |
| Base URL for the Gutendex catalog API. Override for self-hosted instances. |
|
| Base URL for a Project Gutenberg content mirror serving the |
|
| Transport: |
|
| HTTP session mode: |
|
| Port for HTTP server. |
|
| Auth mode: |
|
| Log level (RFC 5424). |
|
| Directory for log files (Node.js only). |
|
| Storage backend. |
|
| Enable OpenTelemetry instrumentation. |
|
See .env.example for the full list of optional overrides.
Running the server
Local development
Build and run:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:httpRun checks and tests:
bun run devcheck # Lint, format, typecheck, security bun run test # Vitest test suite bun run lint:mcp # Validate MCP definitions against spec
Docker
docker build -t gutenberg-mcp-server .
docker run --rm -p 3010:3010 gutenberg-mcp-serverThe Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/gutenberg-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
Directory | Purpose |
|
|
| Server-specific environment variable parsing (Gutendex and file-server URL overrides). |
| Tool definitions ( |
| Gutendex catalog API client — search and book metadata. |
| Local SQLite+FTS5 catalog mirror — RDF ingestion and read helpers. |
| Full plain-text retrieval, boilerplate stripping, tenant-scoped caching, and chunking. |
| Unit and integration tests mirroring |
Development guide
See CLAUDE.md / AGENTS.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storageRegister new tools via the entry arrays in
src/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testData attribution
Data from Project Gutenberg is in the public domain. Catalog metadata sourced from Gutendex (MIT license).
License
Apache-2.0 — see LICENSE for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Gutendex MCP — wraps Gutendex API for Project Gutenberg books (free, no auth)
Books MCP — wraps Open Library API (free, no auth)
Open Library MCP — Internet Archive's open book metadata
Quotes MCP — citation-grade quote API for public-domain authors.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceMCP server that gives AI agents access to the world's public domain library. Search, read, and navigate books and audiobooks from Project Gutenberg and LibriVox.-
- AlicenseNot gradedqualityDmaintenanceA well-documented MCP server that exposes a local SQLite catalog of public-domain books through tools like search, get, filter by genre, top-rated, and catalog stats.MIT
- AlicenseNot gradedqualityCmaintenanceEnables search and reading of Project Gutenberg books with tools for searching by title/author/subject and fetching word-range slices of book text.MIT
- AlicenseAqualityAmaintenanceThis MCP server enables AI agents to search and retrieve exact, cited passages from a large corpus of public-domain books, including full-text search, book metadata, chapters, quotes, and 'ask book' Q&A. Payments are handled via x402 micropayments on Base.848 npmMIT