Skip to main content
Glama

digibib5-mcp

A clone-in-progress of the Digitale Bibliothek 5 reader (Directmedia / Digitale Bibliothek), built on a from-scratch reverse-engineering of its .DKI volume format. It reads the original CD-ROM images - volume list, table of contents, and decoded text - and exposes them over MCP and REST, with a reader webapp.

The .DKI format was reversed from the real discs (see reversing-mcp docs/DIGIBIB5_DKI_FORMAT.md). Two format generations are supported: older single-table volumes (DB008) and newer ones (DB074, DB006) with magic-prefixed TEXT.DKI, direct TREE.DKA mapping, high-bit word lengths and .xml source markers. Digibib5 itself is the oracle: run it alongside to compare rendered output.

Why Digitale Bibliothek matters

Directmedia's Digitale Bibliothek series is an extraordinary, largely forgotten scholarly resource — especially for Germanistik students, researchers, and anyone who wants fast offline access to the German literary and philosophical canon (Killy Literaturlexikon, Wilpert, Deutsche Literatur von Luther bis Tucholsky, Deutsche Literatur im Mittelalter, Goethe, Lessing, Heine, Hoffmann, Kant, Nietzsche, Adorno) alongside wonderful curiosities like Merkwürdige Literatur (DB111) and Das digitale Handbuch des nutzlosen Wissens (DBSO06). Volumes such as English and American Literature from Shakespeare to Mark Twain (DB059) and Shakespeare: Complete Works (DB061) are icing on the cake.

digibib5-mcp brings these classic CD-ROMs back to life for modern readers and the (planned) mediacraft ecosystem.

Related MCP server: mcp-hathitrust

Documentation

Doc

What

INSTALL.md

setup, MCP config

docs/ONBOARDING.md

first-timer guide: discs, costs (none), sanity check

docs/CONFIGURATION.md

env vars, ports, per-volume file layout

docs/TOOLS.md

MCP ops, REST endpoints, Python library

docs/DEVELOPMENT.md

repo layout, gates, codec map, release

docs/PRD.md

product requirements, scope, status

docs/MEDIACRAFT.md

preliminary notes on the planned mediacraft integration

docs/TROUBLESHOOTING.md

symptoms and fixes

Status

Early. What works today:

  • Volume discovery - scans the install root and lists every CD-ROM image.

  • Descriptor - reads DIGIBIB.TXT identity (title etc.).

  • TOC - parses TREE.DKI (indented-text tree) into a nested table of contents.

  • Text decode - decodes TEXT.DKI records (tokenized word-stream codec, v2: flowing paragraphs, heads dropped, de-hyphenated).

  • Search - FTS5 sidecar over decoded text with chapter snippets (search op, REST /api/.../search, reader search box).

  • Figures - IMAGES\ BMP scans served over REST with per-chapter figure strips in the reader (images op, /api/.../images, /api/.../image/...).

  • REST API + reader webapp - a Starlette backend serves the library as JSON, and a React/Vite/Tailwind reader renders the volume picker, TOC tree, and text.

Known v1 / approximate (tracked, to refine against the Digibib5 oracle):

  • The text codec's exact control-opcode grammar (heading levels, italics, links). Paragraph structure, running-head removal, de-hyphenation, spaced dashes, literal spans and reflowed line breaks are mapped (v2); output is flowing text but not yet byte-faithful.

  • Images (IMAGES\*.BMP / images.lib) and the search indexes (INDEX.* / LINKS.*) are not wired up yet.

Solved 2026-10-26: the TREE.DKA node -> record mapping. The table is a 1-based start-record run for every node but the volume root (root starts at record 0), located by monotonic-run scan. Clicking a TOC entry now renders the whole chapter (all records until the next non-descendant node, capped at 100); node_text reports record / record_end / records_total / truncated.

Format, in brief

A volume is a data\ folder:

File

Role

DIGIBIB.TXT

INI descriptor (identity shown in the CD picker)

TREE.DKI

TOC as indented CP1252 text (leading spaces = depth)

TREE.DKA

u32 node -> record table (1-based run for all nodes but the root; see CONFIGURATION)

TEXT.DKI

[u32 count][u32 offset table][records]; each record length-prefixed, content is a tokenized word stream

INDEX.*, LINKS.*

search / cross-reference indexes (later)

IMAGES\1..4\*.BMP

page images at 4 zoom levels (later)

MCP tool

One portmanteau, digibib:

digibib(operation="list_volumes")
digibib(operation="descriptor", volume_id="DB008")
digibib(operation="toc", volume_id="DB008", max_depth=3)
digibib(operation="node_text", volume_id="DB008", node_index=5)
digibib(operation="record_text", volume_id="DB008", record_index=0)
digibib(operation="search", volume_id="DB008", query="Nathanael", limit=10)
digibib(operation="images", volume_id="DB008", level=1)

node_text returns the node's full chapter extent (record..record_end, records_total, truncated when capped at 100 records) plus images (figure names referenced by the chapter) and image_levels; record_text reads one raw TEXT.DKI record; search returns FTS5 hits with the containing chapter and a «»-marked snippet per hit.

The install root defaults to K:\Digitale Bibliothek\Bibliothek (override with the DIGIBIB_ROOT env var or the root argument).

Library

from digibib5_mcp.dki import DigibibLibrary

lib = DigibibLibrary()
for ref in lib.list_volumes():
    print(ref.id, ref.title)

vol = lib.open("DB008")
print(vol.title)  # Digitale Bibliothek Band 8: Hoffmann
for root in vol.toc_tree():
    print(root.title)  # Hoffmann -> ...
print(vol.record_text(0))  # decoded record text

Run

uv run digibib5-mcp              # stdio MCP server
just api                         # REST backend only (Starlette on 14115)
just webapp                      # backend + Vite reader on http://127.0.0.1:14114

just webapp runs web_sota/start.ps1: it starts the backend, bun installs the frontend on first run, then launches the Vite dev server. The frontend proxies /api to the backend.

Reader webapp

web_sota/ - React 18 + Vite 6 + Tailwind 4 + react-router + Zustand (Bun). AppLayout shell (sidebar, topbar, health dot) with routed pages: Dashboard (library KPIs + onboarding), Reader (volume picker, TOC tree, content pane, search, figures), Tools (live op harness), Chat (local/cloud LLM, resident-first), Settings (backend + AI), Logs, Help. Ports: 14114 (frontend) / 14115 (backend REST).

Packaging

Fleet-standard: justfile (run / lint / test / release recipes), mcpb.json + manifest.json for MCPB bundling (just pack), and scripts/release.ps1 for the triple-play release (mcpb + NSIS installer + GitHub release).

Stack

Python 3.12+, FastMCP 3.2+, Pydantic v2, Starlette, uv. Frontend: React 18, Vite 6, Tailwind 4, Bun.

For reading Digitale Bibliothek volumes you own. Intended for interoperability, preservation, and access on modern systems.

Interoperability note (not legal advice). This project contains no copy-protection circumvention and redistributes no content from the discs: no texts, no images, no audio, no keys - only code that reads CD-ROMs you own. The .DKI container is an undocumented but unprotected format; nothing here defeats an effective technical protection measure. Reverse-engineering a file format to make lawfully acquired data usable on current systems is the interoperability case the EU Software Directive (Art. 6) expressly permits. "Digitale Bibliothek" is named only to describe compatibility. If you are unsure in your jurisdiction, ask a lawyer before redistributing anything beyond the code.

Available Tools

1 tool
digibibA

DIGIBIB - read Digitale Bibliothek 5 volumes.

Operations:

  • list_volumes -> every installed CD-ROM volume: {id, title}.

  • stats -> library root, root_exists, volume count, indexed volume count, and FTS index size.

  • descriptor -> the volume's DIGIBIB.TXT identity keys.

  • toc -> the table of contents as a nested tree (node index + record index per node). Use max_depth to trim.

  • node_text -> decoded text for a TOC node: the full chapter extent (record..record_end, records_total, truncated flag).

  • record_text -> decoded text for a raw TEXT.DKI record index.

  • search -> full-text search over decoded text (needs query; omit volume_id to search all already-indexed volumes): [{record, node_index, chapter, snippet}]. First search per volume builds an FTS cache (~10 s), then instant.

  • images -> figures at a zoom level (needs level or takes the highest): {levels, level, images: [{name, width, height, bpp, bytes, url}]}. Binary via the REST image endpoint (see url per figure).

NOTE: text decode is v2 (flowing paragraphs, heads dropped); output is readable but not yet byte-faithful.

Inputs: root, level, limit, query, +5 more. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 1 tool

    Disambiguation4/5

    The eight operations exposed by the single `digibib` tool target clearly separate concerns: volume listing, library stats, identity descriptors, TOC tree, chapter text, raw record text, full-text search, and figures. The only pair with real overlap is `node_text` vs `record_text`, but the descriptions clarify chapter-extent versus raw-record semantics. An agent should be able to select the right operation without much risk.

    Naming Consistency4/5

    All operations use consistent snake_case (list_volumes, node_text, record_text, toc, stats, descriptor, search, images). The style is mixed between verb_noun (`list_volumes`) and bare nouns (`toc`, `stats`, `search`), but the pattern is predictable and readable. Minor deviation only.

    Tool Count3/5

    Everything is collapsed into a single multiplexed tool, so the exposed tool count (1) is thin by the rubric's standards even though eight operations are documented inside it. The operation surface itself is well-scoped for a read-only digital library. A thin wrapper with a mode/operation parameter is borderline but workable.

    Completeness4/5

    The surface covers the full read lifecycle for a CD-ROM library: discover volumes, inspect metadata/stats, navigate TOC, read chapter or raw record text, full-text search across indexed volumes, and fetch figures. Since the domain is inherently read-only, there is no missing write/CRUD path. Minor gaps exist around search result limits/pagination and image retrieval beyond URL handoff.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      This MCP server enables AI agents to search and retrieve exact, cited passages from a large corpus of public-domain books, including full-text search, book metadata, chapters, quotes, and 'ask book' Q&A. Payments are handled via x402 micropayments on Base.
      8
      73 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      This read-only MCP server gives agents semantic search over an OpenViking knowledge base, plus tools to read a document's full text by URI and browse directories with their generated abstracts. It exposes no write operations, so lookups are all an agent can do.
      3
      19 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      This server allows Large Language Models to consume S1000D data and publication modules as structured information instead of raw XML. It enables reading the content's hierarchy, applicability to specific products, and document verification status.
      6
      1,387 npm
      MIT