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 "Install 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
Tools
Four tools for searching and reading Project Gutenberg's public-domain library:
Tool | Description |
| Search the Gutenberg catalog by title, author, topic, language, or author lifespan — returns popularity-ordered results with IDs ready for follow-up calls |
| Fetch complete metadata for a book by ID — full formats map, translators, editors, subjects, bookshelves, copyright status, and the |
| Retrieve the plain-text content of a book, stripped of license boilerplate, with offset/limit chunking for context-budget management |
| Browse the most-downloaded books, optionally filtered by language or topic — useful as a discovery entry point |
gutenberg_search_books
Search the Project Gutenberg catalog of 78,000+ public-domain books.
Full-text search against titles and author names (space-separated words, case-insensitive)
Topic filter matches subject headings and bookshelf categories
Language filter by ISO 639-1 two-character codes (e.g.,
["en"],["fr", "de"])Author lifespan range filter via
author_year_start/author_year_endSort by popularity (download count), or by Gutenberg ID ascending/descending
Batch lookup by known ID list via
idsparameterPaginated — up to 32 books per page; use
totalCountto determine total pagesEach result includes
has_plain_textto indicate whethergutenberg_get_textwill work
gutenberg_get_book
Fetch complete metadata for a single Project Gutenberg book.
Returns the full formats map (MIME type → download URL) including plain text, HTML, EPUB, and cover image
Includes translators and editors alongside authors, each with birth/death years
has_plain_textflag confirms whether a UTF-8 plain-text format is availablemedia_typedistinguishes readable text books from audio recordingsUse this before
gutenberg_get_textto confirm text availability and inspect the formats map
gutenberg_get_text
Retrieve the plain-text content of a Project Gutenberg book, stripped of license boilerplate.
Strips the standard Gutenberg license header and footer — response contains only the literary work
Offset/limit chunking for long works: novels routinely run 500 KB–2 MB; read in manageable chunks without loading the whole file
Response includes
totalChars,offset,length, andremainingCharsfor precise paginationParagraph-boundary trimming: actual returned length may be slightly less than
limit— uselength(notlimit) to compute the next offsetPrefers UTF-8 plain text; falls back to an HTML edition converted to text
Refuses audio books (
media_type "Sound") with a clear recovery hintprovenancefield carries the Gutenberg ID, title, and license URL for attribution
gutenberg_browse_popular
Browse the most-downloaded Project Gutenberg books.
Returns up to 32 titles ordered by download count (most popular first)
Optionally filter by language (ISO 639-1 codes) and/or topic keyword
Useful as a discovery entry point: "what are the most popular classics in French?"
totalInCatalogprovides full context — "top 20 of 60,000"
Related MCP server: open-public-domain
Features
Built on @cyanheads/mcp-ts-core:
Declarative tool definitions — single file per tool, framework handles registration and validation
Unified error handling — handlers throw, framework catches, classifies, and formats with recovery hints
Pluggable auth:
none,jwt,oauthSwappable storage backends:
in-memory,filesystem,Supabase,Cloudflare KV/R2/D1Structured logging with optional OpenTelemetry tracing
STDIO and Streamable HTTP transports
Project Gutenberg integration:
Catalog search and metadata via Gutendex — an unofficial but stable JSON API over the Gutenberg dataset
Full plain-text retrieval from a Project Gutenberg content mirror (permits automated access) with transparent UTF-8/HTML fallback
In-session text caching: book text is fetched once per session and served from cache for subsequent chunk reads
No API key required — Project Gutenberg data is freely available; no registration needed
Agent-friendly output:
has_plain_textflag on every search/browse result so agents can pre-filter before attempting text retrievalPrecise chunking contract:
offset,length,totalChars,remainingChars,hasMoreon everygutenberg_get_textresponse for reliable sequential readsprovenancefield on every text response for attributionDiscriminated
sourceFormatfield (text/plain; charset=utf-8,text/html) so agents know the fidelity of the text
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.11 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: |
|
| 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
Path | Purpose |
|
|
| Server-specific environment variable parsing (Gutendex and file-server URL overrides). |
| Tool definitions ( |
| Gutendex catalog API client — search and book metadata. |
| Full plain-text retrieval, boilerplate stripping, in-session 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 and pull requests are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
Data from Project Gutenberg is in the public domain. Catalog metadata sourced from Gutendex (MIT license).
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyanheads/gutenberg-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server