Connect an agent#

Every integration fingerprints files on the machine where the agent runs and sends only hashes. The default registry is https://registry.grantstamp.io; set GRANTSTAMP_REGISTRY to use another.

MCP server#

The MCP server gives a model a check_ownership tool and instructions for when to call it.

Claude Code

pip install grantstamp
claude mcp add grantstamp -- grantstamp-mcp

Claude Desktop, Cursor, VS Code

{
  "mcpServers": {
    "grantstamp": { "command": "uvx", "args": ["grantstamp", "mcp"] }
  }
}

Put that in claude_desktop_config.json, ~/.cursor/mcp.json or, with "servers" in place of "mcpServers" and "type": "stdio", in .vscode/mcp.json. Ready-made files are in the repository under integrations/.

Tools: check_ownership(path, intended_use, purpose?, license_token?), fingerprint_summary(path), get_stamp(stamp_id), search_stamps(query), verify_license_token(token, stamp_id?).

Claude Code hook#

The hook runs before Claude Code reads, edits or runs a command on a binary or game file, and applies the owner's decision without relying on the model to ask.

{
  "hooks": {
    "PreToolUse": [
      { "matcher": "Read|Edit|MultiEdit|Write|Bash",
        "hooks": [ { "type": "command", "command": "grantstamp-hook", "timeout": 30 } ] }
    ]
  }
}

Merge that into .claude/settings.json. A deny blocks the tool call and tells Claude why. An ask makes Claude Code ask you. Allows and files with no claim pass silently.

If the registry cannot be reached the hook lets the call through. Set GRANTSTAMP_HOOK_FAIL_CLOSED=1 to block instead.

Command line#

grantstamp check path/to/file --use port --exit-code

Exit code 0 means allow or no claim, 2 means deny, 3 means ask. Use it in scripts and CI.

HTTP#

grantstamp fingerprint path/to/file --out bundle.json
jq -n --slurpfile b bundle.json '{bundle: $b[0], use: "port"}' > check.json
curl -s https://registry.grantstamp.io/v1/check -H 'content-type: application/json' -d @check.json
from grantstamp.client import Client
from grantstamp.fingerprint import fingerprint

res = Client().check(fingerprint("game.exe"), use="decompile")
print(res["verdict"]["decision"], res["verdict"]["guidance"])

The interactive API reference for the public registry is at registry.grantstamp.io/v1/docs.

What comes back#

{
  "access": "anonymous",
  "verdict": {"band": "high", "decision": "deny", "stamp": "stamp_…",
              "guidance": "This content is very likely derived from …"},
  "matches": [{"band": "high", "stamp": {"id": "stamp_…", "title": "…"},
               "owner": {"name": "…", "verified": true},
               "decision": {"action": "deny", "via": "policy", "use": "port"}}],
  "receipt": "eyJhbGciOiJFZERTQSIs…"
}

How an agent should act on verdict.decision:

Decision What to do
allow Go ahead. Keep the receipt.
ask Tell the user who owns the content and what the owner asks. Continue only if the user confirms they have the right.
deny Do not perform that use. Tell the user why, and how to reach the owner or get a licence token.
no-claim Nothing is registered. That does not mean the content is unowned: respect licences and notices as usual.

If the registry cannot be reached, say that ownership could not be checked. Do not treat it as no claim.

Declaring a purpose or a licence#

Higher limits for tools and providers#

Anonymous callers get 30 requests a minute, coarse bands, and can earn more with a short proof-of-work. To get more:

  1. grantstamp keygen --role agent && grantstamp agent register --name "Your Product" --url https://your.domain. Requests are now signed (RFC 9421 HTTP Message Signatures, compatible with Web Bot Auth) and limited to 600 a minute.
  2. Ask the registry operator to mark the agent as trusted to receive scores and per-layer evidence at 6,000 requests a minute.

GET /v1/whoami shows how the registry sees a caller and its limit.

Source of this page on GitHub. Documentation for Grantstamp 0.2, licensed CC BY 4.0.