Eth Library Mcp

io.github.malkreide由 GitHub 账号 malkreide 发布v0.4.0更新于 Oct 24, 2026

ETH Library Discovery API

概览

AI 生成的概览

本地 MCP 服务器,让助手通过 Discovery API 检索苏黎世 ETH 图书馆 3000 万以上的图书、地图、图像和档案资料。

可以做什么
以字段、运算符和分面语法对目录做全文检索,并按图书、地图、图像等资源类型筛选。按 MMS-ID 获取单条资源的完整元数据。在指定档案内检索,例如大学档案馆、Max Frisch、Thomas Mann、版画收藏和图像档案馆。运行面向教育学与学校历史的精选教育检索。查看可用资源类型与档案馆的服务器概览,并使用内置的研究与教育研究提示词。
适用场景
当需要让助手研究苏黎世 ETH 图书馆收藏的瑞士自然科学、教育或档案资料(包括具名的文学与机构档案馆)时适用,无需离开对话。
运行要求
以 Python 包形式本地运行(需 Python 3.11+),可通过 uvx 或 pip 安装。需要 ETH 图书馆开发者门户提供的免费 API 密钥,通过环境变量 ETH_LIBRARY_API_KEY 提供。可选变量用于设置日志级别、CORS 来源和 HTTP 模式下的允许主机。需要访问 ETH 图书馆 API 的网络连接。
安装前请注意
ETH_LIBRARY_API_KEY 中的 API 密钥属于凭据;README 称其不会被记录日志或发送给第三方。所有工具均为只读 GET 请求,不会修改数据。上游按密钥实施速率限制。可选的 HTTP 模式没有内置认证、限流或 TLS,未经反向代理不要绑定到公开接口。社区项目,与苏黎世 ETH 无隶属关系。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Eth Library Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

🇨🇭 Part of the Swiss Public Data MCP Portfolio

🏛️ eth-library-mcp

[Version] [License: MIT] [Python 3.11+] [MCP] [Data Source] [CI]

🌐 English | Deutsch

MCP server giving AI models direct access to 30M+ resources at ETH Library Zurich – books, maps, images and archival material.

Demo

[Demo: Claude using eth_search_archive to find historical school documents]


Overview

eth-library-mcp connects AI assistants like Claude to the largest natural-science library in Switzerland. It exposes full-text search, archive-level queries and resource-type filtering via the ETH Library's Discovery API – all through a single, standardised MCP interface.

6 Tools · 1 API · 2 Resources · 2 Prompts

MCP Protocol Version: 2026-07-28 (via mcp[cli]>=2.0.0,<3).

BUG-02 is resolved — by removing the tool. eth_search_persons was documented as "currently non-functional, correct URL to be verified". It has now been verified, and there is no correct URL: the Persons API is gone from the gateway, not merely locked. The gateway routes before it checks the API key, so an existing route answers 401 and a missing one answers 404 — /discovery/v1/resources gives 401, every /persons/v1/* path gives 404, and so does a deliberately invented Discovery path used as a control. Offering a capability that cannot exist is the same mistake as returning an empty result, only louder. The measurement is recorded and dated in tests/fixtures/api_routes.json.

Anchor demo query: "Find historical documents about Zurich school history in the ETH Library archives."


Features

  • 🔍 Full-text search over 30M+ resources with fields, operators, and facets
  • 📖 Resource details – full metadata via MMS-ID
  • 🗂️ Archive search – ETH University Archives, Max Frisch, Thomas Mann, Graphische Sammlung, Bildarchiv
  • 🏷️ Resource type filter – books, maps, images, archival material and more
  • 🎓 Education search – curated workflow optimised for pedagogy and school history
  • 📋 Server overview – all resource types and archives at a glance
  • 🗣️ Built-in prompts – structured research and education-research workflows
  • ☁️ Dual transport – stdio for Claude Desktop, Streamable HTTP/SSE for cloud deployment

Prerequisites


Installation

bash
# Clone the repositorygit clone https://github.com/malkreide/eth-library-mcp.gitcd eth-library-mcp
# Installpip install -e .
# Or with uv (recommended)uv pip install -e .

Quickstart

bash
# Set the API keyexport ETH_LIBRARY_API_KEY=your_key_here   # macOS / Linux# $env:ETH_LIBRARY_API_KEY = "your_key_here"  # Windows (PowerShell)
# Start the server (stdio mode for Claude Desktop)python -m eth_library_mcp.server

Without an API key the server returns a helpful error message with the registration link – no crashes.

Try it immediately in Claude Desktop:

"Find books about Swiss education history in the ETH Library." "Search the Max Frisch archive for manuscripts about Zurich."

→ More use cases by audience →


Configuration

Environment Variables

VariableDescriptionRequired
ETH_LIBRARY_API_KEYAPI key for the Discovery API✅
ETH_LIBRARY_LOG_LEVELLog level (DEBUG/INFO/WARNING/ERROR), default INFO—
ETH_LIBRARY_CORS_ORIGINSComma-separated CORS allow-origins for --http. Empty by default: no browser client is permitted. * allows any origin and is logged as a warning. Does not affect stdio clients.—
ETH_LIBRARY_ALLOWED_HOSTSComma-separated hostnames this server is reachable under. Required for a non-loopback bind (--host 0.0.0.0): the process cannot derive its own public name, and without this the SDK answers 421 Invalid Host header to every request. Empty by default; loopback stays reachable either way.—

Claude Desktop Configuration

json
{  "mcpServers": {    "eth-library": {      "command": "python",      "args": ["-m", "eth_library_mcp.server"],      "env": {        "ETH_LIBRARY_API_KEY": "your_key_here"      }    }  }}

Config file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Cloud Deployment (SSE for browser access)

For use via claude.ai in the browser (e.g. on managed workstations without local software):

bash
python -m eth_library_mcp.server --http --port 8000

The HTTP transport binds to 127.0.0.1 by default. To expose it on another interface, pass --host explicitly:

bash
# Only behind a reverse-proxy / firewall that terminates TLS and enforces auth.python -m eth_library_mcp.server --http --host 0.0.0.0 --port 8000

⚠️ Do not bind to 0.0.0.0 without a reverse proxy. The server has no built-in auth, rate-limiting or TLS — any LAN neighbour could call your tools.

💡 "stdio for the developer laptop, HTTP for the browser — behind a proxy."


Available Tools

Discovery API (api.library.ethz.ch)

ToolDescription
eth_search_resourcesFull-text search over 30M+ resources with fields, operators, facets
eth_get_resourceFull metadata for a specific resource via MMS-ID
eth_search_archiveSearch within a specific archive (University Archives, Max Frisch, Thomas Mann, etc.)
eth_search_by_typeFilter by resource type (books, maps, images, archival material, etc.)
eth_search_educationCurated search for education topics (pedagogy, school history, etc.)

Utilities

ToolDescription
eth_library_infoServer overview: all types and archives at a glance

Resources & Prompts

ItemTypeDescription
eth://resource-typesResourceAll available resource types
eth://archivesResourceAll available archives and collections
research-workflowPromptStructured research workflow
education-researchPromptEducation topics workflow (Schulamt-optimised)

Query Syntax

The Discovery API uses structured queries:

field,operator,value
FieldMeaning
anyAll fields (recommended for starters)
titleTitle only
creatorAuthor / creator
subSubject headings / topics
OperatorMeaning
containsTerm is present
exactExact match
begins_withStarts with

Examples:

any,contains,Volksschule Zürichtitle,contains,Pädagogikcreator,exact,Einstein Albertsub,contains,Bildungsforschungtitle,contains,Schule;sub,contains,Geschichte

Available Archives

IdentifierDescription
ETH_HochschularchivInstitutional memory of ETH Zurich
ETH_MaxFrischArchivEstate of Swiss author Max Frisch
ETH_ThomasMannArchivLetters and documents of Thomas Mann
ETH_GraphischeSammlungPrints, drawings, graphic works
ETH_BildarchivScience/technology history, Swissair (E-Pics)

Example Use Cases

QueryTool
"Find books about Zurich school history"eth_search_education
"What's in the Max Frisch archive?"eth_search_archive
"Find historical maps of Switzerland"eth_search_by_type
"Get full metadata for resource ID 991170525863705501"eth_get_resource
"Which archives does the ETH Library hold?"eth_library_info

Project Structure

eth-library-mcp/├── src/│   └── eth_library_mcp/│       ├── __init__.py        # Package init, version│       └── server.py          # FastMCP server, all tools├── tests/│   └── test_server.py         # Unit tests├── CHANGELOG.md├── CONTRIBUTING.md             # Contribution guide (English)├── CONTRIBUTING.de.md          # Contribution guide (German)├── SECURITY.md                 # Security posture (English)├── SECURITY.de.md              # Security posture (German)├── LICENSE├── README.md                  # This file (English)├── README.de.md               # German version├── claude_desktop_config.json # Example Claude Desktop configuration└── pyproject.toml             # Build configuration

MCP Protocol Version

This server speaks two protocol eras over the same endpoint. The client's first request on a connection decides which one applies; a later claim from the other era is refused.

EraRevisionWho reaches it
initialize handshake2024-11-05 … 2025-11-25What today's clients speak. The server answers with the revision asked for, or with the 2025-11-25 ceiling when the request asks for something newer.
Per-request envelope2026-07-28A request carrying the 2026-07-28 _meta envelope opens a modern connection.

Both revisions are pinned in tests/test_protocol_version.py and asserted against the installed SDK, so a Dependabot bump of mcp cannot move either one silently. The handshake ceiling is measured against a live initialize through the assembled ASGI stack, not read off a constant name.

Note that the SDK's LATEST_PROTOCOL_VERSION is an alias for the modern era, not for the handshake era — pinning against it alone would leave the era that current clients actually negotiate free to drift.

Update policy. When the gate fails, do not edit the constant blindly: read the spec changelog between the two revisions, verify the server still behaves, then move the constant, this section, README.de.md and CHANGELOG.md together.

Server identity (serverInfo)

2026-07-28 stamps the server's Implementation block into every modern result under _meta.io.modelcontextprotocol/serverInfo (spec #3002) — earlier revisions carried it only in the initialize result. What used to be a one-time field is now repeated on every call, and version is required.

The SDK fills none of it: "An unversioned server reports an empty version; the SDK never substitutes its own." Measured against the assembled ASGI stack, this server used to answer "version": "" in both eras while server.json told the registry 0.3.4. It now declares:

FieldValueSource
nameeth-library-mcpthe programmatic identifier — the same string as the distribution name in pyproject.toml, packages[0].identifier in server.json and the suffix of the registry name io.github.malkreide/eth-library-mcp. It used to read eth_library_mcp, the module path: a name under which this server is available nowhere.
titleETH-Bibliothek ZürichSERVER_TITLE in server.py — the only value with no source outside
versionthe installed distribution's versionimportlib.metadata, so it cannot drift from pyproject.toml
descriptionthe distribution summaryimportlib.metadata
websiteUrlthe Homepage project URLimportlib.metadata

icons stays unset: this repository ships none, and an invented path would assert a file that does not exist.

Measured, not read back, in tests/test_server_identity.py: the assertions drive a real modern POST through build_http_app(). A look at mcp.version would stay green even if the constructor argument were lost or the SDK stopped stamping at all.


Testing

bash
# Unit tests (no API key required)PYTHONPATH=src pytest tests/ -m "not live"
# Integration tests (API key required)# Live checks against the gateway — these need NO API keyPYTHONPATH=src pytest tests/ -m "live"
# Re-record the route census (writes tests/fixtures/PROVENANCE.md)python scripts/record_fixtures.py

Until 2026-08-08 this repository had no live tests at all — pytest -m live collected zero. Nothing in it had ever been held against the source.

The Discovery payloads still cannot be recorded: the API requires a key, and tests/fixtures/PROVENANCE.md lists them explicitly as NOT RECORDED rather than giving them a date they never had. What is recordable is the contract the source gives up without a key — which routes the gateway serves — and that is exactly what the finding hangs on. The two control_* entries are part of the measurement, not decoration: without them the recording only proves that someone got a 404; with them it proves what the gateway distinguishes.

The two live tests need no key and say something anyway: they report if the Persons API comes back (then the tool should return) or if Discovery loses its route (then five tools are affected).


Safety & Limits

  • Read-only: All tools perform HTTP GET requests only — no data is written, modified, or deleted.
  • No personal data: The APIs return bibliographic metadata (titles, authors, subjects, identifiers). No personally identifiable information (PII) is processed or stored by this server.
  • Authentication: A free API key from developer.library.ethz.ch is required. The key is read from the ETH_LIBRARY_API_KEY environment variable and never logged or transmitted to third parties.
  • Rate limits: The ETH Library API enforces rate limits per API key. The server enforces a 30-second timeout per request. Use limit and offset parameters conservatively.
  • Data freshness: Results reflect the ETH Library catalogue at query time. No caching is performed by this server.
  • Terms of service: Bibliographic metadata is published as Public Domain — free for all uses. API access is subject to the ETH Library Developer Portal terms.
  • No guarantees: This is a community project, not affiliated with the ETH Library or ETH Zurich. Availability depends on upstream APIs.

Contributing

Contributions are welcome! See CONTRIBUTING.md (Deutsch) for guidelines.


Security

Read-only, no PII, a single upstream API key, and a fixed egress allow-list of ETH Library endpoints. See SECURITY.md (Deutsch) for the full security posture and accepted-risk decisions.


Changelog

See CHANGELOG.md


License


Author

Hayal Oezkan · github.com/malkreide


Powered by Model Context Protocol • 1 API • 6 Tools • 2 Resources • 2 Prompts

Installation

Run via uv's uvx — no clone or manual install needed. Add to your MCP client config (mcpServers for Claude Desktop, Cursor and Windsurf; use a top-level servers key for VS Code in .vscode/mcp.json):

json
{  "mcpServers": {    "eth-library-mcp": {      "command": "uvx",      "args": [        "eth-library-mcp"      ]    }  }}

来源:README.md,提交 d0328f1

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.4.0最新Sep 19, 2026
  2. v0.3.4Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分