MCP server and CLI tool for interacting with the Wayback Machine without API keys
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"io-github-mearman-mcp-wayback-machine": {
"args": [
"-y",
"mcp-wayback-machine"
],
"command": "npx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
An MCP (Model Context Protocol) 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.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y 'mcp-wayback-machine' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked mcp-wayback-machine against OSV.dev.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in developer-tools
Read, write, and manage files on the local filesystem
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Manage Supabase projects — databases, auth, storage, and edge functions
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
MCP Security Weekly
Get CVE alerts and security updates for io.github.Mearman/mcp-wayback-machine and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
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.
pnpm install
Optional credentials (anonymous access works, but authenticated requests get higher SPN2 rate limits):
export WAYBACK_ACCESS_KEY="your-access-key"
export WAYBACK_SECRET_KEY="your-secret-key"
Obtain credentials at archive.org/account/s3.php.
pnpm validate # typecheck + lint + build + test + untested-files check (the full CI gate)
pnpm check # typecheck + lint + build only
pnpm build # compile TypeScript to dist/
pnpm test # run unit and integration tests
pnpm test:coverage # run tests with coverage (80% line/branch/function threshold)
pnpm lint # lint with ESLint
pnpm lint:fix # auto-fix lint issues
To run a single test file:
node --test tests/tools/save.unit.test.ts
End-to-end tests hit the live Wayback Machine API and are opt-in:
pnpm test:e2e # sets WAYBACK_LIVE_TESTS=1 internally via turbo
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.
src/
bin.ts — entry point; dispatches to CLI or MCP server
cli.ts — Commander-based CLI implementation
server.ts — MCP server wiring (ListTools + CallTool handlers)
contexts.ts — shared context (rate limiter, cache, credentials)
schemas.ts — Zod schemas for all tool inputs; single source of truth
tools/
save.ts — save_url tool (SPN2 API)
retrieve.ts — get_archived_url tool
search.ts — search_archives tool (CDX API)
status.ts — check_archive_status tool (sparkline API)
screenshots.ts — list_screenshots tool
compare.ts — compare_snapshots tool
cache.ts — clear_cache tool
context.ts — injects shared context into tool handlers
utils/
http.ts — fetch wrapper with rate limiting and Retry-After handling
cache.ts — in-memory + disk cache with per-endpoint TTLs
rate-limit.ts — 15 req/min token bucket
validation.ts — shared Zod validation helpers
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).