mcp-open-library
MCP Open Library
Сервер протокола контекста модели (MCP) для API Open Library, который позволяет ИИ-ассистентам искать информацию о книгах и авторах.
Обзор
Этот проект реализует MCP-сервер, предоставляющий инструменты для взаимодействия ИИ-ассистентов с Open Library. Он позволяет искать информацию о книгах по названию, искать авторов по имени, получать подробную информацию об авторе с помощью его ключа Open Library и получать URL-адреса фотографий авторов с помощью их идентификатора Open Library (OLID). Сервер возвращает структурированные данные об информации о книгах и авторах.
Related MCP server: bookstore-mcp-server
Функции
Поиск книг по названию: Поиск книг по их названию (
get_book_by_title).Поиск авторов по имени: Поиск авторов по их имени (
get_authors_by_name).Получение подробной информации об авторе: Получение подробной информации о конкретном авторе с помощью его ключа Open Library (
get_author_info).Получение фотографии автора: Получение URL-адреса фотографии автора с помощью его идентификатора Open Library (OLID) (
get_author_photo).Получение обложки книги: Получение URL-адреса обложки книги с помощью различных идентификаторов (ISBN, OCLC, LCCN, OLID, ID) (
get_book_cover).Получение книги по ID: Получение подробной информации о книге с помощью различных идентификаторов (ISBN, LCCN, OCLC, OLID) (
get_book_by_id).
Установка
Установка через Smithery
Чтобы автоматически установить MCP Open Library для Claude Desktop через Smithery:
npx -y @smithery/cli install @8enSmith/mcp-open-library --client claudeРучная установка
# 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Использование
Запуск сервера
Убедитесь, что вы используете node v22.21.1 (вероятно, будет работать и на более новой версии node, но именно её я использую для этого теста). Если у вас установлен
nvm, выполнитеnvm use.В корневом каталоге
mcp-open-libraryвыполнитеnpm run buildЗатем выполните
npm run inspector. После сборки нажмите на URL с параметром строки запросаMCP_PROXY_AUTH_TOKEN, чтобы открыть инспектор.В инспекторе выберите транспорт 'STDIO'
Убедитесь, что команда установлена на 'build/index.js'
Нажмите кнопку 'Connect' в инспекторе — теперь вы подключитесь к серверу
Нажмите 'Tools' в верхнем правом меню
Попробуйте запустить инструмент, например, нажмите get_book_by_title
Найдите книгу, например, в поле названия введите 'The Hobbit' и нажмите 'Run Tool'. Сервер вернет подробную информацию о книге.
Использование с MCP-клиентом
Этот сервер реализует протокол контекста модели, что означает, что его может использовать любой совместимый с MCP ИИ-ассистент или клиент, например Claude Desktop. Сервер предоставляет следующие инструменты:
get_book_by_title: Поиск информации о книге по названиюget_authors_by_name: Поиск информации об авторе по имениget_author_info: Получение подробной информации о конкретном авторе с помощью ключа автора Open Libraryget_author_photo: Получение URL-адреса фотографии автора с помощью идентификатора автора Open Library (OLID)get_book_cover: Получение URL-адреса обложки книги с помощью конкретного идентификатора (ISBN, OCLC, LCCN, OLID или ID)get_book_by_id: Получение подробной информации о книге с помощью конкретного идентификатора (ISBN, LCCN, OCLC или OLID)
Пример ввода get_book_by_title:
{
"title": "The Hobbit"
}Пример вывода 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"
}
]Пример ввода get_authors_by_name:
{
"name": "J.R.R. Tolkien"
}Пример вывода 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
}
]Пример ввода get_author_info:
{
"author_key": "OL26320A"
}Пример вывода 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"
}
}Пример ввода get_author_photo:
{
"olid": "OL26320A"
}Пример вывода get_author_photo:
https://covers.openlibrary.org/a/olid/OL26320A-L.jpgПример ввода get_book_cover:
{
"key": "ISBN",
"value": "9780547928227",
"size": "L"
}Пример вывода get_book_cover:
https://covers.openlibrary.org/b/isbn/9780547928227-L.jpgИнструмент get_book_cover принимает следующие параметры:
key: Тип идентификатора (один из:ISBN,OCLC,LCCN,OLIDилиID)value: Значение идентификатораsize: Необязательный размер обложки (Sдля маленького,Mдля среднего,Lдля большого, по умолчаниюL)
Пример ввода get_book_by_id:
{
"idType": "isbn",
"idValue": "9780547928227"
}Пример вывода 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"
}Инструмент get_book_by_id принимает следующие параметры:
idType: Тип идентификатора (один из:isbn,lccn,oclc,olid)idValue: Значение идентификатора
Пример использования этого инструмента в Claude Desktop можно увидеть здесь:
Docker
Вы можете протестировать этот MCP-сервер с помощью Docker. Для этого сначала выполните:
docker build -t mcp-open-library .
docker run -p 8080:8080 mcp-open-libraryЗатем вы можете протестировать сервер, работающий внутри Docker, через инспектор, например:
npm run inspector http://localhost:8080Разработка
Структура проекта
src/index.ts- Основная реализация сервераsrc/types.ts- Определения типов TypeScriptsrc/index.test.ts- Набор тестов
Доступные скрипты
npm run build- Сборка кода TypeScriptnpm run watch- Отслеживание изменений и пересборкаnpm test- Запуск набора тестовnpm run format- Форматирование кода с помощью Prettiernpm run inspector- Запуск MCP Inspector для сервера
Запуск тестов
npm testВклад
Вклад приветствуется! Пожалуйста, не стесняйтесь отправлять pull request.
Благодарности
Available Tools
7 toolsget_author_infoGet author detailsARead-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 URLARead-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 nameARead-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 identifierARead-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 titleARead-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 URLARead-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 booksARead-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
Scored across 7 tools
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 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.
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.
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
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
A Model Context Protocol server for Wix AI tools
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- FlicenseBqualityDmaintenanceA 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-
- AlicenseNot gradedqualityDmaintenanceAn 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 npm1MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that enables searching books and authors, fetching editions, browsing subjects, and resolving cover images from Open Library.302 npm4Apache 2.0
- AlicenseNot gradedqualityCmaintenanceMCP server for Google Books API, enabling volume details, ISBN lookup, and bookshelf access via natural language queries.149 npm1MIT