
Wayback Machine
io.github.MearmanPublished by GitHub account Mearmanv3.7.1Updated Oct 24, 2026
MCP server and CLI tool for interacting with the Wayback Machine without API keys
Overview
Local MCP server and CLI that lets an assistant archive URLs to the Internet Archive's Wayback Machine, search snapshots, and compare captures.
- What you can do
- Archive a URL to the Wayback Machine, optionally with a screenshot, outlinks, or a JS wait
- Retrieve an archived snapshot's content and metadata at a timestamp or the latest version
- Search the CDX index by URL pattern, date range, filters, and pagination
- Check capture statistics and list available screenshots for a URL
- Compare two snapshots and get a visual diff link
- Clear the local response cache
- When to use it
- Useful when you need to preserve a page before it changes, look up what a site looked like on a given date, or audit how often and when a URL was archived.
- Requirements
- Runs locally via npx with Node.js 22 or newer. No account is required; anonymous access works. Optional Internet Archive S3 credentials in WAYBACK_ACCESS_KEY and WAYBACK_SECRET_KEY raise SPN2 rate limits. Network access to the Wayback Machine APIs is needed, and requests are rate limited to about 15 per minute.
Installation
In SourceWeft
- Open Wayback Machine in the dashboard and add it to a workspace.
- 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
MCP Wayback Machine Server
MCP server and CLI tool for interacting with the Internet Archive's Wayback Machine. Supports full CDX search, snapshot content retrieval, screenshot listing, snapshot comparison, and optional authentication for higher SPN2 rate limits.
[npm downloads chart, log scale] [GitHub stars chart, log scale]
Stack: TypeScript · Node.js 22+ · ES Modules · pnpm · Turbo · Zod
Getting started
Requires Node.js 22+ and pnpm.
Optional credentials (anonymous access works, but authenticated requests get higher SPN2 rate limits):
Obtain credentials at archive.org/account/s3.php.
Build, test, and lint
To run a single test file:
End-to-end tests hit the live Wayback Machine API and are opt-in:
pnpm validate is the gate that must pass before a release. prepublishOnly runs it automatically.
Architecture
src/bin.ts is the entry point. It detects whether it is invoked as a CLI or loaded as an MCP server and routes accordingly.
Each tool module exports a schema (consumed by ListToolsRequestSchema) and an execution function (consumed by CallToolRequestSchema). New tools need both registrations in server.ts.
Caching TTLs are intentional — do not normalise them:
Conventions
- TypeScript strict mode with
noUncheckedIndexedAccessandexactOptionalPropertyTypes— noany, noasassertions. - ES Modules throughout —
"type": "module"inpackage.json. Always use.tsextensions in relative imports (rewritten to.jsat build time viarewriteRelativeImportExtensions). - Zod is the single source of truth for all tool input shapes.
schemas.tsdefines them;zodToJsonSchemaderives the MCP-compatible JSON Schema. - Prettier formats all TypeScript: 4-space indent, double quotes, trailing commas (
es5), 80-char print width, LF line endings. - Conventional commits are enforced by commitlint. Allowed scopes:
retrieve,save,search,status,fetch,http,validation,cli,build,release,ci,deps. Commit messages must use British English. - Test colocation: unit tests in
tests/tools/*.unit.test.tsandtests/utils/*.unit.test.ts; integration tests intests/*.integration.test.ts. Use the Node.js built-in test runner — no Jest or Vitest. erasableSyntaxOnly: true— no TypeScript syntax that cannot be stripped without transformation (noenum, no decorators, nonamespace).
Gotchas
pnpm validatebefore pushing. CI runscheck + test + coverage + untested-files.pnpm validatereplicates this locally via Turbo.- Turbo caches aggressively. If you change a config file that Turbo doesn't track as an input, cached task results may be stale. Clear with
pnpm turbo run <task> --forceif results look wrong. WAYBACK_LIVE_TESTSmust be set to runtest:e2e. The Turbo config passes it through viaglobalPassThroughEnv; don't set it in.envfiles — export it in your shell before running.- Coverage excludes
src/contexts.ts,src/cli.ts,src/bin.ts, andsrc/tools/context.ts— these are wiring/entry-point files. The 80% threshold applies to the remaining surface. - Rate limiting is 15 req/min across all Wayback Machine API calls, with automatic Retry-After handling for 429 responses. Tests that mock HTTP must respect this — don't call real endpoints from unit tests.
noUncheckedIndexedAccessmeansRecord<string, T>lookups returnT | undefined. Never fall back to?? default— narrow explicitly or restructure to a concrete type.- Node version is pinned in
.tool-versions. CI tests against Node 22, 24, and 26. Do not use Node APIs that aren't available in 22.
Contributing
Commits follow Conventional Commits and are lint-checked by commitlint on PRs. PRs target main; CI must pass (check, test, coverage). Releases are fully automated via semantic-release on push to main.
After release, alias packages (wayback-machine-mcp, mcp-internet-archive, internet-archive-mcp, @mearman/mcp-wayback-machine) are published automatically by CI — do not publish these manually.
Installation
As an MCP server
CLI shorthand
Claude Code (MCP):
Claude Code (plugin marketplace):
OpenAI Codex:
To include optional credentials:
Manual configuration
Add to the appropriate config file:
The env block is optional — the server works anonymously without credentials.
As a CLI tool
Or install globally:
As a Cloudflare Worker
Deploy the MCP server as a stateless Cloudflare Worker. Runs on the free tier with no paid bindings — all persistent state uses the Cache API which has no published daily limits.
The Worker uses the SDK's StreamableHTTPServerTransport in stateless mode (no session IDs), so each request is independent and cold starts are handled gracefully.
Environment variables (set via wrangler secret put):
When MCP_AUTH_TOKEN is set, clients must send Authorization: Bearer <token>. When absent, the Worker accepts unauthenticated requests.
Per-request credentials. Clients can pass their own IA S3 credentials on each request via HTTP headers, overriding the server's environment variables:
This lets multiple users share a single Worker deployment while each using their own credentials for higher SPN2 rate limits. When both headers are present, they take precedence over WAYBACK_ACCESS_KEY/WAYBACK_SECRET_KEY. When absent, the Worker falls back to its environment variables.
Worker-specific files are excluded from the main tsconfig.json and type-checked separately via tsconfig.worker.json (which adds @cloudflare/workers-types).
Architecture. The stdio and Worker deployments share the same tool logic through pluggable interfaces:
Quick examples
Tools
save_url
Archive a URL to the Wayback Machine using the SPN2 API.
Parameters
get_archived_url
Retrieve an archived snapshot's content and metadata.
Parameters
search_archives
Search the CDX API for archived versions of a URL.
Parameters
check_archive_status
Check archival statistics for a URL — capture counts, yearly breakdowns, and first/last capture dates.
Parameters
list_screenshots
List available screenshots for a URL.
Parameters
compare_snapshots
Compare two archived snapshots of a URL. Fetches the raw content of both and provides a visual diff URL.
Parameters
clear_cache
Clear all cached API responses. Use when fresh data is needed or after saving a new URL.
CLI usage
References
- Internet Archive Developer Portal
- CDX Server Documentation
- Save Page Now 2 (SPN2) API
- Bots, LLMs, and Automated Access
- internet-archive-skills — Official Claude Code skill for the
iaPython CLI; complements this server.
License
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International.
Source: README.md at commit 1f8ef8e
Tools
0Version history
1- v3.7.1LatestSep 16, 2026
Score
40% 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
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- 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 listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.