Metadata-Version: 2.4
Name: wayback-mcp
Version: 0.1.1
Summary: Wayback Machine MCP server (Python)
Author: sisilet
License: MIT License
        
        Copyright (c) 2025 sisilet
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
        
        
Project-URL: Homepage, https://github.com/sisilet/wayback_mcp
Project-URL: Repository, https://github.com/sisilet/wayback_mcp
Project-URL: Issues, https://github.com/sisilet/wayback_mcp/issues
Keywords: mcp,model-context-protocol,wayback,archive.org,internet-archive
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Intended Audience :: Developers
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries
Classifier: Environment :: Console
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp>=1.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.7.0
Dynamic: license-file

### Wayback Machine MCP Server (Python)

A Model Context Protocol (MCP) server that provides access to the Internet Archive Wayback Machine: list snapshots and fetch archived pages. Inspired by the TypeScript server described in the LobeHub listing.

- Reference: Wayback MCP (listing) — [link](https://lobehub.com/mcp/cyreslab-ai-wayback-mcp-server)
- Reference: Internet Archive APIs — [Wayback APIs index](https://archive.org/developers/index-apis.html)
- Reference: MCP server quickstart — [Build an MCP Server](https://modelcontextprotocol.io/quickstart/server)

#### Features
- Tools
  - `get_snapshots(url, from, to, limit, match_type)` via Wayback CDX API
  - `get_archived_page(url, timestamp, original)` fetches archived content
  - `search_items(query, mediatype, collection, fields, sort, rows, page)` searches archive.org items
- Resource
  - `wayback://{url}/{timestamp}` returns the archived page content

#### Install
```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```

#### Run (stdio)
```bash
python -m wayback_mcp.server
```
#### Install as CLI
```bash
pip install wayback-mcp
wayback-mcp
```


#### Configure in MCP client
Claude Desktop settings (example):
```json
{
  "mcpServers": {
    "wayback-machine": {
      "command": "/usr/bin/python3",
      "args": ["-m", "wayback_mcp.server"],
      "env": {},
      "disabled": false,
      "autoApprove": []
    }
  }
}
```

#### Usage examples
- Tool call (snapshots):
```
get_snapshots(url="example.com", from="20200101", to="20201231", limit=10)
```
- Tool call (page):
```
get_archived_page(url="example.com", timestamp="20200101120000", original=true)
```
- Tool call (items search):
```
search_items(
  query="title:(Wayback) AND creator:(Internet Archive)",
  mediatype="texts",
  fields=["identifier","title","creator","mediatype","publicdate"],
  sort=["publicdate desc"],
  rows=20,
  page=1
)
```
- Resource fetch:
```
wayback://example.com/20200101120000
```

#### Notes
- Snapshot data via CDX API: `https://web.archive.org/cdx/search/cdx?url={url}&output=json`
- Page retrieval via Wayback: `https://web.archive.org/web/{timestamp}/{url}` (or `id_` mode for original content)
- Advanced item search endpoint: `https://archive.org/advancedsearch.php` (JSON output)
