About internet-archive-mcp-server
An MCP server for searching Internet Archive collections and Wayback Machine captures, for agents and clients that need archived pages, item metadata, or OCR text. It combines snapshot lookup and replay with filtered catalog search and paged file and text retrieval.
Key features
- 01Search Wayback captures and archived pages
- 02Search the Internet Archive catalog
- 03Retrieve item metadata and file manifests
- 04Read paginated OCR text
- 05Expose item metadata as a resource
Use cases
- 01Find an archived version of a URL
- 02Search for Archive items by keyword or metadata
- 03Inspect an item's files before downloading
- 04Retrieve OCR text from a digitized document
MCP support
Exposes five tools and an item metadata resource to MCP clients. Supports STDIO and Streamable HTTP; a public hosted server is also available.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://internet-archive.caseyjhand.com/mcpclaude mcp add --transport http cyanheads-internet-archive https://internet-archive.caseyjhand.com/mcp{"mcpServers":{"cyanheads-internet-archive":{"type":"http","url":"https://internet-archive.caseyjhand.com/mcp"}}}Open in Cursor{"servers":{"cyanheads-internet-archive":{"type":"http","url":"https://internet-archive.caseyjhand.com/mcp"}}}Open in VS Code{"mcpServers":{"cyanheads-internet-archive":{"type":"http","url":"https://internet-archive.caseyjhand.com/mcp"}}}{"mcpServers":{"cyanheads-internet-archive":{"serverUrl":"https://internet-archive.caseyjhand.com/mcp"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
5| Parameter | Type | Required | Description |
|---|---|---|---|
| to | string | No | End of date range filter in YYYYMMDD format (history mode only). Example: "20231231". |
| url | string | Yes | The URL to look up in the Wayback Machine. |
| from | string | No | Start of date range filter in YYYYMMDD format (history mode only). Example: "20200101". |
| mode | enum | Yes | Lookup mode: "closest" returns the single nearest snapshot to the given timestamp; "history" returns the paginated full capture list via the CDX API.closest | history |
| limit | integer | No | Maximum number of CDX records to return (history mode only, default 100). |
| collapse | any | No | CDX collapse parameter (history mode only). Format: "timestamp:N" where N is 1–14 (4=year, 6=month, 8=day, 10=hour, 14=exact). Default "timestamp:8" collapses to one per day. Pass an empty string or omit to get uncollapsed results. |
| timestamp | string | No | Target timestamp in YYYYMMDDHHMMSS format (or any prefix thereof). Required for mode=closest. Example: "20200101" for January 1, 2020. |
| resume_key | string | No | Opaque pagination key from a previous history mode response. Pass this to continue from where the last page left off. |
| status_filter | any | No | Filter CDX results to a specific HTTP status code (history mode only). Must be a 3-digit numeric code. Example: "200" to return only successful captures. |
Details
From the project README@cyanheads/internet-archive-mcp-server
Search the Wayback Machine and IA library (40M+ items), fetch archived snapshots, retrieve item metadata and full text via MCP. STDIO or Streamable HTTP.
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 |
|---|---|
ia_find_snapshots | Find Wayback Machine snapshots of a URL, by closest timestamp or full capture history |
ia_get_snapshot | Fetch archived page content at a specific Wayback timestamp |
ia_search_items | Search the IA library (40M+ items) by keyword and metadata filters |
ia_get_item | Retrieve full metadata and file manifest for an Archive item |
ia_get_text | Retrieve readable OCR text from a text item, with paging |
Resources
| Resource | Description |
|---|---|
ia://item/{identifier} | Metadata snapshot for an Archive item — title, creator, mediatype, description, subjects, collections, date, license, and file count |
All resource data is also reachable via ia_get_item.
Capability reference
ia_find_snapshots tool
closestmode: returns the nearest capture to a giventimestampvia the Availability API, falling back to one CDX closest-capture query (preferring a200capture, 25 s deadline) when the Availability API has no answerhistorymode: 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 captures collapseistimestamp:8(one capture per day) when omitted or blank; adjustable totimestamp:N, N=1–14, withtimestamp:14listing one row per distinct capture second- Up 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 histories - Replay URLs are always
https://web.archive.org/web/… - Typed errors:
missing_timestamp(closest mode without atimestamp, answered before any lookup),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),availability_unavailable(closest mode, Availability API 5xx, 429, another 4xx, timeout, network error, or unreadable response); 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
- Resolves to the nearest available capture when the exact timestamp has no snapshot; exact 14-digit timestamps skip resolution
- Reports the capture Wayback served —
replay_url,resolved_timestamp, andresolved_statusfollow Wayback's redirect when the requested timestamp is not itself a capture - Decodes the page with its declared charset (
Content-Type, then<meta>, else UTF-8 when the bytes are valid UTF-8, else Wayback's guessed charset or windows-1252), then removes scripts, styles, comments, and tags and decodes character references, returning readable plain text alongside the replay URL - Reads at most the first 4 MiB of a page (a
noticesays when a page is longer); output capped atIA_MAX_SNAPSHOT_CHARS(default 50,000 characters) - Typed errors:
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),content_fetch_failed(Wayback unreachable, rate-limiting, refusing the lookup, or timed out during lookup or fetch)
ia_search_items tool
- Solr query syntax plus structured filters:
mediatype,collection,creator,language, and date range (date_from/date_to) - Date 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 request mediatypetakes 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). Ties under the sort are ordered byidentifier, so consecutive pages neither repeat nor skip an item queryis at most 2,047 characters, the longest Advanced Search accepts; the filters count toward it, and a URL in the query must be quoted- Up 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 remain - Advanced Search serves only the first 10,000 results, so
page × rows ≤ 10,000 - Output carries
total_found,page, and therowsapplied for pagination; an empty page returns anoticerather than an error — naming themediatypeapplied when nothing matched, or the last page whenpageis past the end title,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 more- Typed errors answered before any search request:
invalid_date_range(an invalid date bound),invalid_mediatype(any othermediatype, listing the accepted values),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
- Returns
title,creator,description,subject,collection,licenseurl,rights, andlanguagewhen present in upstream metadata;creator,description,subject,collection, andlanguagemay be a string or a list files[]is one page of the manifest in upstream order —format,size,md5, and a directdownload_urlper file;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 has- Typed errors:
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 applied- For 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 notice - Continuation 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 use - The upstream read stops at the page's end, so memory per call is bounded by the page size
- Locates the best available text file — DjVuTXT preferred, falls back to plain text;
source_filenames the file fetched andsource_file_bytesits size in bytes, from the item manifest - Typed errors:
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,subject,collection,date,licenseurl,rights,language, andfile_count identifiercomes fromia_search_itemsresults- Typed 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 URLs - Identifies 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 complete - Typed 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
Public Hosted Instance
A public instance is available at https://internet-archive.caseyjhand.com/mcp — no installation required. It serves Streamable HTTP; each client takes its own configuration shape.
For Claude Code:
claude mcp add --transport http internet-archive-mcp-server https://internet-archive.caseyjhand.com/mcp
For Cline (cline_mcp_settings.json):
{
"mcpServers": {
"internet-archive-mcp-server": {
"type": "streamableHttp",
"url": "https://internet-archive.caseyjhand.com/mcp"
}
}
}
For Cursor (mcp.json):
{
"mcpServers": {
"internet-archive-mcp-server": {
"url": "https://internet-archive.caseyjhand.com/mcp"
}
}
}
Claude Desktop adds remote servers under Settings → Connectors.
Self-Hosted / Local
No API key required — the Internet Archive's APIs are fully public.
Add the following to your MCP client configuration file:
{
"mcpServers": {
"internet-archive-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/internet-archive-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"internet-archive-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/internet-archive-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with Docker:
{
"mcpServers": {
"internet-archive-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"ghcr.io/cyanheads/internet-archive-mcp-server:latest"
]
}
}
}
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcp
Prerequisites
- Bun v1.4.0 or higher (or Node.js v24+).
- No external accounts or API keys required.
Installation
- Clone the repository:
git clone https://github.com/cyanheads/internet-archive-mcp-server.git
- Navigate into the directory:
cd internet-archive-mcp-server
- Install dependencies:
bun install
- Configure environment:
cp .env.example .env
# Optional: edit .env for custom User-Agent, timeouts, etc.
Configuration
All configuration is validated at startup via Zod schemas in src/config/server-config.ts.
| Variable | Description | Default |
|---|---|---|
MCP_TRANSPORT_TYPE | Transport: stdio or http | stdio |
MCP_HTTP_PORT | HTTP server port | 3010 |
MCP_AUTH_MODE | Auth mode: none, jwt, or oauth | none |
MCP_LOG_LEVEL | Log level (debug, info, notice, warning, error) | info |
LOGS_DIR | Directory for log files (Node.js only) | <project-root>/logs |
STORAGE_PROVIDER_TYPE | Storage backend | in-memory |
OTEL_ENABLED | Enable OpenTelemetry instrumentation | false |
IA_USER_AGENT | Custom User-Agent for IA API requests | internet-archive-mcp-server/{version} (github.com/cyanheads/internet-archive-mcp-server) |
IA_REQUEST_TIMEOUT_MS | HTTP request timeout in milliseconds, headers and body. A positive integer — anything else fails startup | 30000 |
IA_MAX_SNAPSHOT_CHARS | Default and maximum characters per ia_get_text page (a larger max_chars is served at it); also caps ia_get_snapshot text. A positive integer — anything else fails startup | 50000 |
See .env.example for the full list of optional overrides.
Running the server
Local development
-
Build and run:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:http -
Run 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 build -t internet-archive-mcp-server .
docker run --rm -p 3010:3010 internet-archive-mcp-server
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/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 |
|---|---|
src/index.ts | createApp() entry point — registers tools, resource, and inits services. |
src/config | Server-specific environment variable parsing and validation with Zod. |
src/mcp-server/tools | Tool definitions (*.tool.ts). Five tools across Wayback and IA library. |
src/mcp-server/resources | Resource definitions. ia://item/{identifier} item metadata resource. |
src/services/wayback | WaybackService — Availability API + CDX API client, plus archived-page charset decoding and text extraction. |
src/services/archive-search | ArchiveSearchService — Solr Advanced Search client. |
src/services/archive-metadata | ArchiveMetadataService — Metadata API + file download client. |
tests/ | Unit and integration tests mirroring src/. |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
- Handlers throw, framework catches — no
try/catchin tool logic - Use
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storage - Register new tools and resources via the barrels in
src/mcp-server/*/definitions/index.ts - Wrap 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 test
License
Apache-2.0 — see LICENSE for details.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.