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 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 g
Add this skill
npx mdskills install 8enSmith/mcp-open-libraryWell-documented MCP server with 6 useful tools for querying Open Library's book and author data
1# MCP Open Library23[](https://archestra.ai/mcp-catalog/8ensmith__mcp-open-library)4[](https://smithery.ai/server/@8enSmith/mcp-open-library)56A Model Context Protocol (MCP) server for the Open Library API that enables AI assistants to search for book and author information.78<a href="https://glama.ai/mcp/servers/@8enSmith/mcp-open-library">9 <img width="380" height="200" src="https://glama.ai/mcp/servers/@8enSmith/mcp-open-library/badge" alt="mcp-open-library MCP server" />10</a>1112## Overview1314This project implements an MCP server that provides tools for AI assistants to interact with the [Open Library](https://openlibrary.org/). 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.1516## Features1718- **Book Search by Title**: Search for books using their title (`get_book_by_title`).19- **Author Search by Name**: Search for authors using their name (`get_authors_by_name`).20- **Get Author Details**: Retrieve detailed information for a specific author using their Open Library key (`get_author_info`).21- **Get Author Photo**: Get the URL for an author's photo using their Open Library ID (OLID) (`get_author_photo`).22- **Get Book Cover**: Get the URL for a book's cover image using various identifiers (ISBN, OCLC, LCCN, OLID, ID) (`get_book_cover`).23- **Get Book by ID**: Retrieve detailed book information using various identifiers (ISBN, LCCN, OCLC, OLID) (`get_book_by_id`).2425## Installation2627### Installing via Smithery2829To install MCP Open Library for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@8enSmith/mcp-open-library):3031```bash32npx -y @smithery/cli install @8enSmith/mcp-open-library --client claude33```3435### Manual Installation36```bash37# Clone the repository38git clone https://github.com/8enSmith/mcp-open-library.git39cd mcp-open-library4041# Install dependencies42npm install4344# Build the project45npm run build46```4748## Usage4950### Running the Server5152 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`.53 2. In the `mcp-open-library` root directory run `npm run build`54 3. Next run `npm run inspector`. Once built, click the URL with the `MCP_PROXY_AUTH_TOKEN` query string parameter to open the Inspector.55 4. In the Inspector, choose 'STDIO' transport56 5. Make sure the command is set to 'build/index.js'57 6. Click the 'Connect' button in the Inspector - you'll now connect to the server58 7. Click 'Tools' in the top right menu bar59 8. Try running a tool e.g. click get_book_by_title60 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.6162### Using with an MCP Client6364This server implements the Model Context Protocol, which means it can be used by any MCP-compatible AI assistant or client e.g. [Claude Desktop](https://modelcontextprotocol.io/quickstart/user). The server exposes the following tools:6566- `get_book_by_title`: Search for book information by title67- `get_authors_by_name`: Search for author information by name68- `get_author_info`: Get detailed information for a specific author using their Open Library Author Key69- `get_author_photo`: Get the URL for an author's photo using their Open Library Author ID (OLID)70- `get_book_cover`: Get the URL for a book's cover image using a specific identifier (ISBN, OCLC, LCCN, OLID, or ID)71- `get_book_by_id`: Get detailed book information using a specific identifier (ISBN, LCCN, OCLC, or OLID)7273**Example `get_book_by_title` input:**74```json75{76 "title": "The Hobbit"77}78```7980**Example `get_book_by_title` output:**81```json82[83 {84 "title": "The Hobbit",85 "authors": [86 "J. R. R. Tolkien"87 ],88 "first_publish_year": 1937,89 "open_library_work_key": "/works/OL45883W",90 "edition_count": 120,91 "cover_url": "https://covers.openlibrary.org/b/id/10581294-M.jpg"92 }93]94```9596**Example `get_authors_by_name` input:**97```json98{99 "name": "J.R.R. Tolkien"100}101```102103**Example `get_authors_by_name` output:**104```json105[106 {107 "key": "OL26320A",108 "name": "J. R. R. Tolkien",109 "alternate_names": [110 "John Ronald Reuel Tolkien"111 ],112 "birth_date": "3 January 1892",113 "top_work": "The Hobbit",114 "work_count": 648115 }116]117```118119**Example `get_author_info` input:**120```json121{122 "author_key": "OL26320A"123}124```125126**Example `get_author_info` output:**127```json128{129 "name": "J. R. R. Tolkien",130 "personal_name": "John Ronald Reuel Tolkien",131 "birth_date": "3 January 1892",132 "death_date": "2 September 1973",133 "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.",134 "alternate_names": ["John Ronald Reuel Tolkien"],135 "photos": [6791763],136 "key": "/authors/OL26320A",137 "remote_ids": {138 "viaf": "95218067",139 "wikidata": "Q892"140 },141 "revision": 43,142 "last_modified": {143 "type": "/type/datetime",144 "value": "2023-02-12T05:50:22.881"145 }146}147```148149**Example `get_author_photo` input:**150```json151{152 "olid": "OL26320A"153}154```155156**Example `get_author_photo` output:**157```text158https://covers.openlibrary.org/a/olid/OL26320A-L.jpg159```160161**Example `get_book_cover` input:**162```json163{164 "key": "ISBN",165 "value": "9780547928227",166 "size": "L"167}168```169170**Example `get_book_cover` output:**171```text172https://covers.openlibrary.org/b/isbn/9780547928227-L.jpg173```174175The `get_book_cover` tool accepts the following parameters:176- `key`: The type of identifier (one of: `ISBN`, `OCLC`, `LCCN`, `OLID`, or `ID`)177- `value`: The value of the identifier178- `size`: Optional cover size (`S` for small, `M` for medium, `L` for large, defaults to `L`)179180**Example `get_book_by_id` input:**181```json182{183 "idType": "isbn",184 "idValue": "9780547928227"185}186```187188**Example `get_book_by_id` output:**189```json190{191 "title": "The Hobbit",192 "authors": [193 "J. R. R. Tolkien"194 ],195 "publishers": [196 "Houghton Mifflin Harcourt"197 ],198 "publish_date": "October 21, 2012",199 "number_of_pages": 300,200 "isbn_13": [201 "9780547928227"202 ],203 "isbn_10": [204 "054792822X"205 ],206 "oclc": [207 "794607877"208 ],209 "olid": [210 "OL25380781M"211 ],212 "open_library_edition_key": "/books/OL25380781M",213 "open_library_work_key": "/works/OL45883W",214 "cover_url": "https://covers.openlibrary.org/b/id/8231496-M.jpg",215 "info_url": "https://openlibrary.org/books/OL25380781M/The_Hobbit",216 "preview_url": "https://archive.org/details/hobbit00tolkien"217}218```219220The `get_book_by_id` tool accepts the following parameters:221- `idType`: The type of identifier (one of: `isbn`, `lccn`, `oclc`, `olid`)222- `idValue`: The value of the identifier223224An example of this tool being used in Claude Desktop can be see here:225226<img width="1132" alt="image" src="https://github.com/user-attachments/assets/0865904a-f984-4f7b-a27d-6397ac59d6d2" />227228### Docker229230You can test this MCP server using Docker. To do this first run:231232```bash233docker build -t mcp-open-library .234docker run -p 8080:8080 mcp-open-library235```236237You can then test the server running within Docker via the inspector e.g.238239```bash240npm run inspector http://localhost:8080241```242243## Development244245### Project Structure246247- `src/index.ts` - Main server implementation248- `src/types.ts` - TypeScript type definitions249- `src/index.test.ts` - Test suite250251### Available Scripts252253- `npm run build` - Build the TypeScript code254- `npm run watch` - Watch for changes and rebuild255- `npm test` - Run the test suite256- `npm run format` - Format code with Prettier257- `npm run inspector` - Run the MCP Inspector against the server258259### Running Tests260261```bash262npm test263```264265## Contributing266267Contributions are welcome! Please feel free to submit a pull request.268269## Acknowledgments270271- [Open Library API](https://openlibrary.org/developers/api)272- [Model Context Protocol](https://github.com/modelcontextprotocol/mcp)273
Full transparency — inspect the skill content before installing.