Back to Browse

Open Library MCP Server

Developer ToolsModerate5.2MCP RegistryLocal
Free

Server data from the Official MCP Registry

Search books and authors on the Internet Archive's Open Library

About

Search books and authors on the Internet Archive's Open Library

Security Report

5.2
Moderate5.2Moderate Risk

This is a well-structured MCP server for the Open Library API with clean authentication practices, proper input validation, and appropriate permissions scoping. The server makes HTTP calls to a public API, validates all user inputs via Zod schemas, and includes comprehensive test coverage. No credentials or secrets are embedded, and error handling is consistent across tools. Supply chain analysis found 8 known vulnerabilities in dependencies (1 critical, 1 high severity). Package verification found 1 issue.

6 files analyzed · 12 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

HTTP Network Access

Connects to external APIs or services over the internet.

env_vars

Check that this permission is expected for this type of plugin.

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-8ensmith-mcp-open-library": {
      "args": [
        "-y",
        "mcp-open-library"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

MCP Open Library

MCP Registry 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.

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

MCP Registry

This server publishes to the official MCP Registry as io.github.8enSmith/mcp-open-library from v1.0.3 onwards. Clients that support the registry can install it by that name.

To inspect the published listing:

curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.8enSmith/mcp-open-library"

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:

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

Releasing

Releases are automated. Pushing a v* tag triggers publish-mcp.yml, which runs the checks, publishes the package to npm, registers the new version with the MCP Registry, and then creates a GitHub Release using that version's CHANGELOG.md section as the notes. Both npm and the registry authenticate over GitHub OIDC, so there are no publishing secrets to manage.

package.json's version is the single source of truth. npm version derives everything else from it via a version lifecycle hook, so a release is one command:

npm version patch   # or minor / major
git push --follow-tags

That single command bumps package.json, rewrites server.json to match, promotes the changelog's ## [Unreleased] heading to the new version and today's date, and commits the lot under one tag.

Two things to know before you run it:

  • Write your changelog entries first. They go under a ## [Unreleased] heading in CHANGELOG.md as you merge work. npm version fails if that heading is missing, rather than releasing something undocumented. If it does fail, undo the partial bump with git restore --source=HEAD --staged --worktree package.json package-lock.json server.json.
  • The working tree must be clean, and the pre-commit hook (lint + full test suite) runs inside npm version.

CI re-asserts that the tag, package.json, server.json and CHANGELOG.md all agree before anything is published — see scripts/assert-release-consistency.mjs. The same check runs on pull requests that touch those files.

npm version is not a retry

Once it prints v1.0.3, the commit and tag exist and the release is done locally — the next step is git push --follow-tags, not running npm version again. A second run attempts the next version, and will fail on the missing ## [Unreleased] heading (which the first run consumed). That failure is safe by design, but it leaves package.json, package-lock.json and server.json bumped and uncommitted. Undo with:

git restore --source=HEAD --staged --worktree package.json package-lock.json server.json
If the publish workflow fails

Re-running the job from the Actions tab only helps for a transient failure. GitHub runs the workflow as it existed at the tagged commit, so a bug in the workflow itself or in server.json cannot be fixed by a re-run — the fix has to be in the commit the tag points at.

Nothing is published until the workflow reaches its npm step, so if it failed before then, the version is still free and you can move the tag:

# fix the problem on main and commit it first
git push origin :v1.0.3          # delete the remote tag
git tag -d v1.0.3                # delete it locally
git tag -a v1.0.3 -m "1.0.3"     # re-tag at the fixed commit
git push origin v1.0.3

package.json must still read 1.0.3 at that commit, or the consistency check will reject it. If npm did already publish, do not reuse the version — that release is immutable. Bump to the next patch instead; the guarded npm step means a re-run skips what already succeeded.

Contributing

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

Acknowledgments

Reviews

No reviews yet

Be the first to review this server!