Open Library MCP Server

平台与服务

by 8enSmith

让 AI 助手通过 Open Library 检索图书与作者信息,并以结构化 JSON 返回书名、作者详情和封面等数据。

什么是 Open Library MCP Server

让 AI 助手通过 Open Library 检索图书与作者信息,并以结构化 JSON 返回书名、作者详情和封面等数据。

核心功能 (6 个工具)

get_book_by_title

Search for a book by its title on Open Library.

get_authors_by_name

Search for author information on Open Library.

get_author_info

Get detailed information for a specific author using their Open Library Author Key (e.g. OL23919A).

get_author_photo

Get the URL for an author's photo using their Open Library Author ID (OLID e.g. OL23919A).

get_book_cover

Get the URL for a book's cover image using a key (ISBN, OCLC, LCCN, OLID, ID) and value.

get_book_by_id

Get detailed information about a book using its identifier (ISBN, LCCN, OCLC, OLID).

README

MCP Open Library

Trust Score smithery badge

A Model Context Protocol (MCP) server for the Open Library API that enables AI assistants to search for book and author information.

<a href="https://glama.ai/mcp/servers/@8enSmith/mcp-open-library"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@8enSmith/mcp-open-library/badge" alt="mcp-open-library MCP server" /> </a>

Overview

This project implements an MCP server that provides tools for AI assistants to interact with the Open Library. It allows searching for book information by title, searching for authors by name, retrieving detailed author information using their Open Library key, and getting URLs for author photos using their Open Library ID (OLID). The server returns structured data for book and author information.

Features

  • Book Search by Title: Search for books using their title (get_book_by_title).
  • Author Search by Name: Search for authors using their name (get_authors_by_name).
  • Get Author Details: Retrieve detailed information for a specific author using their Open Library key (get_author_info).
  • Get Author Photo: Get the URL for an author's photo using their Open Library ID (OLID) (get_author_photo).
  • Get Book Cover: Get the URL for a book's cover image using various identifiers (ISBN, OCLC, LCCN, OLID, ID) (get_book_cover).
  • Get Book by ID: Retrieve detailed book information using various identifiers (ISBN, LCCN, OCLC, OLID) (get_book_by_id).

Installation

Installing via Smithery

To install MCP Open Library for Claude Desktop automatically via Smithery:

bash
npx -y @smithery/cli install @8enSmith/mcp-open-library --client claude

Manual Installation

bash
# Clone the repository
git clone https://github.com/8enSmith/mcp-open-library.git
cd mcp-open-library

# Install dependencies
npm install

# Build the project
npm run build

Usage

Running the Server

  1. Ensure you are running node v22.21.1 (it'll probably work on a newer version of node but this is what Im using for this test). If you have nvm installed run nvm use.
  2. In the mcp-open-library root directory run npm run build
  3. Next run npm run inspector. Once built, click the URL with the MCP_PROXY_AUTH_TOKEN query string parameter to open the Inspector.
  4. In the Inspector, choose 'STDIO' transport
  5. Make sure the command is set to 'build/index.js'
  6. Click the 'Connect' button in the Inspector - you'll now connect to the server
  7. Click 'Tools' in the top right menu bar
  8. Try running a tool e.g. click get_book_by_title
  9. Search for a book e.g. In the title box enter 'The Hobbit' and then click 'Run Tool'. Server will then return book details.

Using with an MCP Client

This server implements the Model Context Protocol, which means it can be used by any MCP-compatible AI assistant or client e.g. Claude Desktop. The server exposes the following tools:

  • get_book_by_title: Search for book information by title
  • get_authors_by_name: Search for author information by name
  • get_author_info: Get detailed information for a specific author using their Open Library Author Key
  • get_author_photo: Get the URL for an author's photo using their Open Library Author ID (OLID)
  • get_book_cover: Get the URL for a book's cover image using a specific identifier (ISBN, OCLC, LCCN, OLID, or ID)
  • get_book_by_id: Get detailed book information using a specific identifier (ISBN, LCCN, OCLC, or OLID)

Example get_book_by_title input:

json
{
  "title": "The Hobbit"
}

Example get_book_by_title output:

json
[
  {
    "title": "The Hobbit",
    "authors": [
      "J. R. R. Tolkien"
    ],
    "first_publish_year": 1937,
    "open_library_work_key": "/works/OL45883W",
    "edition_count": 120,
    "cover_url": "https://covers.openlibrary.org/b/id/10581294-M.jpg"
  }
]

Example get_authors_by_name input:

json
{
  "name": "J.R.R. Tolkien"
}

Example get_authors_by_name output:

json
[
  {
    "key": "OL26320A",
    "name": "J. R. R. Tolkien",
    "alternate_names": [
      "John Ronald Reuel Tolkien"
    ],
    "birth_date": "3 January 1892",
    "top_work": "The Hobbit",
    "work_count": 648
  }
]

Example get_author_info input:

json
{
  "author_key": "OL26320A"
}

Example get_author_info output:

json
{
  "name": "J. R. R. Tolkien",
  "personal_name": "John Ronald Reuel Tolkien",
  "birth_date": "3 January 1892",
  "death_date": "2 September 1973",
  "bio": "John Ronald Reuel Tolkien (1892-1973) was a major scholar of the English language, specializing in Old and Middle English. He served as the Rawlinson and Bosworth Professor of Anglo-Saxon and later the Merton Professor of English Language and Literature at Oxford University.",
  "alternate_names": ["John Ronald Reuel Tolkien"],
  "photos": [6791763],
  "key": "/authors/OL26320A",
  "remote_ids": {
    "viaf": "95218067",
    "wikidata": "Q892"
  },
  "revision": 43,
  "last_modified": {
    "type": "/type/datetime",
    "value": "2023-02-12T05:50:22.881"
  }
}

Example get_author_photo input:

json
{
  "olid": "OL26320A"
}

Example get_author_photo output:

text
https://covers.openlibrary.org/a/olid/OL26320A-L.jpg

Example get_book_cover input:

json
{
  "key": "ISBN",
  "value": "9780547928227",
  "size": "L"
}

Example get_book_cover output:

text
https://covers.openlibrary.org/b/isbn/9780547928227-L.jpg

The get_book_cover tool accepts the following parameters:

  • key: The type of identifier (one of: ISBN, OCLC, LCCN, OLID, or ID)
  • value: The value of the identifier
  • size: Optional cover size (S for small, M for medium, L for large, defaults to L)

Example get_book_by_id input:

json
{
  "idType": "isbn",
  "idValue": "9780547928227"
}

Example get_book_by_id output:

json
{
  "title": "The Hobbit",
  "authors": [
    "J. R. R. Tolkien"
  ],
  "publishers": [
    "Houghton Mifflin Harcourt"
  ],
  "publish_date": "October 21, 2012",
  "number_of_pages": 300,
  "isbn_13": [
    "9780547928227"
  ],
  "isbn_10": [
    "054792822X"
  ],
  "oclc": [
    "794607877"
  ],
  "olid": [
    "OL25380781M"
  ],
  "open_library_edition_key": "/books/OL25380781M",
  "open_library_work_key": "/works/OL45883W",
  "cover_url": "https://covers.openlibrary.org/b/id/8231496-M.jpg",
  "info_url": "https://openlibrary.org/books/OL25380781M/The_Hobbit",
  "preview_url": "https://archive.org/details/hobbit00tolkien"
}

The get_book_by_id tool accepts the following parameters:

  • idType: The type of identifier (one of: isbn, lccn, oclc, olid)
  • idValue: The value of the identifier

An example of this tool being used in Claude Desktop can be see here:

<img width="1132" alt="image" src="https://github.com/user-attachments/assets/0865904a-f984-4f7b-a27d-6397ac59d6d2" />

Docker

You can test this MCP server using Docker. To do this first run:

bash
docker build -t mcp-open-library .
docker run -p 8080:8080 mcp-open-library

You can then test the server running within Docker via the inspector e.g.

bash
npm run inspector http://localhost:8080

Development

Project Structure

  • src/index.ts - Main server implementation
  • src/types.ts - TypeScript type definitions
  • src/index.test.ts - Test suite

Available Scripts

  • npm run build - Build the TypeScript code
  • npm run watch - Watch for changes and rebuild
  • npm test - Run the test suite
  • npm run format - Format code with Prettier
  • npm run inspector - Run the MCP Inspector against the server

Running Tests

bash
npm test

Contributing

Contributions are welcome! Please feel free to submit a pull request.

Acknowledgments

常见问题

Open Library MCP Server 是什么?

让 AI 助手通过 Open Library 检索图书与作者信息,并以结构化 JSON 返回书名、作者详情和封面等数据。

Open Library MCP Server 提供哪些工具?

提供 6 个工具,包括 get_book_by_title、get_authors_by_name、get_author_info

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描109.6k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描109.6k

接口设计评审

by alirezarezvani

Universal
热门

审查 REST API 设计是否符合行业规范,自动检查命名、HTTP 方法、状态码与文档覆盖,识别破坏性变更并给出设计评分,适合评审接口方案和版本迭代前把关。

做API和架构方案时,它能帮你提前揪出接口设计问题并对齐最佳实践,评审视角系统,团队协作更省心。

平台与服务
未扫描9.0k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
82.9k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.3k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
34.5k

评论