Back to Browse

Books MCP Server

Developer ToolsLow Risk10.0Local
Free

Search the Internet Archive, the Library of Congress and data.bnf.fr at once, in one answer.

About

Search the Internet Archive, the Library of Congress and data.bnf.fr at once, in one answer.

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (1 strong, 1 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry. Trust signals: trusted author (22/24 approved).

3 files analyzed · 1 issue found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

What You'll Need

Set these up before or after installing:

Identify your own client. The project's own identifier is appended, so an archive can always reach a human.Optional

Environment variable: BOOKS_USER_AGENT

Widen the gap between two requests to one archive. Each archive keeps its own spacing when this is unset, and this can only make it wider.Optional

Environment variable: BOOKS_MIN_INTERVAL_MS

Deadline for one request to an archive, in milliseconds. Default 45000.Optional

Environment variable: BOOKS_TIMEOUT_MS

Retries on rate limiting and transient failures. Default 3.Optional

Environment variable: BOOKS_MAX_RETRIES

In-memory cache lifetime, in milliseconds. Default 900000. Set 0 to turn it off.Optional

Environment variable: BOOKS_CACHE_TTL_MS

In-memory cache size. Default 200.Optional

Environment variable: BOOKS_CACHE_MAX_ENTRIES

silent, error, info or debug. Default error. Logs go to stderr.Optional

Environment variable: BOOKS_LOG_LEVEL

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-smeet666-mcp-books": {
      "env": {
        "BOOKS_LOG_LEVEL": "your-books-log-level-here",
        "BOOKS_TIMEOUT_MS": "your-books-timeout-ms-here",
        "BOOKS_USER_AGENT": "your-books-user-agent-here",
        "BOOKS_MAX_RETRIES": "your-books-max-retries-here",
        "BOOKS_CACHE_TTL_MS": "your-books-cache-ttl-ms-here",
        "BOOKS_MIN_INTERVAL_MS": "your-books-min-interval-ms-here",
        "BOOKS_CACHE_MAX_ENTRIES": "your-books-cache-max-entries-here"
      },
      "args": [
        "-y",
        "mcp-books"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

mcp-books

npm CI license MCP Registry Glama M8ven Install in Cursor Install in VS Code

Three great archives hold the scanned record of what was published, and each describes it in its own words. The Internet Archive keeps books, films, recordings and software deposited by anyone, and has run millions of them through optical character recognition. The Library of Congress publishes the national collections of the United States, one catalogue per kind of material. data.bnf.fr publishes the authority records of the Bibliothèque nationale de France, which describe works and the people who wrote them rather than copies.

This server reads all three with one question. You can search the words inside the scanned documents, search the catalogues, and read one record in a single shape whichever archive holds it. It needs no API key and no account.

Version française


Install

One-click install

Install in Cursor Install in VS Code

Claude Code

claude mcp add books -- npx -y mcp-books

Claude Desktop, Cursor, and any client using the standard config format

{
  "mcpServers": {
    "books": {
      "command": "npx",
      "args": ["-y", "mcp-books"]
    }
  }
}

Node 24 or later is required, and no environment variable has to be set.

With Docker

{
  "mcpServers": {
    "books": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "ghcr.io/smeet666/mcp-books:2.0.1"]
    }
  }
}

-i keeps stdin open, which is where the protocol travels, and -t is left out because a TTY rewrites the stream. The container needs outbound HTTPS to archive.org, openlibrary.org, www.loc.gov and data.bnf.fr, and nothing else: no volume, no port, no credential.

Bundle, without npm

Download mcp-books-2.0.1.mcpb from the latest release and open it. A client that supports MCP bundles installs it on its own, with no npm and no configuration file to edit. The bundle carries its dependencies, so nothing is fetched at install time.

What you can ask

  • "Which books mention the Beaumont light-house?"
  • "Find me anything on the 1906 San Francisco earthquake."
  • "Read me that record and tell me who holds the original."
  • "What does the BnF have on that author?"
  • "Search the photographs rather than the books."

An answer takes several seconds: three archives are asked, each at its own pace.

The three sources

SourceArchiveWhat it describes
archivethe Internet Archivedeposited copies, of every kind
locthe Library of Congressthe national collections, one catalogue per kind
bnfthe Bibliothèque nationale de Franceworks and the people who wrote them

A row's id names its archive, so an identifier read from one answer goes back to the right one. Counts are never added across archives, and an archive that failed is reported as having failed rather than as having found nothing.

Tools

ToolWhat it does
search_insideSearches the words inside the scanned documents.
search_itemsSearches the catalogues by title, creator, subject or plain words.
get_itemReads one record in a single shape, whichever archive holds it.

search_inside

Searches the text inside the scanned documents, which came off the page through optical character recognition.

ArgumentTypeRequiredWhat it does
querystring, 2 to 300 charactersyesThe phrase to look for inside the documents.
limitinteger, 1 to 25, default 3noMatches to keep from each archive.
pageinteger, 1 to 100, default 1noWhich page of matches.
max_excerpt_charsinteger, 80 to 1200, default 300noHow much of a passage to serve.
max_excerpts_per_matchinteger, 1 to 10, default 2noPassages served per matching document.
fan_outboolean, default truenoAsk every archive rather than stopping at the first that answers.
sourcesarray of source idsnoAsk these archives alone.

In return: hits, each carrying id, which get_item takes and which names its archive; source and source_name; the archive's own identifier without the prefix; title, creator and year; page_number where the archive states one; excerpts; and excerpt_kind.

excerpt_kind decides what an excerpt is worth. A passage is the text around the words that matched. A page_opening is the start of the page, sent because the machine-read text the archive returned stops before those words appear: it does not carry the match, so quoting it quotes something else. All the excerpts of one match are of one kind.

search_items

Searches the catalogues.

ArgumentTypeRequiredWhat it does
querystring, 1 to 300 charactersyesA title, a creator, a subject, or plain words.
media_typea kind one of the archives holdsnoWhich kind of material to search.
year_frominteger, 1000 to 2100noEarliest year.
year_tointeger, 1000 to 2100noLatest year.
sortrelevance, newest, oldest or title, default relevancenoHow the rows are ordered.
limitinteger, 1 to 25, default 5noRows to keep from each archive.
pageinteger, 1 to 100, default 1noWhich page of rows.
fan_outboolean, default truenoAsk every archive.
sourcesarray of source idsnoAsk these archives alone.

The three archives divide their material differently. The Internet Archive searches every kind at once when none is named; the Library of Congress is one route per kind, so a search naming none is told which one was read; and the BnF search reads works. A media_type one archive has no notion of leaves that archive out, and the answer says so.

In return: rows in the shape a hit carries, with per_source giving one report per archive: its status, the count it contributed, its reported_total and reported_total_means, which says what that number counts there.

get_item

Reads one record in a single shape, whichever archive holds it.

ArgumentTypeRequiredWhat it does
identifierstring, 1 to 500 charactersyesThe id a row carries.
sectionsarray of description, subjects, copies, context, default ["description"]noWhich parts to return.
max_copiesinteger, 1 to 50, default 10noCopies to list.
text_offsetinteger, 0 to 1000000, default 0noWhere to resume the text.
max_text_charsinteger, 200 to 8000, default 1500noHow much text to serve.

In return: the record with its id, source and source_name, the archive's own identifier, title, creator, date exactly as published, and year beside year_means, which says what that year is the year of, since the three archives date a record differently. attribution is what that archive asks to be credited with, and identifier_provisional says when the identifier was built rather than read, so a caller knows it may not resolve.

What an answer states about the archives

Every answer accounts for each archive separately. One that failed, one nobody asked, and one that answered with nothing are three different things, and they are reported as three. A total stays beside the archive that published it, with what that archive counts when it says it: one counts documents, another counts newspaper leaves.

What scanned text is worth

The words inside a scanned document came off the page through optical character recognition. An excerpt carries the misreadings of that process, and it is served as it was read rather than corrected. Quote it as scanned text, and link the record so a reader can look at the page.

Configuration

Every variable is optional. Set them in the env block of your client config.

VariableDefaultWhat it does
BOOKS_USER_AGENTthe project identityNames your application to the three archives, with an address where a person can be reached.
BOOKS_MIN_INTERVAL_MSeach archive's own paceWidens the gap between two requests to one archive, from 500 to 60000. Left unset, every archive keeps the pace it publishes, and a figure set here applies only where it is wider.
BOOKS_TIMEOUT_MS45000Deadline for one request, from 1000 to 120000.
BOOKS_MAX_RETRIES3Attempts after a transient failure, from 0 to 8.
BOOKS_CACHE_TTL_MS900000How long an answer stays in memory, from 0 to 86400000.
BOOKS_CACHE_MAX_ENTRIES200Answers held in memory at once, from 1 to 5000.
BOOKS_LOG_LEVELerrorsilent, error, info or debug, written to stderr.

A value outside its range falls back to the default, and the reason is written to stderr.

Errors

Every failure carries one of six codes, a message, and where it helps a hint naming the next move.

CodeWhat happenedWhat to do
not_foundAn archive answered, and holds no such record.Check the identifier with search_items.
invalid_inputThe arguments were refused before any request went out.Read the message, which names the argument.
rate_limitedAn archive asked this client to slow down.Wait, then call again with the same arguments. The record is still there.
parse_failureAn answer arrived in a shape this client cannot read.Report it at the issue tracker.
network_errorThe request did not complete.Try again shortly.
timeoutThe request passed its deadline.Raise BOOKS_TIMEOUT_MS, or ask for fewer rows.

An archive that failed is reported per archive rather than failing the whole answer, so one silent archive never hides the others.

As a library

The layer reading the three archives is published on its own, with its pacing, its cache and its errors, and with no protocol attached.

import { BooksClient } from "mcp-books/client";

const client = new BooksClient();
const read = await client.searchItems({ query: "beaumont light-house", limit: 3 });
console.log(read.data.rows.length);

Each read answers { data, cached }, and throws an error carrying one of the six codes. Each archive keeps its own pace, and its floor holds here as well.

Pacing and attribution

Each archive is paced on its own, one request at a time, and the widest of its own floor and the configured interval governs: the Library of Congress publishes the slowest, and asking all three at once therefore costs each of them one request rather than three. The User-Agent always ends with the project identity and an address where a person can be reached.

Every record carries the address of its page and the attribution its archive asks for. The Internet Archive items belong to their depositors, the Library of Congress records state their own rights, and the BnF asks that the source and the date of retrieval be stated wherever its metadata are shown.

This MCP server is an unofficial project, with no affiliation to any of the archives it reads.

Privacy

This server collects nothing about you and sends nothing to its author. It runs on your machine, contacts archive.org, openlibrary.org, www.loc.gov and data.bnf.fr and nothing else, holds its answers in memory while it runs, and writes nothing to disk. PRIVACY.md states what a request carries and which settings change any of it.

Development

npm install
npm run build:fixtures
npm test
npm run check

Tests run against generated fixtures and make no network request. The live suite, npm run test:live, makes one request per route and runs nightly against the archives themselves.

Contributing

Bugs, questions and ideas belong in the issue tracker. Pull requests are welcome; opening an issue first helps agree on the shape of the change. See CONTRIBUTING.md.

License

MIT, see LICENSE. The records belong to the archives that published them and to their depositors.


mcp-books (français)

English version

Trois grandes archives conservent la trace numérisée de ce qui a été publié, et chacune la décrit dans ses propres mots. L'Internet Archive garde les livres, les films, les enregistrements et les logiciels que chacun y dépose, et en a passé des millions par la reconnaissance optique de caractères. La Library of Congress publie les collections nationales des États-Unis, un catalogue par type de document. data.bnf.fr publie les notices d'autorité de la Bibliothèque nationale de France, qui décrivent des œuvres et ceux qui les ont écrites plutôt que des exemplaires.

Ce serveur lit les trois avec une seule question. On peut chercher dans les mots contenus dans les documents numérisés, chercher dans les catalogues, et lire une notice sous une forme unique quelle que soit l'archive qui la détient. Aucune clé d'API, aucun compte.

Installation

Installation en un clic

Install in Cursor Install in VS Code

Claude Code

claude mcp add books -- npx -y mcp-books

Claude Desktop, Cursor, et tout client au format de configuration standard

{
  "mcpServers": {
    "books": {
      "command": "npx",
      "args": ["-y", "mcp-books"]
    }
  }
}

Node 24 ou plus récent est nécessaire, et aucune variable d'environnement n'est à renseigner.

Avec Docker

{
  "mcpServers": {
    "books": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "ghcr.io/smeet666/mcp-books:2.0.1"]
    }
  }
}

-i garde l'entrée standard ouverte, qui est le canal du protocole, et -t est omis parce qu'un TTY réécrit le flux. Le conteneur a besoin d'un accès HTTPS sortant vers archive.org, openlibrary.org, www.loc.gov et data.bnf.fr, et de rien d'autre : aucun volume, aucun port, aucun identifiant.

Bundle, sans npm

Téléchargez mcp-books-2.0.1.mcpb depuis la dernière publication et ouvrez-le. Un client qui gère les bundles MCP l'installe seul, sans npm et sans fichier de configuration à modifier. Le bundle emporte ses dépendances, donc rien n'est téléchargé à l'installation.

Ce qu'on peut demander

  • « Quels livres mentionnent le phare de Beaumont ? »
  • « Trouve-moi ce qu'il y a sur le tremblement de terre de San Francisco en 1906. »
  • « Lis-moi cette notice et dis-moi qui conserve l'original. »
  • « Qu'est-ce que la BnF a sur cet auteur ? »
  • « Cherche dans les photographies plutôt que dans les livres. »

Une réponse prend plusieurs secondes : trois archives sont interrogées, chacune à son rythme.

Les trois sources

SourceArchiveCe qu'elle décrit
archivel'Internet Archiveles exemplaires déposés, de tout type
locla Library of Congressles collections nationales, un catalogue par type
bnfla Bibliothèque nationale de Franceles œuvres et ceux qui les ont écrites

L'id d'une ligne nomme son archive, donc un identifiant lu dans une réponse retourne vers la bonne. Les comptes ne sont jamais additionnés entre archives, et une archive qui a échoué est rapportée comme ayant échoué plutôt que comme n'ayant rien trouvé.

Les outils

OutilCe qu'il fait
search_insideCherche dans les mots contenus dans les documents numérisés.
search_itemsCherche dans les catalogues par titre, auteur, sujet ou mots simples.
get_itemLit une notice sous une forme unique, quelle que soit l'archive.

search_inside

Cherche dans le texte contenu dans les documents numérisés, texte issu de la reconnaissance optique de caractères.

ArgumentTypeRequisCe qu'il fait
querychaîne, 2 à 300 caractèresouiLa phrase à chercher dans les documents.
limitentier, 1 à 25, défaut 3nonCorrespondances à garder de chaque archive.
pageentier, 1 à 100, défaut 1nonQuelle page de correspondances.
max_excerpt_charsentier, 80 à 1200, défaut 300nonLa longueur de passage à servir.
max_excerpts_per_matchentier, 1 à 10, défaut 2nonPassages servis par document correspondant.
fan_outbooléen, défaut truenonInterroger chaque archive plutôt que s'arrêter à la première qui répond.
sourcestableau d'identifiants de sourcenonN'interroger que ces archives.

En retour : hits, chacun portant id, que get_item reprend et qui nomme son archive ; source et source_name ; l'identifier propre à l'archive, sans le préfixe ; title, creator et year ; page_number là où l'archive en indique un ; excerpts ; et excerpt_kind.

excerpt_kind décide de ce que vaut un extrait. Un passage est le texte autour des mots trouvés. Un page_opening est le début de la page, envoyé parce que le texte lu par machine que l'archive a rendu s'arrête avant que ces mots apparaissent : il ne porte pas la correspondance, donc le citer cite autre chose. Tous les extraits d'une correspondance sont d'un seul type.

search_items

Cherche dans les catalogues.

ArgumentTypeRequisCe qu'il fait
querychaîne, 1 à 300 caractèresouiUn titre, un auteur, un sujet, ou des mots simples.
media_typeun type que l'une des archives détientnonLe type de document à chercher.
year_fromentier, 1000 à 2100nonAnnée la plus ancienne.
year_toentier, 1000 à 2100nonAnnée la plus récente.
sortrelevance, newest, oldest ou title, défaut relevancenonL'ordre des lignes.
limitentier, 1 à 25, défaut 5nonLignes à garder de chaque archive.
pageentier, 1 à 100, défaut 1nonQuelle page de lignes.
fan_outbooléen, défaut truenonInterroger chaque archive.
sourcestableau d'identifiants de sourcenonN'interroger que ces archives.

Les trois archives découpent leurs fonds différemment. L'Internet Archive cherche dans tous les types à la fois quand aucun n'est nommé ; la Library of Congress a une route par type, donc une recherche qui n'en nomme aucun se voit dire lequel a été lu ; et la recherche de la BnF lit des œuvres. Un media_type dont une archive n'a pas la notion l'écarte de la réponse, et la réponse le dit.

En retour : des lignes dans la forme d'un hit, avec per_source qui donne un rapport par archive : son status, le count qu'elle a fourni, son reported_total et reported_total_means, qui dit ce que ce nombre compte là-bas.

get_item

Lit une notice sous une forme unique, quelle que soit l'archive qui la détient.

ArgumentTypeRequisCe qu'il fait
identifierchaîne, 1 à 500 caractèresouiL'id que porte une ligne.
sectionstableau de description, subjects, copies, context, défaut ["description"]nonLes parties à rendre.
max_copiesentier, 1 à 50, défaut 10nonExemplaires à lister.
text_offsetentier, 0 à 1000000, défaut 0nonOù reprendre le texte.
max_text_charsentier, 200 à 8000, défaut 1500nonLa longueur de texte à servir.

En retour : la notice avec son id, source et source_name, l'identifier propre à l'archive, title, creator, date exactement telle que publiée, et year accompagné de year_means, qui dit de quoi cette année est l'année, les trois archives datant une notice différemment. attribution est ce que cette archive demande qu'on lui crédite, et identifier_provisional dit quand l'identifiant a été construit plutôt que lu, pour qu'un appelant sache qu'il peut ne pas résoudre.

Ce qu'une réponse dit des archives

Chaque réponse rend compte de chaque archive séparément. Une qui a échoué, une que personne n'a interrogée et une qui a répondu vide sont trois choses différentes, et elles sont rapportées comme trois. Un total reste à côté de l'archive qui l'a publié, avec ce que cette archive compte en le disant : l'une compte des documents, une autre des feuillets de journaux.

Ce que vaut un texte numérisé

Les mots contenus dans un document numérisé sont issus de la reconnaissance optique de caractères. Un extrait porte les erreurs de lecture de ce procédé, et il est servi tel qu'il a été lu plutôt que corrigé. Citez-le comme un texte numérisé, et liez la notice pour qu'un lecteur puisse regarder la page.

Configuration

Chaque variable est facultative. Elles se posent dans le bloc env de la configuration du client.

VariableDéfautCe qu'elle fait
BOOKS_USER_AGENTl'identité du projetNomme votre application auprès des trois archives, avec une adresse où joindre une personne.
BOOKS_MIN_INTERVAL_MSle rythme propre à chaque archiveÉlargit l'écart entre deux requêtes vers une même archive, de 500 à 60000. Non posée, chaque archive garde le rythme qu'elle publie, et une valeur posée ici ne s'applique que là où elle est plus large.
BOOKS_TIMEOUT_MS45000Délai d'une requête, de 1000 à 120000.
BOOKS_MAX_RETRIES3Tentatives après un échec passager, de 0 à 8.
BOOKS_CACHE_TTL_MS900000Durée pendant laquelle une réponse reste en mémoire, de 0 à 86400000.
BOOKS_CACHE_MAX_ENTRIES200Réponses gardées en mémoire à la fois, de 1 à 5000.
BOOKS_LOG_LEVELerrorsilent, error, info ou debug, écrit sur la sortie d'erreur.

Une valeur hors de sa plage retombe sur le défaut, et la raison est écrite sur la sortie d'erreur.

Erreurs

Chaque échec porte un des six codes, un message, et quand cela aide une indication du geste suivant.

CodeCe qui s'est passéQue faire
not_foundUne archive a répondu, et n'a pas cette notice.Vérifiez l'identifiant avec search_items.
invalid_inputLes arguments ont été refusés avant toute requête.Lisez le message, qui nomme l'argument.
rate_limitedUne archive demande à ce client de ralentir.Attendez, puis rappelez avec les mêmes arguments. La notice est toujours là.
parse_failureUne réponse est arrivée dans une forme illisible ici.Signalez-le sur le suivi d'incidents.
network_errorLa requête n'a pas abouti.Réessayez sous peu.
timeoutLa requête a dépassé son délai.Augmentez BOOKS_TIMEOUT_MS, ou demandez moins de lignes.

Une archive qui échoue est rapportée archive par archive plutôt que de faire échouer toute la réponse, donc une archive silencieuse n'en cache jamais d'autres.

Comme bibliothèque

La couche qui lit les trois archives est publiée seule, avec son rythme, son cache et ses erreurs, sans protocole attaché.

import { BooksClient } from "mcp-books/client";

const client = new BooksClient();
const read = await client.searchItems({ query: "beaumont light-house", limit: 3 });
console.log(read.data.rows.length);

Chaque lecture répond { data, cached }, et lève une erreur portant un des six codes. Chaque archive garde son propre rythme, et son plancher tient également ici.

Rythme et attribution

Chaque archive est cadencée pour elle-même, une requête à la fois, et c'est le plus large de son propre plancher et de l'intervalle configuré qui gouverne : la Library of Congress publie le plus lent, et interroger les trois à la fois coûte donc à chacune une requête plutôt que trois. Le User-Agent se termine toujours par l'identité du projet et une adresse où joindre une personne.

Chaque notice porte l'adresse de sa page et l'attribution que son archive demande. Les documents de l'Internet Archive appartiennent à ceux qui les ont déposés, les notices de la Library of Congress énoncent leurs propres droits, et la BnF demande que la source et la date de récupération soient indiquées partout où ses métadonnées sont montrées.

Ce MCP est un projet non officiel, sans affiliation à aucune des archives qu'il lit.

Confidentialité

Ce serveur ne collecte rien sur vous et n'envoie rien à son auteur. Il tourne sur votre machine, ne joint que archive.org, openlibrary.org, www.loc.gov et data.bnf.fr, garde ses réponses en mémoire le temps qu'il tourne, et n'écrit rien sur le disque. PRIVACY.md dit ce qu'une requête emporte et quels réglages changent cela.

Développement

npm install
npm run build:fixtures
npm test
npm run check

Les tests s'exécutent sur des fixtures engendrées et n'émettent aucune requête. La suite en direct, npm run test:live, émet une requête par route et tourne chaque nuit contre les archives elles-mêmes.

Contribuer

Les anomalies, les questions et les idées ont leur place dans le suivi d'incidents. Les propositions de modification sont bienvenues ; ouvrir un ticket d'abord aide à s'accorder sur la forme du changement. Voir CONTRIBUTING.md.

Licence

MIT, voir LICENSE. Les notices appartiennent aux archives qui les ont publiées et à ceux qui les y ont déposées.

Reviews

No reviews yet

Be the first to review this server!