runeberg-mcp
by tobbaz
README.md
# Runeberg MCP ๐
[](https://opensource.org/licenses/MIT)
[](https://www.python.org/downloads/)
[](https://modelcontextprotocol.io/)
A Model Context Protocol (MCP) server and CLI tool for searching and reading digitized classic Nordic literature, historical encyclopedias, biographies, and source documents from [Projekt Runeberg](https://runeberg.org).
Project Runeberg has been publishing free electronic editions of classic Nordic literature out of copyright since 1992. It includes vast cultural treasures such as *Nordisk familjebok*, *Svenskt biografiskt handlexikon*, *Salmonsens konversationsleksikon*, parish histories, memoirs, drama, and poetry.
---
## โจ Features
- **๐ Full-Text Search (`runeberg_search`):** Search the actual text of millions of scanned book pages across Projekt Runeberg.
- **๐ Clean Page Reading (`runeberg_read_page`):** Extract and format the transcribed/OCR text for any page, stripped of web markup and navigation. Includes links to original facsimile scans.
- **๐ Work & Chapter Inspector (`runeberg_get_work_info`):** Retrieve metadata, authors, publication years, and tables of contents/chapter links for any digitized volume.
- **โก Zero-Config by Default:** Works out-of-the-box using privacy-respecting search backends (DuckDuckGo/multi-engine) without requiring any API keys.
- **๐ Optional Google Custom Search API:** Supports official Google Custom Search JSON API for high-volume or specialized setups.
- **๐ ๏ธ Dual-mode CLI & MCP:** Use directly in your terminal as a CLI or seamlessly integrate with LLM agents (Claude Desktop, Cursor, Antigravity, etc.).
---
## ๐ ๏ธ Installation
Managed with modern Python packaging via [uv](https://docs.astral.sh/uv/):
```bash
git clone https://github.com/tobbaz/runeberg-mcp.git
cd runeberg-mcp
uv sync
```
---
## ๐ค MCP Server Configuration
To connect this MCP server to your AI assistant, add it to your client's configuration file.
### 1. Claude Desktop (`claude_desktop_config.json`)
On macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
On Windows: `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"runeberg": {
"command": "uv",
"args": [
"--directory",
"/path/to/runeberg-mcp",
"run",
"runeberg-mcp",
"serve"
]
}
}
}
```
### 2. Cursor / Antigravity / Other MCP Clients
Configure as a `stdio` MCP server with:
* **Command:** `uv`
* **Args:** `["--directory", "/path/to/runeberg-mcp", "run", "runeberg-mcp", "serve"]`
---
## ๐ง Search Engine Options
### Default: Zero-Config (No API keys needed)
By default, searches against `site:runeberg.org` run via multi-engine fallback (`ddgs`), requiring **no API keys or signups**.
### Optional: Google Custom Search JSON API
If you prefer to query Google's official Custom Search API:
1. Create an API key in the [Google Cloud Console](https://console.cloud.google.com/).
2. Create a [Programmable Search Engine](https://programmablesearchengine.google.com/) configured to search `runeberg.org/*`.
3. Set the environment variables in your client configuration:
```json
{
"mcpServers": {
"runeberg": {
"command": "uv",
"args": ["--directory", "/path/to/runeberg-mcp", "run", "runeberg-mcp", "serve"],
"env": {
"GOOGLE_API_KEY": "your-google-api-key",
"GOOGLE_CSE_ID": "your-custom-search-engine-id"
}
}
}
}
```
---
## ๐ป CLI Usage
You can test and use the tool directly in your terminal:
### Search for books or phrases:
```bash
uv run runeberg-mcp search "Dรถdsdansen"
uv run runeberg-mcp search "Abraham Brodersson"
```
### Read a specific page:
```bash
# By work slug and page number:
uv run runeberg-mcp read dasakungen 5
# Or by full URL:
uv run runeberg-mcp read https://runeberg.org/strindbg/dodsdans/0057.html
```
### View work metadata and chapters:
```bash
uv run runeberg-mcp info dasakungen
uv run runeberg-mcp info sbh
```
---
## ๐งช Testing
Run the test suite to verify search, retrieval, and text parsing:
```bash
uv run python test_server.py
```
---
## ๐ License
Distributed under the [MIT License](LICENSE). Digital works hosted on Projekt Runeberg are public domain cultural heritage.
TDQS
A4.2/5.0
Scored across 3 tools
Disambiguation5/5
Each tool serves a distinct purpose: search for discovery, read_page for content access, and get_work_info for metadata. No overlap in functionality or ambiguous boundaries.
Naming Consistency5/5
All tool names follow the same pattern: 'runeberg_' prefix with verb_noun structure (search, read_page, get_work_info). Consistent use of snake_case and clear verbs.
Tool Count4/5
With only 3 tools, the set is minimal but appropriate for a focused read-only library access server. It covers search, retrieval, and metadata without excess.
Completeness4/5
The tools cover the core lifecycle: discover (search), access (read_page), and understand context (get_work_info). Minor gaps exist, such as lack of a browse/list tool, but search effectively covers discovery.
Maintenance
ActivityMaintained
ResponsivenessNo issues