Skip to main content
Glama
README.md
# timestamped-mcp

An MCP server that gives AI agents **independent, verifiable receipts** for what they saw, did and agreed to.

When an agent reads a page, accepts a quote or produces a document, the record usually ends up in logs that the operator controls and can edit. This server lets the agent anchor that record with [Timestamped.io](https://timestamped.io) as a public blockchain transaction. The operator can't quietly edit or backdate a transaction after the fact, and anyone can check it on the public chain.

## Tools

| Tool | Use it to | Needs API key |
|---|---|---|
| `stamp_hash` | Timestamp a SHA-256 or a local file. The file is hashed locally and never uploaded. Private by default. | yes |
| `stamp_url` | Record what a web page shows right now (full-page screenshot plus text, hashed and anchored). Call it before accepting terms, prices or offers. | yes |
| `check_url_changed` | Re-fetch a stamped page and report whether it still matches. | no |
| `verify_stamp` | Check that data was timestamped in a given transaction. Private stamps also need the `proof_blob`. | no |
| `get_proof` | Fetch the raw transaction and Merkle proof of a hash stamp (by `txid` or `record_id`), or a URL stamp's proof package (by `url_record_id`). Also resumes a stamp that came back `pending`. | no (except private URL records) |

**Waiting for results.** Stamping and page checks wait for the result inside the call, for up to 45 seconds in total, request time included. That keeps them under the 60-second request timeout most MCP clients use. If the result isn't ready by then, the tool returns `status: "pending"` together with the exact tool call that resumes it.

### Privacy, in plain terms

- **`stamp_hash` with `visibility: "private"`** (the default) puts nothing identifying on-chain. It returns a `proof_blob`.
  - The `proof_blob` is the *only* way to prove the stamp later, so store it with the data.
- **`stamp_hash` with `visibility: "public"`** puts the hash, and any `public_metadata`, on-chain where anyone can read it.
- **`stamp_url` writes the URL itself on-chain in plain text in every privacy mode.**
  - Don't stamp URLs that contain tokens, session ids or personal data.
  - The `privacy` option only controls who can see the screenshot and record on timestamped.io.
- **`stamp_url` fetches the page from Timestamped's server, not from your machine.** Pages behind your login show their logged-out version.
- **`check_url_changed` compares bytes exactly.** Pages with ads, clocks or other dynamic content usually report "changed".

### Verification today

`verify_stamp` asks the Timestamped API. How far the check goes depends on the stamp:
- **Private stamps:** the server checks the `proof_blob` against the transaction on-chain.
- **Public stamps:** it compares your hash with its own record of that transaction.

To check without trusting our server, use `get_proof`. It returns the raw transaction and Merkle proof, which you can check yourself against any BSV block-header source. An open-source offline verifier is at <https://timestamped.io/verifier/timestamped_verify.py> (format: <https://timestamped.io/verifier/proof-format.md>).

## Setup

1. Create an API key at <https://timestamped.io/settings/api-keys>. You only need it for stamping; verifying works without one.
2. Add the server to your client using one of the configs below.

### Claude Code

```bash
claude mcp add timestamped --env TIMESTAMPED_API_KEY=ts_... -- npx -y timestamped-mcp
```

### Claude Desktop

Add this to `claude_desktop_config.json`:
- macOS: `~/Library/Application Support/Claude/`
- Windows: `%APPDATA%\Claude\`

```json
{
  "mcpServers": {
    "timestamped": {
      "command": "npx",
      "args": ["-y", "timestamped-mcp"],
      "env": { "TIMESTAMPED_API_KEY": "ts_..." }
    }
  }
}
```

### Cursor

Use `~/.cursor/mcp.json` for all projects, or `.cursor/mcp.json` in a single project:

```json
{
  "mcpServers": {
    "timestamped": {
      "command": "npx",
      "args": ["-y", "timestamped-mcp"],
      "env": { "TIMESTAMPED_API_KEY": "ts_..." }
    }
  }
}
```

### Environment

| Variable | Default | |
|---|---|---|
| `TIMESTAMPED_API_KEY` | (unset) | Required for `stamp_hash` and `stamp_url` |
| `TIMESTAMPED_API_URL` | `https://timestamped.io/api/v1` | Point it at another deployment |

Each stamp is a real transaction and counts against your plan's daily quota.

## Development

```bash
npm install
npm test          # mocked API; never touches the network or spends coins
npm run build
npx @modelcontextprotocol/inspector --cli node dist/index.js --method tools/list
```

- `src/server.ts` builds a transport-agnostic `McpServer`.
- `src/index.ts` only wires it to stdio, so a remote (HTTP) transport can reuse the same tools unchanged.

## License

MIT

## Hosted (HTTP) mode

`timestamped-mcp-http` serves the same tools over Streamable HTTP at `POST /mcp`, for agents that cannot run a
local process. It is stateless: each request carries the caller's own Timestamped API key
(`Authorization: Bearer ts_...`) and is served with that key only.

```bash
PORT=8787 MCP_ALLOWED_HOSTS=mcp.example.com timestamped-mcp-http   # behind a TLS proxy; binds 127.0.0.1
```

- `file_path` is refused in this mode (the server must never read its own disk for a caller); send `sha256`.
- `MCP_ALLOWED_ORIGINS` lists browser origins allowed to call it; requests without an `Origin` header pass.
- OAuth is not implemented yet: clients that only speak OAuth cannot connect to this mode.
- Not tested against real MCP clients; only against the SDK's own HTTP client.

TDQS

A4.3/5.0

Scored across 5 tools

Disambiguation4/5

stamp_hash vs stamp_url are clearly separated by input type and workflow, and check_url_changed is a distinct re-verification operation. verify_stamp and get_proof both deal with proof evidence and could be momentarily confused, though their descriptions distinguish an API-based check from fetching the raw evidence package.

Naming Consistency5/5

All tools use snake_case with a verb-first pattern: stamp_hash, stamp_url, check_url_changed, verify_stamp, get_proof. The naming is predictable and readable, with only a minor variation in check_url_changed's longer object name.

Tool Count5/5

Five tools is well-scoped for a timestamping service: two creation paths, one change-detection check, one verification check, and one proof retrieval. Each tool earns its place without obvious redundancy.

Completeness4/5

The core lifecycle is covered: create hash and URL timestamps, verify stamps, retrieve proofs, and re-check URL content. Minor gaps exist around listing or managing prior stamps and account/quota visibility, but nothing blocks the main workflows.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues