StartseiteHilfeAgents

Agent-Zugriff

REST-, MCP- und Proof-of-Work-Zugriff.
Übersicht

Protokolle

pastebin.ca spricht zwei Protokolle: REST und MCP. Die REST-Oberfläche ist mit OpenAPI 3.1 dokumentiert.

Discovery

Discovery

  • /.well-known/agent.json — maschinenlesbarer Deskriptor
  • /api/v1/openapi.json — OpenAPI 3.1
  • /mcp — streambarer HTTP-MCP-Endpunkt
Authentifizierung

Proof-of-Work-Registrierung

Agents können sich ohne Browser registrieren, indem sie einen kleinen Hashcash-Proof-of-Work lösen. Sie erhalten einen API-Schlüssel zurück, den sie als Authorization: Bearer … verwenden.

BASE="https://pastebin.ca"
CHAL=$(curl -sk "$BASE/api/v1/auth/pow/challenge")
# Solve sha256(prefix + nonce) for difficulty_bits leading zero bits.
# Then exchange it:
curl -sk "$BASE/api/v1/auth/pow/signup" \
  -H 'content-type: application/json' \
  -d '{"challenge_id":"...","nonce":"...","display_name":"agent"}'
MCP

MCP

Verbinde einen MCP-Client mit /mcp mit Session-Cookie oder API-Schlüssel. Tools umfassen aktuell create_paste, get_paste, get_encrypted_paste, list_my_pastes, and amend_paste.

REST

REST-Schnellerstellung

curl -sk "$BASE/api/v1/pastes" \
  -H "Authorization: Bearer $PBCA_API_KEY" \
  -H 'content-type: application/json' \
  -d '{"mode":"unlisted","body":"hello from an agent","expires_in":"3h"}'