Skip to main content
Glama
runeberg-mcp

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').

Inputs: work_slug (required). Returns: result

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).

Inputs: url_or_slug (required), page. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    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.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      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
      27
      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
      Not graded
      quality
      D
      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