project-gutenberg-mcp
Allows searching for books by title or author, retrieving book metadata, downloading full text, and accessing fixed-size passages from Project Gutenberg.
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., "@project-gutenberg-mcpSearch for 'Moby Dick' and get its metadata."
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.
project-gutenberg-mcp
An MCP server for reading books from Project Gutenberg.
Project Gutenberg Terms of Service
Project Gutenberg's robot access policy states that the site is intended for human users only. Automated access may result in your IP being blocked.
To use this MCP server you must run your own mirror. Project Gutenberg explicitly supports and encourages mirroring — see their mirroring guide for details.
This repository includes a ready-to-run mirror server in the mirror/ directory.
Related MCP server: gutenberg-mcp
Mirror Setup
The mirror server downloads the Project Gutenberg catalog on startup (~5 MB compressed) and caches book files locally on first access. It exposes the URL structure that this MCP server expects.
Docker Compose (recommended)
Runs the mirror and MCP server together. The MCP server is exposed on HTTP at port 8081.
docker compose upThe mirror is available at http://localhost:8080 and the MCP server at http://localhost:8081/mcp.
Mirror only (stdio)
Build and start just the mirror, then connect an MCP client via stdio.
task build:mirror
task start:mirrorThe mirror runs at http://localhost:8080. Example MCP client config (stdio):
{
"mcpServers": {
"project-gutenberg-mcp": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "GUTENBERG_BASE_URL=http://host.docker.internal:8080",
"-e", "GUTENBERG_TOOLS=search_books,get_book_metadata,list_passages,get_passage",
"roberthouse224/project-gutenberg-mcp"
]
}
}
}Configuration
All configuration is via environment variables.
Variable | Required | Description |
| Yes | Base URL of your Gutenberg mirror (see Mirror Setup above) |
| Yes | Comma-separated list of tools to expose (see below) |
| No | Project Gutenberg book ID to use as default |
| No | Passage size in bytes (default: 4096) |
| No | Default ISO 639-1 language code for |
Tools
Tool | Description |
| Search for books by title or author |
| Fetch metadata (title, authors, formats) for a book |
| Download the full plain text of a book |
| List fixed-size passage keys for a book |
| Fetch a specific passage by its key |
When GUTENBERG_BOOK_ID is set, tools that take a book ID will use it as the default. When it is not set, include search_books in your tools list so an agent can discover IDs first.
Running
stdio
GUTENBERG_BASE_URL=http://localhost:8080 \
GUTENBERG_BOOK_ID=2680 \
GUTENBERG_TOOLS=get_book_metadata,list_passages,get_passage \
./project-gutenberg-mcp --transport stdioHTTP
GUTENBERG_BASE_URL=http://localhost:8080 \
GUTENBERG_BOOK_ID=2680 \
GUTENBERG_TOOLS=get_book_metadata,list_passages,get_passage \
./project-gutenberg-mcp --transport http --addr :8081Docker
Pulling pre-built images
# MCP server
docker pull roberthouse224/project-gutenberg-mcp:1.2.0
# Mirror
docker pull roberthouse224/gutenberg-mirror:1.2.0Building locally
Both Dockerfiles use Docker Hardened Images (DHI) for enhanced security. Building requires authentication to Docker Hub:
docker loginThen build:
# Build MCP server
docker build -t project-gutenberg-mcp .
# Build mirror
docker build -f mirror/Dockerfile -t gutenberg-mirror ./mirrorRunning the MCP server
# HTTP
docker run -p 8081:8081 \
-e GUTENBERG_BASE_URL=http://host.docker.internal:8080 \
-e GUTENBERG_BOOK_ID=2680 \
-e GUTENBERG_TOOLS=get_book_metadata,list_passages,get_passage \
roberthouse224/project-gutenberg-mcp --transport http --addr :8081
# stdio
docker run -i --rm \
-e GUTENBERG_BASE_URL=http://host.docker.internal:8080 \
-e GUTENBERG_BOOK_ID=2680 \
-e GUTENBERG_TOOLS=get_book_metadata,list_passages,get_passage \
roberthouse224/project-gutenberg-mcpRunning the mirror
# Create a named volume for cache persistence
docker volume create gutenberg-cache
# Run mirror (serves on http://localhost:8080)
docker run -d \
-p 8080:8080 \
-v gutenberg-cache:/data \
--name gutenberg-mirror \
roberthouse224/gutenberg-mirror:1.2.0Multi-architecture builds
Both images support linux/amd64 and linux/arm64 architectures. To build and push multi-arch images:
# Create a builder instance
docker buildx create --name multiarch --use
# Build and push MCP server
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t roberthouse224/project-gutenberg-mcp:1.2.0 \
-t roberthouse224/project-gutenberg-mcp:latest \
--push \
.
# Build and push mirror
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t roberthouse224/gutenberg-mirror:1.2.0 \
-t roberthouse224/gutenberg-mirror:latest \
--push \
-f mirror/Dockerfile \
./mirrorMCP client config (stdio)
{
"mcpServers": {
"project-gutenberg-mcp": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "GUTENBERG_BASE_URL=http://host.docker.internal:8080",
"-e", "GUTENBERG_BOOK_ID=2680",
"-e", "GUTENBERG_TOOLS=get_book_metadata,list_passages,get_passage",
"roberthouse224/project-gutenberg-mcp:1.2.0"
]
}
}
}Local builds (non-Docker)
task build # outputs to build/project-gutenberg-mcp
task build:mirror # outputs to mirror/build/mirror
task testBook IDs
A few useful IDs:
Book | ID |
Meditations — Marcus Aurelius | 2680 |
The Republic — Plato | 1497 |
Thus Spoke Zarathustra — Nietzsche | 1998 |
Moby Dick — Melville | 2701 |
Pride and Prejudice — Austen | 1342 |
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Project Gutenberg — 75,000+ public-domain ebooks with full plain-text retrieval.
Gutendex MCP — wraps Gutendex API for Project Gutenberg books (free, no auth)
Books MCP — wraps Open Library API (free, no auth)
MCP server for Russian books search, details, and recommendation candidates.
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 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
- AlicenseNot gradedqualityCmaintenanceEnables searching and retrieving audiobooks, authors, and tracks from LibriVox through an MCP interface.1 npmMIT
- AlicenseNot gradedqualityAmaintenanceSearch, browse, and read 75,000+ public-domain books from Project Gutenberg with full plain-text retrieval and offset/limit chunking via MCP.72 npm3Apache 2.0