Skip to main content
Glama
mcp-open-library

mcp-open-library

MCP Open Library

Trust Score Listed on Spark

Open Library API用のModel Context Protocol (MCP) サーバーです。AIアシスタントが書籍や著者の情報を検索できるようにします。

概要

このプロジェクトは、AIアシスタントがOpen Libraryと対話するためのツールを提供するMCPサーバーを実装しています。タイトルによる書籍検索、名前による著者検索、Open Libraryキーを使用した詳細な著者情報の取得、Open Library ID (OLID) を使用した著者写真のURL取得が可能です。サーバーは書籍および著者情報について構造化されたデータを返します。

Related MCP server: bookstore-mcp-server

機能

  • タイトルによる書籍検索: タイトルを使用して書籍を検索します (get_book_by_title)。

  • 名前による著者検索: 名前を使用して著者を検索します (get_authors_by_name)。

  • 著者詳細の取得: Open Libraryキーを使用して特定の著者の詳細情報を取得します (get_author_info)。

  • 著者写真の取得: Open Library ID (OLID) を使用して著者の写真のURLを取得します (get_author_photo)。

  • 書籍カバーの取得: さまざまな識別子 (ISBN, OCLC, LCCN, OLID, ID) を使用して書籍のカバー画像のURLを取得します (get_book_cover)。

  • IDによる書籍取得: さまざまな識別子 (ISBN, LCCN, OCLC, OLID) を使用して詳細な書籍情報を取得します (get_book_by_id)。

インストール

Smithery経由でのインストール

Smithery を介してClaude Desktop用のMCP Open Libraryを自動的にインストールするには:

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

手動インストール

# 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

使用方法

サーバーの実行

  1. node v22.21.1を使用していることを確認してください(新しいバージョンでも動作する可能性がありますが、このテストではこれを使用しています)。nvmがインストールされている場合は nvm use を実行してください。

  2. mcp-open-library のルートディレクトリで npm run build を実行します。

  3. 次に npm run inspector を実行します。ビルドが完了したら、MCP_PROXY_AUTH_TOKEN クエリ文字列パラメータを含むURLをクリックしてインスペクターを開きます。

  4. インスペクターで「STDIO」トランスポートを選択します。

  5. コマンドが 'build/index.js' に設定されていることを確認します。

  6. インスペクターの「Connect」ボタンをクリックすると、サーバーに接続されます。

  7. 右上のメニューバーにある「Tools」をクリックします。

  8. ツールを実行してみます(例: get_book_by_title をクリック)。

  9. 書籍を検索します(例: タイトルボックスに 'The Hobbit' と入力し、「Run Tool」をクリック)。サーバーが書籍の詳細を返します。

MCPクライアントでの使用

このサーバーはModel Context Protocolを実装しているため、Claude Desktop などのMCP互換のAIアシスタントやクライアントで使用できます。サーバーは以下のツールを公開しています:

  • get_book_by_title: タイトルで書籍情報を検索

  • get_authors_by_name: 名前で著者情報を検索

  • get_author_info: Open Library Author Keyを使用して特定の著者の詳細情報を取得

  • get_author_photo: Open Library Author ID (OLID) を使用して著者の写真のURLを取得

  • get_book_cover: 特定の識別子 (ISBN, OCLC, LCCN, OLID, または ID) を使用して書籍のカバー画像のURLを取得

  • get_book_by_id: 特定の識別子 (ISBN, LCCN, OCLC, または OLID) を使用して詳細な書籍情報を取得

get_book_by_title の入力例:

{
  "title": "The Hobbit"
}

get_book_by_title の出力例:

[
  {
    "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"
  }
]

get_authors_by_name の入力例:

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

get_authors_by_name の出力例:

[
  {
    "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
  }
]

get_author_info の入力例:

{
  "author_key": "OL26320A"
}

get_author_info の出力例:

{
  "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"
  }
}

get_author_photo の入力例:

{
  "olid": "OL26320A"
}

get_author_photo の出力例:

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

get_book_cover の入力例:

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

get_book_cover の出力例:

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

get_book_cover ツールは以下のパラメータを受け付けます:

  • key: 識別子のタイプ (ISBN, OCLC, LCCN, OLID, または ID のいずれか)

  • value: 識別子の値

  • size: オプションのカバーサイズ (S は小, M は中, L は大, デフォルトは L)

get_book_by_id の入力例:

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

get_book_by_id の出力例:

{
  "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"
}

get_book_by_id ツールは以下のパラメータを受け付けます:

  • idType: 識別子のタイプ (isbn, lccn, oclc, olid のいずれか)

  • idValue: 識別子の値

Claude Desktopでこのツールが使用されている例を以下に示します:

Docker

Dockerを使用してこのMCPサーバーをテストできます。これを行うには、まず以下を実行します:

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

その後、インスペクターを介してDocker内で実行されているサーバーをテストできます(例:

npm run inspector http://localhost:8080

開発

プロジェクト構造

  • src/index.ts - メインサーバーの実装

  • src/types.ts - TypeScript型定義

  • src/index.test.ts - テストスイート

利用可能なスクリプト

  • npm run build - TypeScriptコードのビルド

  • npm run watch - 変更を監視して再ビルド

  • npm test - テストスイートの実行

  • npm run format - Prettierによるコードのフォーマット

  • npm run inspector - サーバーに対してMCP Inspectorを実行

テストの実行

npm test

コントリビューション

コントリビューションを歓迎します!プルリクエストを気軽に送信してください。

謝辞

Available Tools

7 tools
get_author_infoGet author detailsA
Read-only

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

Inputs: author_key (required).

get_author_photoGet author photo URLA
Read-only

Get the URL for an author's photo using their Open Library Author ID (OLID e.g. OL23919A). Reports when no photo exists rather than returning a URL to a blank placeholder.

Inputs: olid (required).

get_authors_by_nameFind authors by nameA
Read-only

Search for author information on Open Library. Returns at most limit authors (default 10) together with num_found, the total number of matches; page through them with offset. Each result's key can be passed to get_author_info for that author's full record.

Inputs: name (required), limit, offset.

get_book_by_idGet book by identifierA
Read-only

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

Inputs: idType (required), idValue (required).

get_book_by_titleFind books by titleA
Read-only

Search for a book by its title on Open Library. Returns at most limit results (default 10) together with num_found, the total number of matches; page through them with offset. Each result carries best_edition — one edition of the work, with its isbn_13/isbn_10 where Open Library has them, and its edition_key, which can be passed to get_book_by_id as { idType: "olid" } for that edition's full record.

Inputs: title (required), limit, offset.

get_book_coverGet book cover URLA
Read-only

Get the URL for a book's cover image using a key (ISBN, OCLC, LCCN, OLID, ID) and value. Reports when no cover exists rather than returning a URL to a blank placeholder.

Inputs: key (required), value (required), size.

search_booksSearch booksA
Read-only

Search Open Library across titles, authors, subjects, places, people, publishers and ISBNs. Provide at least one search criterion: q, title, author, subject, place, person, publisher, isbn; combining several narrows the search. Returns at most limit results (default 10) together with num_found, the total number of matches; page through them with offset. Each result carries best_edition — one edition of the work, with its isbn_13/isbn_10 where Open Library has them, and its edition_key, which can be passed to get_book_by_id as { idType: "olid" } for that edition's full record.

Inputs: q, isbn, sort, limit, +8 more.

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 7 tools

    Disambiguation4/5

    Most tools are clearly separated by resource and action, but get_book_by_title overlaps heavily with search_books since it returns the same result structure and is essentially a subset of the general search. The book/author detail and cover/photo tools are unambiguous.

    Naming Consistency4/5

    Naming mostly follows a consistent get_<resource>_by_<qualifier> pattern, e.g. get_book_by_id, get_book_by_title, get_author_photo. search_books breaks the get_ convention but remains readable and predictable alongside the others.

    Tool Count5/5

    Seven tools is well-scoped for a read-only Open Library server. Each tool addresses a distinct lookup need without the collection feeling bloated or thin.

    Completeness4/5

    The surface covers general book search, book lookup by ID/title, author search, author details, author photos, and book covers. Minor gaps exist, such as no direct endpoint for works or edition lists beyond indirection through edition_key, but core reading workflows are covered.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server implementation that can be run directly or through Docker, enabling AI assistants to interact with external systems through the MCP standard.
      2
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that exposes tools for querying a bookstore inventory, allowing AI agents to search and retrieve book information via the Model Context Protocol.
      1
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      An MCP server that enables searching books and authors, fetching editions, browsing subjects, and resolving cover images from Open Library.
      267 npm
      4
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for Google Books API, enabling volume details, ISBN lookup, and bookshelf access via natural language queries.
      88 npm
      1
      MIT