MCP Open Library
About
A Model Context Protocol (MCP) server for the Open Library API that enables AI assistants to search for book and author information.
Details
- Author
- 8ensmith
- GitHub stars
- 82
- Downloads
- 414
- Categories
- Search, Community, Other, Developer Tools, AI
Jump to
- Search books by title (get_book_by_title)
- Search authors by name (get_authors_by_name)
- Retrieve detailed author information by Open Library key
- Get author photo URL using Open Library ID
- Get book cover URL by ISBN, OCLC, LCCN, OLID, or ID
- Get full book details by ISBN, LCCN, OCLC, or OLID
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MCP Open LibraryCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Install via Smithery (npx -y @smithery/cli install @8enSmith/mcp-open-library --client claude) or manually by cloning the repo, running npm install and npm run build. Then point any MCP‑compatible client (e.g., Claude Desktop) to the build/index.js entry point, or use the MCP Inspector with npm run inspector.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mcp open library": {
"mcp-open-library": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"@8enSmith/mcp-open-library",
"--client",
"claude"
]
}
}
}
}
McpServers
{
"mcp-open-library": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"@8enSmith/mcp-open-library",
"--client",
"claude"
]
}
}
A Model Context Protocol (MCP) server for the Open Library API that enables AI assistants to search for book and author information.
This project implements an MCP server that provides tools for AI assistants to interact with theOpen Library. It allows searching the catalogue by title, author, subject and other fields, searching for authors by name, retrieving detailed author information using their Open Library key, and getting URLs for book covers and author photos. The server returns JSON projections of the Open Library responses rather than the raw payloads.
- Book Search: Search across titles, authors, subjects, places, people, publishers and ISBNs, with sorting and paging (search_books).
- Book Search by Title: Search for books using their title (get_book_by_title).
- Author Search by Name: Search for authors using their name, with paging (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).
Search results are paged — every search tool returns at mostlimitresults (default 10, maximum 50) alongsidenum_found, the total number of matches, which you page through withoffset(maximum 1000). The two cover tools check that an image actually exists and say so when it does not, rather than handing back a URL that resolves to a blank placeholder.
Every tool is a read-only lookup and advertises itself as such with thereadOnlyHintandopenWorldHintannotations, which may allow a client to skip the confirmation prompt it shows for tools that could change something. These are hints: the MCP specification has clients treat annotations as untrusted unless the server is trusted, so the confirmation policy is the client's to decide. Failures — an unreachable API, a rejected argument — come back as a tool result flaggedisError, so an assistant can read what went wrong and correct its next call rather than the request failing outright.
Nothing to install or build. Point an MCP client at the package withnpxand it will be fetched on first run:
{ "mcpServers": { "mcp-open-library": { "command": "npx", "args": ["-y", "mcp-open-library"] } } }
In Claude Desktop that goes inclaude_desktop_config.json; other clients use the same shape. Restart the client and the seven tools below become available.
This server publishes to the official MCP Registry asio.github.8enSmith/mcp-open-libraryfrom v1.0.3 onwards. Clients that support the registry can install it by that name.
curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.8enSmith/mcp-open-library"
To install MCP Open Library for Claude Desktop automatically viaSmithery:
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
- 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 havenvminstalled runnvm use.
- In themcp-open-libraryroot directory runnpm run build
- Next runnpm run inspector. Once built, click the URL with theMCP_PROXY_AUTH_TOKENquery string parameter to open the Inspector.
- In the Inspector, choose 'STDIO' transport
- Make sure the command is set to 'build/index.js'
- Click the 'Connect' button in the Inspector - you'll now connect to the server
- Click 'Tools' in the top right menu bar
- Try running a tool e.g. click get_book_by_title
- Search for a book e.g. In the title box enter 'The Hobbit' and then click 'Run Tool'. Server will then return book details.
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:
- search_books: Search the catalogue by any combination of query, title, author, subject, place, person, publisher and ISBN
- 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)
{ "author": "Ursula K. Le Guin", "subject": "fantasy", "sort": "old", "limit": 2 }
{ "num_found": 51, "offset": 0, "limit": 2, "results": [ { "title": "A Wizard of Earthsea", "authors": ["Ursula K. Le Guin"], "first_publish_year": 1968, "open_library_work_key": "/works/OL59798W", "edition_count": 87, "author_keys": ["OL31353A"], "best_edition": { "edition_key": "OL5613890M" }, "cover_url": "https://covers.openlibrary.org/b/id/13617691-M.jpg", "ratings_average": 3.95, "ebook_access": "borrowable" } ] }
best_editionis one specific edition of the work — the one Open Library ranks best for your query — carrying that edition's own identifiers. Search results otherwise identify awork(open_library_work_key), which no tool accepts, so this is the route from a search hit to a concrete book.
Itsedition_keyis an OLID you can pass straight toget_book_by_idfor the full edition record, including its complete ISBN arrays:
{ "idType": "olid", "idValue": "OL5613890M" }
Theisbn_13/isbn_10fields are omitted where Open Library holds no ISBN for that edition — as in the example above, and roughly a third of results — whileedition_keyis essentially always present. Where an edition lists several ISBNs of one kind, the first is reported;get_book_by_idreturns them all.
Thesearch_bookstool accepts the following parameters:
- At least one ofq,title,author,subject,place,person,publisherorisbn— the request is rejected without one, since an unfiltered search matches the entire catalogue.qtakes a free-form Solr query such assubject:cyberpunk AND first_publish_year:[1980 TO 1990]
- language: Optional 3-letter MARC language code (e.g.eng,fre)
- sort: Optional ordering —new,old,random,key,rating,readinglog,want_to_read,currently_reading,already_readortitle. Omit for relevance
- limit: Optional, 1–50, defaults to 10
- offset: Optional, 0–1000, defaults to 0
{ "title": "The Hobbit", "limit": 1 }
{ "num_found": 224, "offset": 0, "limit": 1, "results": [ { "title": "The Hobbit", "authors": ["J.R.R. Tolkien"], "first_publish_year": 1937, "open_library_work_key": "/works/OL27482W", "edition_count": 481, "author_keys": ["OL26320A"], "best_edition": { "edition_key": "OL51709286M", "isbn_13": "9780395520215", "isbn_10": "0395520215" }, "cover_url": "https://covers.openlibrary.org/b/id/14627509-M.jpg", "ratings_average": 4.29, "ebook_access": "borrowable" } ] }
{ "name": "J. R. R. Tolkien", "limit": 2 }
Each result'skeycan be passed toget_author_infofor that author's full record.alternate_namesis abridged here.
{ "num_found": 2, "offset": 0, "limit": 2, "results": [ { "key": "OL26320A", "name": "J.R.R. Tolkien", "alternate_names": ["John Ronald Reuel Tolkien", "Tolkien"], "birth_date": "3 January 1892", "top_work": "The Hobbit", "work_count": 355 }, { "key": "OL332676A", "name": "J. R. R. Tolkien Centenary Conference (1992 Keble College, Oxford)", "top_work": "Proceedings of the J.R.R. Tolkien Centenary Conference, 1992", "work_count": 2 } ] }
{ "author_key": "OL26320A" }
{ "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" } }
{ "olid": "OL26320A" }
https://covers.openlibrary.org/a/olid/OL26320A-L.jpg
When Open Library has no photo for that author, the tool says so instead of returning a URL:
No author photo available for OLID OL99999999A.
{ "key": "ISBN", "value": "9780547928227", "size": "L" }
https://covers.openlibrary.org/b/isbn/9780547928227-L.jpg
As with author photos, a book with no cover produces a message rather than a URL:
No cover image available for OLID OL00000000M.
Theget_book_covertool accepts the following parameters:
- key: The type of identifier (one of:ISBN,OCLC,LCCN,OLID, orID)
- value: The value of the identifier
- size: Optional cover size (Sfor small,Mfor medium,Lfor large, defaults toL)
{ "idType": "isbn", "idValue": "9780547928227" }
{ "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" }
Theget_book_by_idtool 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:
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.
- src/index.ts- The MCP server: builds the HTTP clients and drives both request handlers from the tool registry
- src/index.test.ts- Tests for the server wiring, including a snapshot of the published tool schemas
- src/tools/<tool-name>/- One directory per tool, each containingindex.ts(the handler, its Zod argument schema and itsToolDefinition),index.test.ts, and — for tools with a non-trivial API response — atypes.tsdescribing that response shape
- src/tools/registry.ts- TheTOOLSarray, the single list of what the server exposes
- src/tools/types.ts- TheToolDefinitionandToolHandlercontracts
- src/utils/- Shared plumbing:http.ts(the API and covers Axios clients),errors.ts(argument parsing and error results),results.ts,schema.ts(Zod → JSON Schema),search.ts(the shared search projection and paging schemas),covers.ts
- scripts/- Release automation (sync-server-json.mjs,promote-changelog.mjs,assert-release-consistency.mjs) and its tests
A tool's input contract is declared once, as a Zod schema. The JSON Schema that MCP clients see is generated from it bytoInputSchema, so the two cannot drift. Field descriptions come from.describe()on the Zod schema. Note that.refine()constraints are dropped in translation — a cross-field rule has to be stated in the tool'sdescriptiontoo, or clients will never learn about it.
Adding a tool means creating the directory and adding one entry toTOOLSinsrc/tools/registry.ts.src/index.test.tsderives its expectations from that array, so the only test change is an updated schema snapshot (npx vitest run -u).
- npm run build- Build the TypeScript code
- npm run watch- Watch for changes and rebuild
- npm test- Run the test suite in watch mode
- npm run test:precommit- Run the test suite once and exit
- npm run lint/npm run lint:fix- Lintsrcandscriptswith ESLint
- npm run format- Format code with Prettier
- npm run inspector- Run the MCP Inspector against the server
For a single pass — what the pre-commit hook and CI run — use:
npx vitest run src/tools/get-book-by-id/index.test.ts npx vitest run -t "should return book details when given a valid OLID"
Releases are automated. Pushing avtag triggerspublish-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'sCHANGELOG.mdsection as the notes. Both npm and the registry authenticate over GitHub OIDC, so there are no publishing secrets to manage.
package.json'sversionis the single source of truth.npm versionderives everything else from it via aversionlifecycle hook, so a release is one command:
npm version patch # or minor / major git push --follow-tags
That single command bumpspackage.json, rewritesserver.jsonto match, promotes the changelog's## [Unreleased]heading to the new version and today's date, and commits the lot under one tag.
- Write your changelog entries first.They go under a## [Unreleased]heading inCHANGELOG.mdas you merge work.npm versionfails if that heading is missing, rather than releasing something undocumented. If it does fail, undo the partial bump withgit 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 insidenpm version.
CI re-asserts that the tag,package.json,server.jsonandCHANGELOG.mdall agree before anything is published — seescripts/assert-release-consistency.mjs. The same check runs on pull requests that touch those files.
Once it prints the new tag, the commit and tag exist and the release is done locally — the next step isgit push --follow-tags,notrunningnpm versionagain. A second run attempts thenextversion, and will fail on the missing## [Unreleased]heading (which the first run consumed). That failure is safe by design, but it leavespackage.json,package-lock.jsonandserver.jsonbumped and uncommitted. Undo with:
git restore --source=HEAD --staged --worktree package.json package-lock.json server.json
Re-running the job from the Actions tab only helps for a transient failure. GitHub runs the workflowas it existed at the tagged commit, so a bug in the workflow itself or inserver.jsoncannot 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 VERSION="$(node -p "require('./package.json').version")" git push origin ":v${VERSION}" # delete the remote tag e.g. git push origin :v1.0.3 git tag -d "v${VERSION}" # delete it locally git tag -a "v${VERSION}" -m "${VERSION}" # re-tag at the fixed commit git push origin "v${VERSION}"
The fix commit must leavepackage.jsonon that same version, or the consistency check will reject the tag. If npmdid*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.
Contributions are welcome! Please feel free to submit a pull request.
Search global news using natural language. Webz.io News Search API returns the most relevant articles and content, with filters for source, country, language, date, sentiment, and category.
Search for IP addresses using Chaitin's IP Intelligence API.
Get any answer from the Facebook Ads Library, conduct deep research including messaging, creative testing and comparisons in seconds.
Google News search capabilities with automatic topic categorization and multi-language support via SerpAPI integration.
A Model Context Protocol (MCP) server providing access to Google Programmable Search Engine (PSE) and Custom Search Engine (CSE).
A Model Context Protocol (MCP) server providing access to Google Search Console.
An enhanced MCP server for SearXNG web searching, utilizing a category-aware web-search, web-scraping, and includes a date/time retrieval tool.
Local RAG (on-premises) with MCP server.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



