Open Library MCP Server
# Open Library MCP Server
## Overview
This project is a Model Context Protocol (MCP) server built with TypeScript. It connects AI assistants to the Open Library API for searching books and authors, retrieving metadata, comparing works, and finding text snippets inside books.
## Technologies Used
- TypeScript
- Node.js
- Model Context Protocol (MCP)
- Open Library API
## Installation
```bash
npm install
```
## Build
```bash
npm run build
```
## Run
```bash
npm start
```
The server uses **stdio** transport. Point your MCP client at `dist/index.js`.
## Available MCP Tools
### Search
| Tool | Parameters | Description |
|------|------------|-------------|
| `search_books` | `query` | Search books by title, author, or keyword |
| `search_authors` | `query`, optional `limit` (default 10, max 25) | Search authors by name |
| `read_book_snippet` | `query`, optional `limit` (default 3, max 10) | Search inside books for text snippets |
### Books & works
| Tool | Parameters | Description |
|------|------------|-------------|
| `get_work_details` | `workId` | Full work record by Open Library work ID |
| `get_book_details_by_isbn` | `isbn` | Book details by ISBN-10 or ISBN-13 |
| `get_editions` | `workId` | List editions for a work |
| `get_book_ratings` | `workId` | Aggregate reader ratings for a work |
| `get_book_summary` | `workId` | Concise metadata summary (title, description, subjects, etc.) |
| `compare_books` | `workId1`, `workId2` | Side-by-side comparison of two works |
### Authors
| Tool | Parameters | Description |
|------|------------|-------------|
| `get_author_profile` | `authorId` | Author biography and profile by ID |
| `get_author_works` | `authorId`, optional `limit` (default 20, max 100), optional `offset` | Author bibliography |
### Subjects
| Tool | Parameters | Description |
|------|------------|-------------|
| `get_subject_insights` | `subject`, optional `limit` (default 20, max 100), optional `offset` | Books and trends for a subject/topic |
TDQS
Scored across 12 tools
Each tool targets a distinct resource or operation: search, author, book, editions, ratings, comparisons, subject insights, and snippets. The inputs vary (ISBN, work ID, author ID) and descriptions clarify boundaries, so an agent should rarely confuse them.
Most tools follow a 'get_' prefix followed by the resource, but there are three exceptions: 'search_books', 'search_authors' (using 'search_'), 'compare_books' (using 'compare_'), and 'read_book_snippet' (using 'read_'). This minor inconsistency prevents a perfect score.
With 12 tools, the set covers searching, retrieval of detailed metadata, ratings, editions, comparisons, and reading snippets. This is well-scoped for a book database API without being excessive.
The tools provide comprehensive read-only access to Open Library: authors, works, editions, ratings, subjects, and text snippets. There are no obvious dead ends; all major query needs are addressed, especially given the server's read-only nature.