MCP server and CLI tool for interacting with the Wayback Machine without API keys
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
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.
Stack: TypeScript Β· Node.js 22+ Β· ES Modules Β· pnpm Β· Turbo Β· Zod
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.
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.
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:
| Resource | TTL | Reason |
|---|---|---|
| Snapshot content | 24 h | Immutable once captured |
| Availability, CDX, sparkline | 1 h | Grows but never mutates |
| Save operations | 30 min | Idempotent per URL |
| Save status polling | 30 s | Changes during active jobs |
noUncheckedIndexedAccess and exactOptionalPropertyTypes β no any, no as assertions."type": "module" in package.json. Always use .ts extensions in relative imports (rewritten to .js at build time via rewriteRelativeImportExtensions).schemas.ts defines them; zodToJsonSchema derives the MCP-compatible JSON Schema.es5), 80-char print width, LF line endings.retrieve, save, search, status, fetch, http, validation, cli, build, release, ci, deps. Commit messages must use British English.tests/tools/*.unit.test.ts and tests/utils/*.unit.test.ts; integration tests in tests/*.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 (no enum, no decorators, no namespace).pnpm validate before pushing. CI runs check + test + coverage + untested-files. pnpm validate replicates this locally via Turbo.pnpm turbo run <task> --force if results look wrong.WAYBACK_LIVE_TESTS must be set to run test:e2e. The Turbo config passes it through via globalPassThroughEnv; don't set it in .env files β export it in your shell before running.src/contexts.ts, src/cli.ts, src/bin.ts, and src/tools/context.ts β these are wiring/entry-point files. The 80% threshold applies to the remaining surface.noUncheckedIndexedAccess means Record<string, T> lookups return T | undefined. Never fall back to ?? default β narrow explicitly or restructure to a concrete type..tool-versions. CI tests against Node 22, 24, and 26. Do not use Node APIs that aren't available in 22.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.
Claude Code (MCP):
Claude Code (plugin marketplace):
OpenAI Codex:
To include optional credentials:
Add to the appropriate config file:
| Harness | Config file | Config key |
|---|---|---|
| Claude Code | .mcp.json (project) / ~/.claude.json (user) | mcpServers |
| Codex | ~/.codex/config.toml | [mcp_servers.wayback-machine] |
| Gemini CLI | ~/.gemini/settings.json | mcpServers |
| Crush | .crush.json / ~/.config/crush/crush.json | mcp |
| Cline | .cline/mcp.json | mcpServers |
| Cursor | .cursor/mcp.json | mcpServers |
| Zed | ~/.config/zed/settings.json | context_servers |
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json | mcpServers |
The env block is optional β the server works anonymously without credentials.
Or install globally:
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):
| Variable | Required | Purpose |
|---|---|---|
WAYBACK_ACCESS_KEY | No | Fallback IA S3 credentials for higher SPN2 rate limits |
WAYBACK_SECRET_KEY | No | Fallback IA S3 credentials |
MCP_AUTH_TOKEN | No | Bearer token for client authentication |
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:
| Component | Stdio | Worker |
|---|---|---|
| Caching | DiskCacheBackend (OS cache dir) | CacheApiBackend (caches.open()) |
| Rate limiting | InMemoryRateLimiter | CacheApiRateLimiter |
| Auth | None | StaticTokenAuthProvider (optional) |
| Credentials | Environment variables | Request headers, then environment variables |
save_urlArchive a URL to the Wayback Machine using the SPN2 API.
| Parameter | Required | Description |
|---|---|---|
url | Yes | The URL to archive |
captureScreenshot | No | Capture a screenshot as a PNG image |
captureOutlinks | No | Also archive up to 100 outlinked pages |
ifNotArchivedWithin | No | Skip if archived within timeframe, e.g. "30d" |
jsBehaviorTimeout | No | Run JavaScript for N seconds before capturing (max 30) |
forceGet | No | Use simple HTTP GET instead of browser rendering |
delayWbAvailability | No | Delay indexing ~12 hours to reduce server load |
get_archived_urlRetrieve an archived snapshot's content and metadata.
| Parameter | Required | Description |
|---|---|---|
url | Yes | The URL to retrieve |
timestamp | No | Specific timestamp (YYYYMMDDhhmmss) or "latest" |
modifier | No | URL modifier: id_ (raw), im_ (screenshot), js_ (JS), cs_ (CSS) |
search_archivesSearch the CDX API for archived versions of a URL.
| Parameter | Required | Description |
|---|---|---|
url | Yes | The URL pattern to search for |
matchType | No | exact, prefix, host, or domain |
from | No | Start date (YYYYMMDD or YYYY-MM-DD) |
to | No | End date (YYYYMMDD or YYYY-MM-DD) |
limit | No | Maximum results (default 10) |
offset | No | Skip the first N results |
collapse | No | Collapse duplicates, e.g. "timestamp:8" (per hour), "digest" |
filter | No | Filter by field regex, e.g. ["statuscode:200", "!mimetype:image.*"] |
resolveRevisits | No | Resolve warc/revisit entries to original metadata |
showDupeCount | No | Show duplicate count per capture |
page | No | Page number for pagination |
pageSize | No | Results per page |
check_archive_statusCheck archival statistics for a URL β capture counts, yearly breakdowns, and first/last capture dates.
| Parameter | Required | Description |
|---|---|---|
url | Yes | The URL to check |
list_screenshotsList available screenshots for a URL.
| Parameter | Required | Description |
|---|---|---|
url | Yes | The URL to find screenshots for |
limit | No | Maximum results (default 10) |
compare_snapshotsCompare two archived snapshots of a URL. Fetches the raw content of both and provides a visual diff URL.
| Parameter | Required | Description |
|---|---|---|
url | Yes | The URL to compare snapshots for |
timestampA | No | First timestamp. Defaults to oldest available. |
timestampB | No | Second timestamp. Defaults to newest available. |
clear_cacheClear all cached API responses. Use when fresh data is needed or after saving a new URL.
ia Python CLI; complements this server.Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/wayback-machine)<a href="https://allmcps.com/mcp/wayback-machine"><img src="https://allmcps.com/api/badge/wayback-machine?style=directory" alt="Wayback Machine on AllMCPs" /></a>