MCP Connector

Access Book and Author Data via Open Library

MCP server for the Open Library API - search books/authors, retrieve details, covers, and author photos.

Works with githubdocker

96
Spark score
out of 100
Status Verified
Updated 3 months ago
Version 1.0.2
Models
universal

Add to Favorites

Why it matters

Integrate AI assistants with the Open Library API to retrieve comprehensive book and author information, including metadata, biographies, and cover art.

Outcomes

What it gets done

01

Search for books by title and retrieve detailed metadata.

02

Find author information by name and retrieve biographical details.

03

Obtain book cover URLs using various identifiers.

04

Retrieve detailed book information using multiple identifier types.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-mcp-open-library | bash

Capabilities

Tools your agent gets

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 about a specific author using their Open Library Author Key

get_author_photo

Get author photo URL using their Open Library Author ID (OLID)

get_book_cover

Get book cover URL 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)

Overview

mcp-open-library MCP Server

An MCP server for the Open Library API, providing tools to search books and authors, retrieve detailed metadata, cover images, and author photos. Use when an AI assistant needs to look up book or author metadata, cover images, or author photos from Open Library.

What it does

MCP Open Library is an MCP server for the Open Library API that enables AI assistants to search for book and author information. It allows searching for books by title, searching for authors by name, retrieving detailed author information using an Open Library key, and getting author photo URLs using an Open Library ID (OLID), returning structured data for both books and authors.

When to use - and when NOT to

Use this connector when an AI assistant needs to look up book or author metadata, cover images, or author photos from Open Library's catalog. It exposes six tools: get_book_by_title (search by title), get_authors_by_name (search by name), get_author_info (detailed author info by Open Library author key), get_author_photo (photo URL by OLID), get_book_cover (cover image URL by identifier type - ISBN, OCLC, LCCN, OLID, or ID - and optional size S/M/L, defaulting to L), and get_book_by_id (detailed book info by identifier type - isbn, lccn, oclc, or olid).

Inputs and outputs

A get_book_by_title search for "The Hobbit" returns an array with title, authors, first publish year, Open Library work key, edition count, and cover URL. A get_authors_by_name search for "J.R.R. Tolkien" returns an array with the author's key, name, alternate names, birth date, top work, and work count. get_author_info for author key OL26320A returns full biographical detail (name, personal name, birth/death dates, bio text, alternate names, photo IDs, remote IDs including VIAF and Wikidata, revision number, and last-modified timestamp). get_author_photo for the same OLID returns a direct image URL (https://covers.openlibrary.org/a/olid/OL26320A-L.jpg). get_book_cover with key: "ISBN", value: "9780547928227", size: "L" returns a cover image URL. get_book_by_id with idType: "isbn", idValue: "9780547928227" returns full edition detail: title, authors, publishers, publish date, page count, ISBN-13/10, OCLC, OLID, Open Library edition/work keys, cover URL, an info URL, and (when available) a preview/archive URL.

How to install

Install via Smithery for automatic Claude Desktop setup (npx -y @smithery/cli install @8enSmith/mcp-open-library --client claude), or manually by cloning the repo, npm install, and npm run build. To run and test locally: use Node v22.21.1 (nvm use if available), run npm run build, then npm run inspector and open the printed URL (with its MCP_PROXY_AUTH_TOKEN), select STDIO transport with command build/index.js, click Connect, open the Tools tab, and try a tool like get_book_by_title. Docker is also supported: docker build -t mcp-open-library . then docker run -p 8080:8080 mcp-open-library, tested via npm run inspector http://localhost:8080. Any MCP-compatible client (e.g. Claude Desktop) can use the server once running.

Integrations

Project structure: src/index.ts (main server implementation), src/types.ts (TypeScript type definitions), and src/index.test.ts (test suite). Available scripts: npm run build, npm run watch (rebuild on change), npm test, npm run format (Prettier), and npm run inspector. Built on the Open Library API and the Model Context Protocol.

Who it's for

Developers and AI assistants that need programmatic access to book and author metadata, cover images, and author photos from Open Library's public catalog, rather than manually querying the Open Library website.

Source README

MCP Open Library

Trust Score
Listed on Spark
smithery badge

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

mcp-open-library MCP server

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:

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

Manual Installation

# 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:

{
  "title": "The Hobbit"
}

Example get_book_by_title output:

[
  {
    "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:

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

Example get_authors_by_name output:

[
  {
    "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:

{
  "author_key": "OL26320A"
}

Example get_author_info output:

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

{
  "olid": "OL26320A"
}

Example get_author_photo output:

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

Example get_book_cover input:

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

Example get_book_cover output:

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:

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

Example get_book_by_id output:

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

image

Docker

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

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.

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

npm test

FAQ

Common questions

Trust

How it checks out

Official By maintainer
Downloads 0

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.