Skip to main content
Glama
mcp-open-library

mcp-open-library

MCP Open Library

Trust Score Listed on Spark

Un servidor del Protocolo de Contexto de Modelo (MCP) para la API de Open Library que permite a los asistentes de IA buscar información sobre libros y autores.

Descripción general

Este proyecto implementa un servidor MCP que proporciona herramientas para que los asistentes de IA interactúen con Open Library. Permite buscar información de libros por título, buscar autores por nombre, recuperar información detallada de autores utilizando su clave de Open Library y obtener URLs para fotos de autores utilizando su ID de Open Library (OLID). El servidor devuelve datos estructurados para la información de libros y autores.

Related MCP server: bookstore-mcp-server

Características

  • Búsqueda de libros por título: Buscar libros usando su título (get_book_by_title).

  • Búsqueda de autores por nombre: Buscar autores usando su nombre (get_authors_by_name).

  • Obtener detalles del autor: Recuperar información detallada de un autor específico usando su clave de Open Library (get_author_info).

  • Obtener foto del autor: Obtener la URL de la foto de un autor usando su ID de Open Library (OLID) (get_author_photo).

  • Obtener portada del libro: Obtener la URL de la imagen de portada de un libro usando varios identificadores (ISBN, OCLC, LCCN, OLID, ID) (get_book_cover).

  • Obtener libro por ID: Recuperar información detallada de un libro usando varios identificadores (ISBN, LCCN, OCLC, OLID) (get_book_by_id).

Instalación

Instalación a través de Smithery

Para instalar MCP Open Library para Claude Desktop automáticamente a través de Smithery:

npx -y @smithery/cli install @8enSmith/mcp-open-library --client claude

Instalación manual

# 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

Uso

Ejecución del servidor

  1. Asegúrese de estar ejecutando node v22.21.1 (probablemente funcione en una versión más reciente de node, pero esta es la que estoy usando para esta prueba). Si tiene nvm instalado, ejecute nvm use.

  2. En el directorio raíz de mcp-open-library, ejecute npm run build.

  3. A continuación, ejecute npm run inspector. Una vez compilado, haga clic en la URL con el parámetro de cadena de consulta MCP_PROXY_AUTH_TOKEN para abrir el Inspector.

  4. En el Inspector, elija el transporte 'STDIO'.

  5. Asegúrese de que el comando esté configurado en 'build/index.js'.

  6. Haga clic en el botón 'Connect' en el Inspector; ahora se conectará al servidor.

  7. Haga clic en 'Tools' en la barra de menú superior derecha.

  8. Intente ejecutar una herramienta, por ejemplo, haga clic en get_book_by_title.

  9. Busque un libro, por ejemplo, en el cuadro de título ingrese 'The Hobbit' y luego haga clic en 'Run Tool'. El servidor devolverá los detalles del libro.

Uso con un cliente MCP

Este servidor implementa el Protocolo de Contexto de Modelo, lo que significa que puede ser utilizado por cualquier asistente de IA o cliente compatible con MCP, por ejemplo, Claude Desktop. El servidor expone las siguientes herramientas:

  • get_book_by_title: Buscar información de libros por título

  • get_authors_by_name: Buscar información de autores por nombre

  • get_author_info: Obtener información detallada de un autor específico usando su clave de autor de Open Library

  • get_author_photo: Obtener la URL de la foto de un autor usando su ID de autor de Open Library (OLID)

  • get_book_cover: Obtener la URL de la imagen de portada de un libro usando un identificador específico (ISBN, OCLC, LCCN, OLID o ID)

  • get_book_by_id: Obtener información detallada de un libro usando un identificador específico (ISBN, LCCN, OCLC o OLID)

Ejemplo de entrada para get_book_by_title:

{
  "title": "The Hobbit"
}

Ejemplo de salida para get_book_by_title:

[
  {
    "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"
  }
]

Ejemplo de entrada para get_authors_by_name:

{
  "name": "J.R.R. Tolkien"
}

Ejemplo de salida para get_authors_by_name:

[
  {
    "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
  }
]

Ejemplo de entrada para get_author_info:

{
  "author_key": "OL26320A"
}

Ejemplo de salida para get_author_info:

{
  "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"
  }
}

Ejemplo de entrada para get_author_photo:

{
  "olid": "OL26320A"
}

Ejemplo de salida para get_author_photo:

https://covers.openlibrary.org/a/olid/OL26320A-L.jpg

Ejemplo de entrada para get_book_cover:

{
  "key": "ISBN",
  "value": "9780547928227",
  "size": "L"
}

Ejemplo de salida para get_book_cover:

https://covers.openlibrary.org/b/isbn/9780547928227-L.jpg

La herramienta get_book_cover acepta los siguientes parámetros:

  • key: El tipo de identificador (uno de: ISBN, OCLC, LCCN, OLID o ID)

  • value: El valor del identificador

  • size: Tamaño de portada opcional (S para pequeño, M para mediano, L para grande, el valor predeterminado es L)

Ejemplo de entrada para get_book_by_id:

{
  "idType": "isbn",
  "idValue": "9780547928227"
}

Ejemplo de salida para get_book_by_id:

{
  "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"
}

La herramienta get_book_by_id acepta los siguientes parámetros:

  • idType: El tipo de identificador (uno de: isbn, lccn, oclc, olid)

  • idValue: El valor del identificador

Un ejemplo de esta herramienta siendo utilizada en Claude Desktop se puede ver aquí:

Docker

Puede probar este servidor MCP usando Docker. Para hacer esto, primero ejecute:

docker build -t mcp-open-library .
docker run -p 8080:8080 mcp-open-library

Puede probar el servidor ejecutándose dentro de Docker a través del inspector, por ejemplo:

npm run inspector http://localhost:8080

Desarrollo

Estructura del proyecto

  • src/index.ts - Implementación principal del servidor

  • src/types.ts - Definiciones de tipos de TypeScript

  • src/index.test.ts - Conjunto de pruebas

Scripts disponibles

  • npm run build - Compilar el código TypeScript

  • npm run watch - Observar cambios y recompilar

  • npm test - Ejecutar el conjunto de pruebas

  • npm run format - Formatear código con Prettier

  • npm run inspector - Ejecutar el Inspector MCP contra el servidor

Ejecución de pruebas

npm test

Contribuciones

¡Las contribuciones son bienvenidas! Por favor, siéntase libre de enviar una solicitud de extracción (pull request).

Reconocimientos

Available Tools

7 tools
get_author_infoGet author detailsA
Read-only

Get detailed information for a specific author using their Open Library Author Key (e.g. OL23919A).

Inputs: author_key (required).

get_author_photoGet author photo URLA
Read-only

Get the URL for an author's photo using their Open Library Author ID (OLID e.g. OL23919A). Reports when no photo exists rather than returning a URL to a blank placeholder.

Inputs: olid (required).

get_authors_by_nameFind authors by nameA
Read-only

Search for author information on Open Library. Returns at most limit authors (default 10) together with num_found, the total number of matches; page through them with offset. Each result's key can be passed to get_author_info for that author's full record.

Inputs: name (required), limit, offset.

get_book_by_idGet book by identifierA
Read-only

Get detailed information about a book using its identifier (ISBN, LCCN, OCLC, OLID).

Inputs: idType (required), idValue (required).

get_book_by_titleFind books by titleA
Read-only

Search for a book by its title on Open Library. Returns at most limit results (default 10) together with num_found, the total number of matches; page through them with offset. Each result carries best_edition — one edition of the work, with its isbn_13/isbn_10 where Open Library has them, and its edition_key, which can be passed to get_book_by_id as { idType: "olid" } for that edition's full record.

Inputs: title (required), limit, offset.

get_book_coverGet book cover URLA
Read-only

Get the URL for a book's cover image using a key (ISBN, OCLC, LCCN, OLID, ID) and value. Reports when no cover exists rather than returning a URL to a blank placeholder.

Inputs: key (required), value (required), size.

search_booksSearch booksA
Read-only

Search Open Library across titles, authors, subjects, places, people, publishers and ISBNs. Provide at least one search criterion: q, title, author, subject, place, person, publisher, isbn; combining several narrows the search. Returns at most limit results (default 10) together with num_found, the total number of matches; page through them with offset. Each result carries best_edition — one edition of the work, with its isbn_13/isbn_10 where Open Library has them, and its edition_key, which can be passed to get_book_by_id as { idType: "olid" } for that edition's full record.

Inputs: q, isbn, sort, limit, +8 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 7 tools

    Disambiguation4/5

    Most tools are clearly separated by resource and action, but get_book_by_title overlaps heavily with search_books since it returns the same result structure and is essentially a subset of the general search. The book/author detail and cover/photo tools are unambiguous.

    Naming Consistency4/5

    Naming mostly follows a consistent get_<resource>_by_<qualifier> pattern, e.g. get_book_by_id, get_book_by_title, get_author_photo. search_books breaks the get_ convention but remains readable and predictable alongside the others.

    Tool Count5/5

    Seven tools is well-scoped for a read-only Open Library server. Each tool addresses a distinct lookup need without the collection feeling bloated or thin.

    Completeness4/5

    The surface covers general book search, book lookup by ID/title, author search, author details, author photos, and book covers. Minor gaps exist, such as no direct endpoint for works or edition lists beyond indirection through edition_key, but core reading workflows are covered.

    Maintenance

    ActivityMaintained
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server implementation that can be run directly or through Docker, enabling AI assistants to interact with external systems through the MCP standard.
      2
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that exposes tools for querying a bookstore inventory, allowing AI agents to search and retrieve book information via the Model Context Protocol.
      547 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      An MCP server that enables searching books and authors, fetching editions, browsing subjects, and resolving cover images from Open Library.
      302 npm
      4
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for Google Books API, enabling volume details, ISBN lookup, and bookshelf access via natural language queries.
      149 npm
      1
      MIT