MCP cover image
See in Github
2025-04-14

Ein Modellkontext -Protokollserver (MCP) für die Open Library -API, mit der AI -Assistenten nach Buchinformationen suchen können.

2

Github Watches

1

Github Forks

2

Github Stars

MCP Open Library

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

mcp-open-library MCP server

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 and get detailed information
  • Author Search by Name: Search for authors using their name and get relevant details
  • Structured Response Format: Returns book and author 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 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)

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

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

相关推荐

  • Aurity Ltd
  • Create and Publish Business Websites in seconds. AI will gather all the details about your website and generate link to your website.

  • Convincible Ltd
  • You're in a stone cell – can you get out? A classic choose-your-adventure interactive fiction game, based on a meticulously-crafted playbook. With a medieval fantasy setting, infinite choices and outcomes, and dice!

  • John Rafferty
  • Text your favorite pet, after answering 10 questions about their everyday lives!

  • Ian O'Connell
  • Provide players' names or enter Quickstart to start the game!

  • analogchat.com
  • Efficient Spotify assistant for personalized music data.

  • Matthieu Savioux
  • Evaluates language quality of texts, responds with a numerical score between 50-150.

  • seabiscuit.ai
  • Discover A More Robust Business: Craft tailored value proposition statements, develop a comprehensive business model canvas, conduct detailed PESTLE analysis, and gain strategic insights on enhancing business model elements like scalability, cost structure, and market competition strategies. (v1.18)

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llm 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Zusammenfassung der weltbesten LLM -Ressourcen.

  • av
  • Führen Sie mühelos LLM -Backends, APIs, Frontends und Dienste mit einem Befehl aus.

  • langgenius
  • Azure
  • Dieses Repository dient zur Entwicklung des Azure MCP -Servers, wodurch Ihre Agenten die Leistung von Azure verleiht.

  • alibaba
  • 1Panel-dev
  • 🔥 1Panel bietet eine intuitive Weboberfläche und einen MCP -Server, um Websites, Dateien, Container, Datenbanken und LLMs auf einem Linux -Server zu verwalten.

  • caio-moliveira
  • Dieses Projekt wurde erstellt, um zu demonstrieren, wie wir uns mit verschiedenen Modellkontextprotokollen (MCPs) verbinden können.

  • Byaidu
  • PDF wissenschaftliche Papierübersetzung mit erhaltenen Formaten - 基于 ai 完整保留排版的 pdf 文档全文双语翻译 , 支持 支持 支持 支持 google/deeptl/ollama/openai 等服务 提供 cli/gui/mcp/docker/zotero

  • rulego
  • ⛓️Rugele ist ein leichter, leistungsstarker, leistungsstarker, eingebetteter Komponenten-Orchestrierungsregel-Motor-Rahmen für GO.

    Reviews

    2.4 (5)
    Avatar
    user_TWh9r9zi
    2025-04-26

    As an avid user of mcp-open-library by 8enSmith, I find it incredibly useful and intuitive. The library provides a seamless experience and has become an essential tool for my projects. Highly recommended for anyone needing efficient and reliable solutions!

    Avatar
    user_BmMDE6o0
    2025-04-26

    As a dedicated user of mcp applications, I have to say that mcp-open-library by 8enSmith is an exceptional resource. It provides seamless access to a vast array of functions and tools that make development much more efficient. The structure is well-organized, and the documentation is comprehensive, making it easy to navigate and use. Highly recommended for any developer looking to streamline their workflow!

    Avatar
    user_NuvjWKcb
    2025-04-26

    I've been using mcp-open-library created by 8enSmith, and it's been a game-changer for my projects. The vast collection of resources and user-friendly interface make it an essential tool for developers. Highly recommend checking it out and leveraging its capabilities for your next project!

    Avatar
    user_5zXiNg0E
    2025-04-26

    As a dedicated user of mcp-open-library by 8enSmith, I can confidently say it's a remarkable tool for developers. Its user-friendly interface and comprehensive features make it incredibly easy to manage resources. The seamless integration and reliable performance have significantly boosted my productivity. Highly recommend!

    Avatar
    user_y1ftfvHO
    2025-04-26

    As a dedicated user of the mcp-open-library by 8enSmith, I can't recommend it enough. This library is incredibly well-crafted, making it a breeze to integrate into various projects. The comprehensive documentation and welcoming community make the experience seamless and enjoyable. Whether you're a beginner or a seasoned developer, mcp-open-library is an invaluable resource that enhances productivity and efficiency.