@cyanheads/internet-archive-mcp-server
Provides tools to search the Wayback Machine and Internet Archive library (40M+ items), fetch archived snapshots, retrieve item metadata and full text, enabling AI agents to access historical web content and digital collections.
Public Hosted Server: https://internet-archive.caseyjhand.com/mcp
Overview
The Wayback Machine and Internet Archive library (40M+ items). Find and fetch archived snapshots of any URL, search the library by keyword and metadata, and retrieve item metadata, file manifests, and OCR text.
Tools
Tool | Description |
| Find Wayback Machine snapshots of a URL, by closest timestamp or full capture history |
| Fetch archived page content at a specific Wayback timestamp |
| Search the IA library (40M+ items) by keyword and metadata filters |
| Retrieve full metadata and file manifest for an Archive item |
| Retrieve readable OCR text from a text item, with paging |
Resources
Resource | Description |
| Metadata snapshot for an Archive item — title, creator, mediatype, description, subjects, collections, date, license, publisher and catalog numbers, and file count |
Item resource data is also reachable via ia_get_item.
Agent skill
The internet-archive-guide covers historical comparisons, item identity, and coverage checks. Plugin installs include it, and MCP clients can read it at skill://internet-archive-guide/SKILL.md.
Related MCP server: MCP Wayback Machine Server
Capability reference
ia_find_snapshots tool
Timestamps (
timestamp,from,to) take 1–14 digits (YYYYMMDDHHMMSSor a prefix of it) or an ISO 8601 date or UTC date-time such as2020-06-15or2020-06-15T12:34:56Z. A prefix names a period: asfromit starts the period (2015is January 1, 2015), astoit ends it (2015reaches December 31, 2015), and astimestampit resolves to the capture nearest the period's end (2015can resolve to one from early January 2016)closestmode: returns the nearest capture to a giventimestampvia the Availability API, falling back to one CDX closest-capture query (preferring a200capture) when the Availability API finds no capture or answers 429, or 408, 425, or 5xx after retries, or an HTML or unreadable response. The whole lookup shares one deadline of the request timeout plus 25 s. A timeout, network error, or 4xx refusal from the Availability API does not fall backhistorymode: full capture list via the CDX API; filter by date range (from/to) and HTTP status (status_filter)For an exact URL with
timestamp:Ncollapse, pass the returnedresume_keywith the same URL to continue without skipping the page boundary. The cursor expires after one hour and retains the original filters;limitmay change between pages. An invalid cursor returnsinvalid_resume_key; conflicting explicit filters returnresume_key_conflict. Legacy CDX keys and wildcard histories remain available with a notice that pages may omit capturescollapseistimestamp:8(one capture per day) when omitted or blank; adjustable totimestamp:N, N=1–14, withtimestamp:14listing one row per distinct capture secondUp to 10,000 records per call (
limit, default 100); a largerlimit(up to 150,000) is served as 10,000, settingtruncatedand anoticenamingresume_keywhen captures remain;resume_keypagination for large historiesReplay URLs are always
https://web.archive.org/web/…Typed errors:
missing_timestamp(closest mode without atimestamp, answered before any lookup),invalid_timestamp(atimestamp,from, ortothat is not 1–14 digits or an ISO 8601 date or UTC date-time, or names a date or time that does not exist, answered before any request),no_snapshots(no matches),no_snapshot_available(closest mode, no capture near timestamp from either source; or, in either mode, the Wayback Machine does not serve the URL — a 403, 410, or 451, as for a site excluded from it),cdx_unavailable(CDX 5xx, 429, another 4xx, timeout, network error, or unreadable response, or the closest-mode CDX check did not complete after the Availability API found no capture),availability_unavailable(closest mode, the Availability API failed and the CDX check it fell back to failed too or ran out of time, or the Availability API answered another 4xx, timed out, or could not be reached, none of which falls back); a 429, another 4xx, or a request timeout is answered after one request, a 429 with a hint to wait and a 4xx with a hint that repeating the request will not help
ia_get_snapshot tool
timestamptakes the formsia_find_snapshotsdoes (1–14 digits or an ISO 8601 date or UTC date-time); a blanktimestampreads the latest capture. Resolves to the nearest available capture when the exact timestamp has no snapshot; exact 14-digit timestamps skip resolutionReports the capture Wayback served —
replay_url,resolved_timestamp, andresolved_statusfollow Wayback's redirect when the requested timestamp is not itself a captureAn HTML page is decoded with its declared charset (byte-order mark, then
Content-Type, then<meta>, else UTF-8 when the bytes are valid UTF-8, else Wayback's guessed charset or windows-1252), then scripts, styles, comments, and tags are removed and character references decoded, returning readable plain text alongside the replay URL. Another text type (plain text, JSON, XML, JavaScript) is read as stored from the capture'sid_form, markup and line breaks kept, decoded by the same charset order without the<meta>step. A capture that is not text (a PDF, an image) fails asnon_text_captureReads at most the first 4 MiB of a page (a
noticesays when a page is longer). Long text comes one page at a time:max_chars(default and maximumIA_MAX_SNAPSHOT_CHARS, 50,000 characters) sizes a page andchar_offsetstarts it;has_more,total_chars, and anoticename thechar_offsetand theresolved_timestampto pass astimestampso every page comes from the same captureTyped errors:
invalid_timestamp(atimestampthat is not blank, 1–14 digits, or an ISO 8601 date or UTC date-time, or names a date or time that does not exist, answered before any request),no_snapshot_available(no capture near the timestamp, the capture is an archived error page — the message names its timestamp and archived status — or Wayback refused the replay with a 4xx, or the lookup with a 403, 410, or 451, as it does for a site excluded from the Wayback Machine),non_text_capture(the capture Wayback served is not text; the message names its replay URL),content_fetch_failed(Wayback unreachable, rate-limiting, or timed out during the page fetch, or refusing the unmodified form of a text capture it replayed; the Availability API refused the lookup, timed out, or could not be reached; or the closest-capture lookup and its CDX fallback did not complete within the lookup deadline)
ia_search_items tool
Solr query syntax plus structured filters:
mediatype,collection,creator,language, and date range (date_from/date_to). With a filter,queryis parenthesized so the filter binds to all of itcreatormatches a creator holding every word of the name close together, in any order and case-insensitively, soCharles Dickensalso findsDickens, Charles, 1812-1870; for an exact phrase putcreator:"Charles Dickens"inquery.languagetakes an ISO 639-1, ISO 639-2, or discontinued MARC code or an English name and matches a known language under any of its codes and names (fralso findsfre,fra, andFrench); a two-letter code that is also an English word (am,an,as,be,he,hi,is,it,my,no,or,so,to) is searched only when it is the value given, and an unknown value is matched as given.collectiontakes an identifier or its archive.org details URLDate bounds accept
YYYY,YYYY-MM, orYYYY-MM-DD:date_fromuses the period's first day anddate_toits last day, including leap years. Blank bounds leave that side open; invalid dates returninvalid_date_rangebefore a search requestmediatypetakes the ten Internet Archive media types —texts,movies,audio,software,image,data,web,collection,etree,account— case-insensitively, and resolves common near-misses (text,book,books→texts;movie,video,videos→movies;images→image;collections→collection)Sort by downloads, date, title, or random (
sort, Solr syntax such asdate ascortitleSorter asc; defaultdownloads desc; Advanced Search has no relevance sort). Except underrandom, ties under the sort are ordered byidentifier, so consecutive pages neither repeat nor skip an itemqueryis at most 2,047 characters, the longest Advanced Search accepts; the filters count toward it, and a URL in the query must be quotedUp to 200 results per call (
rows, default 50), 1-indexedpage; on page 1 a largerrows(up to 10,000) is served as 200, settingtruncatedand anoticenamingrows: 200, page: 2when more results remainAdvanced Search serves only the first 10,000 results, so
page × rows ≤ 10,000Output carries
total_found,page, and therowsapplied for pagination; an empty page returns anoticerather than an error — naming every filter applied when nothing matched, or the last page whenpageis past the endtitle,date,creator, andcollectionmay be a string or a list;collectionleaves out per-accountfav-favorites lists, andcreatorlists the first 10 names, withcreator_countwhen a record has moreTyped errors answered before any search request:
invalid_date_range(an invalid date bound),invalid_mediatype(any othermediatype, listing the accepted values),invalid_filter(acreatororlanguagewith no letter or digit, which Advanced Search would ignore and match every item),invalid_query(aqueryending in a backslash that escapes nothing),rows_over_cap(rowsabove 200 past page 1), andpage_limit_exceeded(page × rowspast 10,000, naming the last reachable page)Typed errors from Advanced Search:
invalid_query(it rejected the query syntax, an unquoted URL, a query its filters take past 2,047 characters, or the sort field; its message is relayed) andsearch_unavailable(it failed, rate-limited the request, sent an unreadable response, timed out, or could not be reached); a 5xx or network error is retried, while a 429, another 4xx, a timeout, or an error body is answered after one request, a 4xx with a hint that repeating the request will not help
ia_get_item tool
identifieris an item identifier or an archive.org item URL (/details/,/download/,/metadata/,/stream/, or/embed/form, or a storage-node/<n>/items/<identifier>/…form) read as the identifier it namesReturns
title,creator,description,mediatype,date,subject,collection,licenseurl,rights,language,publisher,volume,isbn,oclc_id,lccn,openlibrary_edition, andopenlibrary_workwhen present in upstream metadata;title,creator,description,date,subject,collection,language,publisher,isbn,oclc_id, andlccnmay be a string or a list.descriptionis plain text, converted from the HTML the Archive stores (paragraphs and<br>become line breaks, a link reads as its label followed by its URL in parentheses)image_count(texts items only: the scanned page images, covers and calibration cards included, not a printed page count) andaccess_restricted(truewhen the item is in an access-restricted collection such as a lending library) are present when they applyfiles[]is one page of the manifest in upstream order —format,size,md5, and a directdownload_urlper file, plusprivate: trueon a file the manifest marks private, whose download the Archive refuses;file_countis always the full manifest sizemax_files(default 50, at most 500 per call) andfile_offset(default 0) page through large items; a largermax_files(up to 300,000) is served as 500. When files remain, the response setstruncatedand names the nextfile_offsetformatkeeps one file type (exact match, case-insensitive — e.g.DjVuTXT,Text PDF,VBR MP3) before paging and reports the match count astotalCount; a format with no matches returns an empty page and a notice listing the formats the item hasTyped errors:
invalid_identifier(anidentifierholding/or:that is not an archive.org item URL, answered before any request),item_not_found(unknown or dark identifiers),archive_unavailable(the Metadata API failed, rate-limited or refused the request, timed out, could not be reached, or sent an unreadable response); a first timeout is retried once, so a call waits at most two request timeouts
ia_get_text tool
max_charsandchar_offsetpage through long documents;has_moresignals additional text remains.max_charsdefaults to and is capped atIA_MAX_SNAPSHOT_CHARS— a larger value is served at that maximum, with anotice, and the outputmax_charsreports the value appliedFor sequential pages, pass
next_continuationback ascontinuationwith the sameidentifier, omittingchar_offset. The cursor expires after one hour, binds the page to the selected text file, and resumes from its byte checkpoint. If a stable file validator or cursor storage is unavailable, the response gives an offset continuation noticeContinuation errors:
ambiguous_paginationwhen both token and offset are supplied,invalid_continuationfor an invalid or changed-file cursor, andrange_unavailablewhen the download cannot resume at the saved range. Recovery names thechar_offsetto useThe upstream read stops at the page's end, so memory per call is bounded by the page size
identifieris an item identifier or an archive.org item URL (/details/,/download/,/stream/,/metadata/, or/embed/form, or a storage-node/<n>/items/<identifier>/…form); a/download/,/stream/, or storage-node URL that names a file reads that file whenfileis omitted, and a continuation must read the file it names. A Wayback Machine URL is rejected: useia_get_snapshotEach call reads one text file: the one
filenames, or by default the first DjVuTXT file, else Text, Plain Text, or another.txtfile (Metadata sidecars excluded).filetakes a name asia_get_itemlists it. When an item holds several readable text files, such as one per volume, anoticegives the count and says to passfilefor anothersource_filenames the file fetched andsource_file_bytesits size in bytes, from the item manifestTyped errors:
invalid_identifier(anidentifierholding/or:that is not an archive.org item URL),invalid_file(file, or the file a URL names, is not in the manifest or is not readable text),item_not_found,no_text_file,download_forbidden(restricted collections),archive_unavailable(the Metadata API or the text download failed, rate-limited or refused the request, timed out, or could not be reached); the metadata request and the download each retry a first timeout once and stop at a second
ia://item/{identifier} resource
Returns
application/json—title,creator,mediatype,description(plain text, as inia_get_item),subject,collection,date,licenseurl,rights,language,publisher,volume,isbn,oclc_id,lccn,openlibrary_edition,openlibrary_work,image_count,access_restricted, andfile_count; each field is omitted when absentidentifiercomes fromia_search_itemsresultsTyped errors:
item_not_foundfor unknown identifiers,archive_unavailablewhen the Metadata API fails
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Internet Archive-specific:
No credentials required — all four APIs are public
Three service layers:
WaybackService(Availability + CDX),ArchiveSearchService(Solr),ArchiveMetadataService(Metadata + downloads)CDX collapse-by-day default and configurable
limitkeep responses tractable for high-capture URLsIdentifies via a custom User-Agent on every request as required by IA's terms of use; configurable via
IA_USER_AGENT
Agent-friendly output:
Pagination context on every list response —
total_found,page,rows(search),resume_key(CDX history), andfile_countplus the nextfile_offset(item files) so agents never have to guess whether results are completeTyped error reasons with recovery hints so callers can retry, correct a filter, or recover an expired continuation without parsing error messages
Structured file manifests —
ia_get_itemreturns file-level metadata (format, size, URL) and aformatfilter, so agents can pick the right file without paging through thumbnails
Getting started
Connect to the hosted instance, no install:
claude mcp add --transport http internet-archive-mcp-server https://internet-archive.caseyjhand.com/mcpOr run it locally:
claude mcp add internet-archive-mcp-server -- npx -y @cyanheads/internet-archive-mcp-serverFor other clients, add this to the MCP config file:
{
"mcpServers": {
"internet-archive-mcp-server": {
"command": "npx",
"args": ["-y", "@cyanheads/internet-archive-mcp-server"]
}
}
}No API key is required. For Docker or a source build, see Running the server.
Configuration
All configuration is validated at startup via Zod schemas in src/config/server-config.ts.
Variable | Description | Default |
| Transport: |
|
| HTTP server port |
|
| Auth mode: |
|
| Log level ( |
|
| Directory for log files (Node.js only) |
|
| Storage backend |
|
| Enable OpenTelemetry instrumentation |
|
| Custom User-Agent for IA API requests |
|
| HTTP request timeout in milliseconds, headers and body. A positive integer — anything else fails startup |
|
| Default and maximum characters per |
|
See .env.example for the full list of optional overrides.
Running the server
Local development
Requires Bun v1.4.4 or higher (or Node.js v24+).
Clone and install:
git clone https://github.com/cyanheads/internet-archive-mcp-server.git cd internet-archive-mcp-server && bun install cp .env.example .env # optional User-Agent and timeout overridesBuild and run:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:httpRun checks and tests:
bun run devcheck # Lint, format, typecheck, security bun run test # Vitest test suite bun run lint:mcp # Validate MCP definitions against spec
Docker
docker run --rm -p 3010:3010 ghcr.io/cyanheads/internet-archive-mcp-server:latestThe image defaults to HTTP transport, stateless session mode, and logs to /var/log/internet-archive-mcp-server. For stdio, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/internet-archive-mcp-server:latest"] in the MCP config. To build locally, docker build -t internet-archive-mcp-server .; OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
Directory | Purpose |
|
|
| Server-specific environment variable parsing and validation with Zod. |
| Tool definitions ( |
| Resource definitions. |
|
|
| Shared modules: HTML-to-text extraction (archived pages and item descriptions), upstream error classification. |
|
|
|
|
| Unit and integration tests mirroring |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storageRegister new tools and resources via the barrels in
src/mcp-server/*/definitions/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Archive MCP — wraps the Internet Archive APIs (free, no auth)
Internet Archive (archive.org) item search & metadata MCP.
Search books and authors across Open Library, the Internet Archive open catalog.
One MCP for the Web. Easily search, crawl, navigate, and extract websites without getting blocked.…
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for the Internet Archive's Wayback Machine. Search archived snapshots, extract page text from a specific date, track how a site has changed over time, check if broken links are recoverable, and perform research across Internet Archive collections.63MIT
- AlicenseAqualityCmaintenanceMCP server and CLI tool for interacting with the Internet Archive's Wayback Machine, supporting full CDX search, snapshot retrieval, screenshot listing, snapshot comparison, and optional authentication.8615 npm65Creative Commons Attribution Non Commercial Share Alike 4.0 International
- AlicenseNot gradedqualityDmaintenanceProvides tools to query the Internet Archive, including enumerating historical captures, listing revisions, reading snapshots as clean text, diffing captures, and searching archived items.57 npmMIT
- AlicenseNot gradedqualityBmaintenanceFull-coverage MCP server for Internet Archive, enabling search, metadata lookup, collection browsing, and Wayback Machine snapshot retrieval via 13 tools.2BSD Zero Clause