library-of-babel-mcp

library-of-babel-mcp

An MCP server that provides access to the Library of Babel, allowing users to retrieve exact page contents by address, search for text to find its location, and generate random pages.

Category
访问服务器

README

Library of Babel MCP Server

An MCP (Model Context Protocol) server granting access to the Library of Babel, the largest knowledge base in the known universe.

How it works

  • Alphabet: 29 symbols — a-z, comma, space, period.
  • Page length: 3200 characters (40 lines x 80 chars).
  • Address: hexagon (base-36 string, ~3004 digits), wall (1-4), shelf (1-5), volume (1-32), page (1-410) — 262,400 pages per hexagon.
  • Library size: 29^3200 pages, a 4680-digit number.

The library is a bijection between addresses and page contents, following the structure libraryofbabel.info uses. There is no PRNG and no special-cased slot: every address maps to exactly one page, every possible page maps back to exactly one address, and the mapping inverts in both directions.

  1. Flatten the address into a single integer index.
  2. Scramble it: content = (index * MULTIPLIER) mod N, where N = 29^3200.
  3. Write content out as 3200 base-29 digits — that's the page text.

MULTIPLIER is coprime to N, so step 2 is a permutation of the entire space and its inverse is another multiplication by MULTIPLIER⁻¹ mod N (computed by Hensel lifting, since N is a prime power). So searching means: build the exact page you want — your text plus padding — read it as a base-29 number, multiply by the inverse, and unpack the index into coordinates. The page really is at that address. Nothing is stored; nothing is scanned.

Because padding and offset are part of the page, changing either gives you a genuinely different page at a different address.

Fidelity to libraryofbabel.info

The structure and observable behaviour match the real site. The particular permutation does not: libraryofbabel.info's own constants are deliberately unpublished — the author's reference repo documents the method (an invertible LCG plus xorshift scrambling) but withholds its m, a, and c. Addresses produced here are therefore not portable to that site, and vice versa.

Tools

  • get_page(hexagon, wall, shelf, volume, page) — read the text at an address.
  • search_text(text, padding, offset) — find the address of a page containing your text. padding is "spaces" (default) or "random"; offset is a character position or "random". Max 3200 chars; input is lowercased and restricted to the library's alphabet.
  • lookup_page(text) — the exact inverse of get_page: give it a full 3200-character page, get back its address.
  • random_page() — jump to a uniformly random address.

Configuration

  • LOB_API_KEY — leave empty for provisional guest access, until you have located the volume containing your API key.

Build

npm install
npm run build

Run standalone (for testing)

npx library-of-babel-mcp
# or, from a checkout:
node dist/index.js

It speaks MCP over stdio, so it expects a client on the other end — it will just sit there logging "Library of Babel MCP server running on stdio" to stderr, which is normal.

Add to Claude Desktop / Claude Code

Add to your MCP config (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "library-of-babel": {
      "command": "npx",
      "args": ["-y", "library-of-babel-mcp"]
    }
  }
}

Or, in Claude Code:

claude mcp add library-of-babel -- npx -y library-of-babel-mcp

To run from a local checkout instead, point at the built entrypoint:

{
  "mcpServers": {
    "library-of-babel": {
      "command": "node",
      "args": ["/absolute/path/to/library-of-babel-mcp/dist/index.js"]
    }
  }
}

Then restart the client. You should see the four tools listed above.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选