Internet Archive Mcp Server

io.github.cyanheads由 GitHub 帳號 cyanheads 發布v0.5.0更新於 Oct 29, 2026

Search the Wayback Machine and IA library (40M+ items), fetch snapshots, item metadata, and text.

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取知識與記憶

概覽

AI 產生的概覽

以唯讀方式存取 Wayback Machine 與 Internet Archive 館藏:尋找並取得網頁封存快照、檢索 4000 萬+ 項目,並讀取中繼資料與 OCR 全文。

可以做什麼
  • 尋找某個網址的 Wayback 快照,可回傳最接近指定時間戳的一次擷取,或帶日期與狀態篩選的完整擷取歷史
  • 依指定時間戳取得封存網頁,回傳可讀純文字以及 Wayback 實際提供的重播網址
  • 依關鍵字及媒體類型、館藏、創作者、語言、日期範圍等條件檢索 Internet Archive 館藏,支援排序與分頁
  • 取得項目的中繼資料與分頁檔案清單,含格式、大小與下載網址
  • 分頁讀取文字項目的 OCR 或純文字,長文件可用續頁權杖繼續
  • 以 ia://item/{identifier} 資源形式提供項目中繼資料
適用情境
適合需要查看網頁歷史版本、確認某網站在過去某日期的樣貌,或在不離開助理的情況下檢索並閱讀公有領域書籍、文件及其他 Internet Archive 項目的情境。
執行需求
可使用公開託管端點,或透過 npx 在本機執行(需 Node.js);README 說明從原始碼建置需 Bun v1.4.0+ 或 Node.js v24+。不需 API 金鑰或帳號。選用環境變數涵蓋傳輸方式、HTTP 主機/連接埠/路徑、驗證模式、日誌等級、儲存、OpenTelemetry、IA_USER_AGENT、請求逾時與每頁字元上限。
安裝前請注意
所有工具皆為唯讀且不需憑證,風險較低。封存網頁、項目中繼資料與文件正文屬第三方內容,應視為資料而非指令。受限館藏中的部分項目無法下載,請求會送往 Internet Archive 的公開 API。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Internet Archive Mcp Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.cyanheads%2Finternet-archive-mcp-server/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "internet-archive": {
      "type": "http",
      "url": "https://internet-archive.caseyjhand.com/mcp"
    }
  }
}

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.

5 Tools • 1 Item Resource • 1 Skill


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

ToolDescription
ia_find_snapshotsFind Wayback Machine snapshots of a URL, by closest timestamp or full capture history
ia_get_snapshotFetch archived page content at a specific Wayback timestamp
ia_search_itemsSearch the IA library (40M+ items) by keyword and metadata filters
ia_get_itemRetrieve full metadata and file manifest for an Archive item
ia_get_textRetrieve readable OCR text from a text item, with paging

Resources

ResourceDescription
ia://item/{identifier}Metadata snapshot for an Archive item — title, creator, mediatype, description, subjects, collections, date, license, 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.

Capability reference

ia_find_snapshots tool

  • closest mode: returns the nearest capture to a given timestamp via the Availability API, falling back to one CDX closest-capture query (preferring a 200 capture, 25 s deadline) when the Availability API has no answer
  • history mode: full capture list via the CDX API; filter by date range (from/to) and HTTP status (status_filter)
  • For an exact URL with timestamp:N collapse, pass the returned resume_key with the same URL to continue without skipping the page boundary. The cursor expires after one hour and retains the original filters; limit may change between pages. An invalid cursor returns invalid_resume_key; conflicting explicit filters return resume_key_conflict. Legacy CDX keys and wildcard histories remain available with a notice that pages may omit captures
  • collapse is timestamp:8 (one capture per day) when omitted or blank; adjustable to timestamp:N, N=1–14, with timestamp:14 listing one row per distinct capture second
  • Up to 10,000 records per call (limit, default 100); a larger limit (up to 150,000) is served as 10,000, setting truncated and a notice naming resume_key when captures remain; resume_key pagination for large histories
  • Replay URLs are always https://web.archive.org/web/…
  • Typed errors: missing_timestamp (closest mode without a timestamp, 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, and resolved_status follow 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 notice says when a page is longer); output capped at IA_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, or YYYY-MM-DD: date_from uses the period's first day and date_to its last day, including leap years. Blank bounds leave that side open; invalid dates return invalid_date_range before a search request
  • mediatype takes 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 as date asc or titleSorter asc; default downloads desc; Advanced Search has no relevance sort). Ties under the sort are ordered by identifier, so consecutive pages neither repeat nor skip an item
  • query is 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-indexed page; on page 1 a larger rows (up to 10,000) is served as 200, setting truncated and a notice naming rows: 200, page: 2 when more results remain
  • Advanced Search serves only the first 10,000 results, so page × rows ≤ 10,000
  • Output carries total_found, page, and the rows applied for pagination; an empty page returns a notice rather than an error — naming the mediatype applied when nothing matched, or the last page when page is past the end
  • title, date, creator, and collection may be a string or a list; collection leaves out per-account fav- favorites lists, and creator lists the first 10 names, with creator_count when a record has more
  • Typed errors answered before any search request: invalid_date_range (an invalid date bound), invalid_mediatype (any other mediatype, listing the accepted values), rows_over_cap (rows above 200 past page 1), and page_limit_exceeded (page × rows past 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) and search_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, and language when present in upstream metadata; creator, description, subject, collection, and language may be a string or a list
  • files[] is one page of the manifest in upstream order — format, size, md5, and a direct download_url per file; file_count is always the full manifest size
  • max_files (default 50, at most 500 per call) and file_offset (default 0) page through large items; a larger max_files (up to 300,000) is served as 500. When files remain, the response sets truncated and names the next file_offset
  • format keeps one file type (exact match, case-insensitive — e.g. DjVuTXT, Text PDF, VBR MP3) before paging and reports the match count as totalCount; 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_chars and char_offset page through long documents; has_more signals additional text remains. max_chars defaults to and is capped at IA_MAX_SNAPSHOT_CHARS — a larger value is served at that maximum, with a notice, and the output max_chars reports the value applied
  • For sequential pages, pass next_continuation back as continuation with the same identifier, omitting char_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_pagination when both token and offset are supplied, invalid_continuation for an invalid or changed-file cursor, and range_unavailable when the download cannot resume at the saved range. Recovery names the char_offset to 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_file names the file fetched and source_file_bytes its 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, and file_count
  • identifier comes from ia_search_items results
  • Typed errors: item_not_found for unknown identifiers, archive_unavailable when 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 limit keep 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), and file_count plus the next file_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_item returns file-level metadata (format, size, URL) and a format filter, so agents can pick the right file without paging through thumbnails

Getting started

Connect to the hosted instance, no install:

sh
claude mcp add --transport http internet-archive-mcp-server https://internet-archive.caseyjhand.com/mcp

Or run it locally:

sh
claude mcp add internet-archive-mcp-server -- npx -y @cyanheads/internet-archive-mcp-server

For other clients, add this to the MCP config file:

json
{  "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.

VariableDescriptionDefault
MCP_TRANSPORT_TYPETransport: stdio or httpstdio
MCP_HTTP_PORTHTTP server port3010
MCP_AUTH_MODEAuth mode: none, jwt, or oauthnone
MCP_LOG_LEVELLog level (debug, info, notice, warning, error)info
LOGS_DIRDirectory for log files (Node.js only)<project-root>/logs
STORAGE_PROVIDER_TYPEStorage backendin-memory
OTEL_ENABLEDEnable OpenTelemetry instrumentationfalse
IA_USER_AGENTCustom User-Agent for IA API requestsinternet-archive-mcp-server/{version} (github.com/cyanheads/internet-archive-mcp-server)
IA_REQUEST_TIMEOUT_MSHTTP request timeout in milliseconds, headers and body. A positive integer — anything else fails startup30000
IA_MAX_SNAPSHOT_CHARSDefault 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 startup50000

See .env.example for the full list of optional overrides.

Running the server

Local development

Requires Bun v1.4.0 or higher (or Node.js v24+).

  • Clone and install:

    sh
    git clone https://github.com/cyanheads/internet-archive-mcp-server.gitcd internet-archive-mcp-server && bun installcp .env.example .env   # optional User-Agent and timeout overrides
  • Build and run:

    sh
    # One-time buildbun run rebuild
    # Run the built serverbun run start:stdio# orbun run start:http
  • Run checks and tests:

    sh
    bun run devcheck   # Lint, format, typecheck, securitybun run test       # Vitest test suitebun run lint:mcp   # Validate MCP definitions against spec

Docker

sh
docker run --rm -p 3010:3010 ghcr.io/cyanheads/internet-archive-mcp-server:latest

The 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

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools, resource, and inits services.
src/configServer-specific environment variable parsing and validation with Zod.
src/mcp-server/toolsTool definitions (*.tool.ts). Five tools across Wayback and IA library.
src/mcp-server/resourcesResource definitions. ia://item/{identifier} item metadata resource.
src/services/waybackWaybackService — Availability API + CDX API client, plus archived-page charset decoding and text extraction.
src/services/archive-searchArchiveSearchService — Solr Advanced Search client.
src/services/archive-metadataArchiveMetadataService — 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/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.state for 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:

sh
bun run devcheckbun run test

License

Apache-2.0 — see LICENSE for details.

來源:README.md,提交 253668b

工具

5

ia_find_snapshots

Find Wayback Machine Snapshots

Find Wayback Machine snapshots of a URL. Mode "closest" returns the single nearest capture to a given timestamp via the Availability API, falling back to a CDX closest-capture query when the Availability API has no answer (one result). Mode "history" returns the full capture list via the CDX API — filterable by date range and HTTP status code, collapsed by default to one capture per day (collapse "timestamp:8"); collapse "timestamp:14" lists one row per distinct capture second. Use history mode to survey how a page changed over time; use closest mode when you need the snapshot nearest a specific date. History mode returns up to limit records (at most 10,000 per call) and supports resume-key pagination for URLs with very large capture histories.

輸入參數tourl必填frommode必填limitcollapsetimestampresume_keystatus_filter

ia_get_snapshot

Get Wayback Machine Snapshot Content

Fetch the archived content of a URL at a specific Wayback Machine timestamp. Resolves to the nearest available capture when the exact timestamp has no snapshot. Returns the archived page as readable plain text (HTML stripped) and the replay URL of the capture Wayback served, for browser access. Use ia_find_snapshots first to discover valid timestamps for a URL.

輸入參數url必填timestamp必填

ia_search_items

Search Internet Archive Items

Search the Internet Archive library (40M+ items) using the Advanced Search (Solr) API. Filter by media type (texts, audio, movies, software, image, etc.), collection, creator, date range, and language. Sort by downloads (the default), date, title, or random. Supports pagination via page/rows. Returns identifiers, titles, creators (the first 10, with creator_count when a record lists more), media types, dates, download counts, collections (without fav- favorites lists), total_found, and current page/rows for pagination context. Use ia_get_item with a returned identifier to get full metadata and file manifests.

輸入參數pagerowssortquery必填creatordate_tolanguagedate_frommediatypecollection

ia_get_item

Get Internet Archive Item

Retrieve metadata and the file manifest for an Internet Archive item by identifier. Returns title, creator, description, subjects, collections, license, language, the total file count, and a page of files, each with its format, size, and direct download URL. Pages hold up to max_files files (default 50, at most 500 per call) starting at file_offset; set format to keep a single file type (e.g. "DjVuTXT", "Text PDF", "VBR MP3"). The primary tool to act on a search result from ia_search_items. Use ia_get_text to retrieve the readable text of a text item.

輸入參數formatmax_filesidentifier必填file_offset

ia_get_text

Get Internet Archive Item Text

Retrieve readable OCR DjVuTXT or plain text from an Internet Archive item, including public-domain books, documents, scanned periodicals, and transcripts. Set max_chars for page size, then pass next_continuation as continuation with the same identifier and omit char_offset. Direct char_offset access remains available. To confirm a text file exists, call ia_get_item with format "DjVuTXT".

輸入參數max_charsidentifier必填char_offsetcontinuation

版本歷史

8
  1. v0.5.0最新Oct 29, 2026
  2. v0.4.1Oct 25, 2026
  3. v0.4.0Oct 12, 2026
  4. v0.3.1Oct 7, 2026
  5. v0.3.0Sep 25, 2026
  6. v0.2.0Sep 24, 2026
  7. v0.1.5Sep 19, 2026
  8. v0.1.4Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分