✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more

MCP Open Library

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

Overview

This project implements an MCP server that provides a tool for AI assistants to search the Open Library for book information by title. The server returns structured data about the most relevant book match, including title, authors, publication year, and other metadata.

Features

  • Book Search by Title: Search for books using their title and get detailed information
  • Structured Response Format: Returns book information in a consistent JSON structure
  • Error Handling: Proper validation and error reporting
  • Testing: Comprehensive test coverage with Vitest

Installation

# Clone the repository
git clone https://github.com/your-username/mcp-open-library.git
cd mcp-open-library

# Install dependencies
npm install

# Build the project
npm run build

Usage

Running the Server

You can use the MCP Inspector to test the server:

npm run inspector

Access the MCP Inspector and then test the tool e.g.

alt text

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

  • get_book_by_title: Search for book information by title

Example input:

{
  "title": "The Hobbit"
}

Example output:

{
  "title": "The Hobbit",
  "authors": ["J.R.R. Tolkien"],
  "first_publish_year": 1937,
  "open_library_work_key": "/works/OL45883W",
  "edition_count": 120
}

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.

pnpm 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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

  • Open Library API
  • Model Context Protocol

Featured Templates

View More
Verified Icon
AI Agents
AI Chatbot Starter Kit
1308 6081 5.0
Data Analysis
Pharmacy Admin Panel
238 1704
Customer service
Multi-language AI Translator
135 646
AI Characters
Your Speaking Avatar
168 685
AI Assistants
Talk with Claude 3
156 1165
AI Characters
Sarcastic AI Chat Bot
128 1440

Start your free trial

Build your solution today. No credit card required.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.