Skip to main content
Glama
tobbaz

runeberg-mcp

by tobbaz

Runeberg MCP 📖

License: MIT Python 3.10+ MCP

A Model Context Protocol (MCP) server and CLI tool for researching historical people, noble families, and places across digitized Nordic literature, encyclopedias, and archives on Projekt Runeberg.

Project Runeberg has been publishing free electronic editions of classic Nordic literature out of copyright since 1992. It is a treasure trove for genealogy and local history, containing monumental works like:

  • karlxiioff: Karl XII:s officerare. Biografiska anteckningar (Adam Lewenhaupt)

  • sbh: Svenskt biografiskt handlexikon (Hofberg et al.)

  • anrep / elgenst: Svenska adelns ättar-taflor (Gabriel Anrep / Gustaf Elgenstierna)

  • rosenberg: Geografiskt-statistiskt handlexikon öfver Sverige (C.M. Rosenberg – all Swedish villages, farms, and parishes)

  • hgsl: Historiskt-geografiskt och statistiskt lexikon öfver Sverige

  • nf: Nordisk familjebok (all editions)


✨ Features

  • 🔎 Smart Global Search (runeberg_search): Full-text search across all digitized works with automatic historical spelling expansion and support for caller/LLM-provided spelling variants (variants).

  • 🎯 In-Work Lemma Bisection & Fuzzy Search (runeberg_search_in_work): Instantly locates candidate pages in alphabetical encyclopedias (e.g. searching for Hilpershausen finds Hilperhaussen on page 297 of Karl XII:s officerare with 92% similarity).

  • 📄 Page Reader with Context Window (runeberg_read_page): Extracts clean OCR/proofread text with links to original facsimile images. Supports context_pages to read across page breaks seamlessly.

  • 📚 Work & Chapter Inspector (runeberg_get_work_info): Retrieves metadata, publication details, and full chapter/lemma index.

  • ⚡ Zero-Config by Default: Built-in multi-engine search (ddgs) requiring no API keys or setup.

  • 🚀 Optional Google Custom Search API: Set GOOGLE_API_KEY and GOOGLE_CSE_ID to use Google's official API.


Related MCP server: DHLAB MCP Server

🛠️ Installation

Managed with modern Python packaging via uv:

git clone https://github.com/tobbaz/runeberg-mcp.git
cd runeberg-mcp
uv sync

🤖 MCP Server Configuration

Add to your MCP client configuration (claude_desktop_config.json, Cursor, Antigravity, etc.):

{
  "mcpServers": {
    "runeberg": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/runeberg-mcp",
        "run",
        "runeberg-mcp",
        "serve"
      ]
    }
  }
}

💻 CLI Usage

Test and research directly in your terminal:

1. Global Search (with automatic historical variants):

# Finds hits across all of Runeberg, automatically testing historical spelling shifts
uv run runeberg-mcp search "Hilpershausen"

# Or provide your own historical variants:
uv run runeberg-mcp search "Hilpershausen" -v "Hilperhaussen" -v "Hilpershusen"
# Search within Karl XII:s officerare:
uv run runeberg-mcp in-work karlxiioff "Hilpershausen"

# Search within Svenskt biografiskt handlexikon:
uv run runeberg-mcp in-work sbh "Bellman"

# Search for a farm or village in Rosenberg:
uv run runeberg-mcp in-work rosenberg "Långtora"

3. Read Page (with optional context window):

# Read a single page:
uv run runeberg-mcp read dasakungen 5

# Read a page and the subsequent page across page breaks:
uv run runeberg-mcp read https://runeberg.org/karlxiioff/0311.html -c 1

4. Inspect Work:

uv run runeberg-mcp info karlxiioff

🧪 Running Tests

Run the test suite:

uv run python test_server.py

📜 License

Distributed under the MIT License. Digital works hosted on Projekt Runeberg are public domain cultural heritage.

Available Tools

3 tools
runeberg_get_work_infoA

Get metadata, publication details, and table of contents/chapter list for a work in Project Runeberg.

Args:
    work_slug: The work identifier (e.g. 'dasakungen', 'sbh', 'nfda', 'salmonsen').
ParametersJSON Schema
NameRequiredDescriptionDefault
work_slugYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the behavioral burden. It clearly communicates a read-only 'get' operation and what the result will contain. It does not disclose potential error behavior or rate limits, but for a simple retrieval tool this is not a major gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences plus a parameter block with no filler. The purpose is front-loaded and the parameter explanation is immediately actionable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With only one required parameter and an output schema present, the description is nearly complete. The only missing context is a brief nod to the sibling tools or how to obtain a valid work_slug, but that is a minor omission for this low-complexity tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but the description fully compensates by explaining work_slug as 'The work identifier' and giving four concrete examples. This tells the agent exactly what value to supply and what form it takes.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb ('Get'), a concrete resource ('a work in Project Runeberg'), and the exact information returned (metadata, publication details, table of contents/chapter list). This makes it easy to distinguish from the sibling tools runeberg_search and runeberg_read_page.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The use case is implied: after you already have a work_slug, this tool fetches overview information. However, the description does not explicitly contrast this with searching for works or reading pages, so the agent must infer when to select this tool over its siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

runeberg_read_pageA

Read the cleaned, transcribed/OCR text of a specific book page from Project Runeberg.

Args:
    url_or_slug: Full page URL (e.g. 'https://runeberg.org/pvmhall/0105.html') or work slug (e.g. 'pvmhall').
    page: Optional page number if slug was provided (e.g. '0105' or 105).
ParametersJSON Schema
NameRequiredDescriptionDefault
pageNo
url_or_slugYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It discloses that this is a read operation returning cleaned/OCR text and that the page parameter only applies when a slug is used. However, it does not state what happens when a slug is provided without a page, how invalid inputs are handled, or whether any normalization occurs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: the purpose appears in the first sentence, followed by a clean Args section. Every sentence adds necessary information and there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return-value details do not need to be in the description. The two parameters are thoroughly documented and the read behavior is clear. The main gaps are the lack of explicit sibling differentiation and the unspecified default behavior when page is omitted, but overall this is nearly complete for a simple read tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description is the only documentation for the parameters. It fully explains url_or_slug with a concrete URL and slug example, and page with both string and numeric examples, while also clarifying the conditional relationship between the two parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Read') and the resource ('cleaned, transcribed/OCR text of a specific book page from Project Runeberg'). This distinguishes it from the sibling tools runeberg_search and runeberg_get_work_info, which serve clearly different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description makes the use case clear: retrieve page text when you have a full page URL or a work slug plus optional page number. It does not explicitly mention alternatives or exclusions, but the context is strong enough for an agent to infer when this tool applies.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.1.0
    • First observedruneberg_get_work_info
    • First observedruneberg_read_page
    • First observedruneberg_search

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

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Enables users to search and access digital collections from the Swedish National Archives (Riksarkivet) through multiple APIs. Supports searching records by keywords, exploring collections, and downloading historical images and documents.
    2
    24
    Apache 2.0
  • A
    license
    B
    quality
    D
    maintenance
    Provides access to the National Library of Norway's Digital Humanities Lab, enabling text and image search, NGram analysis, word lookup, concordance finding, and corpus statistics from Norwegian digital collections.
    9
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI agents to search and retrieve consolidated Swedish statutes (SFS) from the Riksdagen open data API, with verifiable citations and persistent identifiers.
    4
    59 PyPI
    Apache 2.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables search and reading of Project Gutenberg books with tools for searching by title/author/subject and fetching word-range slices of book text.
    MIT