AI4L Library

io.github.forever-healthyPublished by GitHub account forever-healthyv0.1.6Updated Nov 7, 2026

Local Markdown library of the papers an evidence review cites: metadata, abstract and full text

Overview

AI-generated overview

Builds a local Markdown library of the papers, drug labels and trial records an evidence review cites, and lets an assistant read and check them piece by piece.

What you can do
  • Fetch and store one cited source per call as files on disk, returning only a small JSON status
  • Check an entry's status or level, or see whether it is missing, without fetching anything
  • Read a stored paper's outline, one section, or paragraphs matching search terms, capped in size
  • Check whether a cited source actually states a given review finding, judged by a decision model
  • Inspect library-wide counts, sizes, retractions, errata and configuration
  • Report the running package version and resolved library directory
When to use it
Useful when you are working through an evidence review and want its cited papers, labels and trial records kept locally so an assistant can look up sections, funding and conflict-of-interest statements, or test whether a source supports a claim.
Requirements
Runs as a local stdio process installed from the npm package ai4l-library. Needs a library directory on disk and network access to fetch records from PubMed, PMC, DailyMed and ClinicalTrials.gov. The verify tool needs a configured decision model endpoint that answers.
Before you install
library_add writes files to the library directory and fetches from external sources, so cited IDs leave your machine. library_verify sends stored paper text to the configured decision model endpoint. Configuration variables such as AI4L_LIBRARY_TIERS are read from the environment or a .env file; library_info reports where each value came from, never the value itself.

Installation

In SourceWeft

  1. Open AI4L Library in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

This repository has no README.

Tools

6

library_add

Build or complete the library entry for one ID and return its status JSON. A drug label (dailymed:<set ID>) is fetched from DailyMed as the current prescribing information, a trial record (nct:<8 digits>, the NCT number's digits; nct:NCT… and a bare NCT… are accepted) from ClinicalTrials.gov as the current record with its posted results; both stored as a full text. A paper is a PMID, or a DOI (doi:10.…): a DOI PubMed indexes is added as its PMID's entry plus a copy under doi: (refreshed on every add of the DOI), one PubMed does not index gets its metadata, funders and update notices from Crossref and its abstract from Crossref, else OpenAlex. For a paper, pubmed gives metadata, abstract and the correction notices (errata, retractions, expressions of concern, updates → citable, comment, corrections); the full-text cascade (pmc, tdm, unpaywall, openalex, user url tiers) is then tried. Idempotent: a full_text entry is returned as is; an abstract entry retries only tiers whose earlier failure was transient and past the cooldown. An entry whose PubMed record is older than refresh_after_days gets the record re-read for new notices; abstract and full text are never touched.

Parametersidrequired

library_status

Read-only status of the library entry for one paper ID: the same status JSON as library_add, or level "missing" when there is no entry. Never fetches.

Parametersidrequired

library_read

Read one small piece of a stored paper's Markdown — never the whole paper. Without section/query: the outline (headings with word counts; says whether the full text or only the abstract is stored). section: a heading from the outline (case-insensitive substring, e.g. "results") → that section's text, capped at max_chars (default 6000). query: search terms → paragraphs containing all terms, each with its section, best first, at most max_hits (default 5); with no hit, the headings. Full texts converted from JATS XML have a "Declarations" section — funding, conflicts of interest, author notes — so section "Declarations" answers who paid and who declares what in one call; a paper without that section states nothing. For abstract-only entries the status carries coi and funding from PubMed. Call without section/query first, then pick. Reads may run in parallel.

Parametersidrequiredquerysectionmax_hitsmax_chars

library_verify

Is one finding of a review stated by one source it cites — a paper, a drug label (dailymed:…) or a trial record (nct:…)? claim: the finding alone, verbatim from the review, without its citations ("IPSS fell 2.3 points more than placebo in men with ED"); id: one of the papers the review cites for it, which must be in the library (library_add first). A finding cited to three papers is three calls with the same claim. Build the claim as a complete statement: subject, intervention, outcome, number — when splitting a sentence leaves a fragment, restore the subject from the sentence; cut what the review adds around the finding (where it was published, who funded it, "in two trials", "pooled data", the review's own inference or advice after "so"); one number set per claim, so split at semicolons too. Statements about the literature as a whole ("no trial has tested"), recommendations and history are not claims. A claim that names a source, joins two findings, or is a fragment is refused. The server reads the paper and asks a decision model; nothing of the paper enters your context. verdict: "pass" (the paper states it; score is the probability), "fail" (its full text was read and does not state it), "na" (only its abstract is in the library and that does not state it, or only its title), or "error" (claim empty, too short, a fragment, naming a source or compound; paper not in the library; no model configured; model failure). basis: full_text, abstract or title. glyphs_unresolved: symbols the paper's PDF font gave no character for (a minus, ±, ≤ …) — when above 0, a fail may be the font, not the paper. superseded: true when the paper carries a stored correction ("Corrected in PubMed abstract") and the claim uses a figure that correction replaced; the verdict is kept, the figure is out of date; null for a paper without a stored correction.

Parametersidrequiredclaimrequired

library_info

Library-wide summary — everything the TUI shows: the library directory and host; the decision model with its endpoint and whether it answers; the entry count and the size on disk (size, size_bytes); per entry type (types) the entries and their levels (full_text, abstract, title) and retractions; entry counts by type and level, counts of retracted and not-citable entries and of entries with errata, expressions of concern and updates, the retrieval tiers in run order and which are off (tiers), the configuration (config: settings, problems, and per variable the source of its value — environment, .env or default — never the value), the decision model behind library_verify (model, endpoint, whether it runs on this machine, and whether it answers right now: ok with the answer time, or the error), the library directory and host. ids=true also lists every entry ID.

Parametersids

get_version

Get the running ai4l-library MCP server's package name and version, and the resolved library directory. Useful to confirm which build is loaded.

Takes no parameters.

Version history

2
  1. v0.1.6LatestNov 7, 2026
  2. v0.1.1Oct 26, 2026

Score

65% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts

    Declare a GitHub repository with a README, or serve resource_documentation in the OAuth protected-resource metadata.

  • License10 pts

    Declare a license in the repository or the registry entry.