uses clipboard

Stash an OAuth token between two agents

Problem

Agent A (your main orchestrator) generates an OAuth token or short-lived credential that Agent B (a sub-agent on a different machine or session) needs. You don't want to write it to disk or pass it through the model context.

The MCP call

# Agent A: stash the token
clip = clipboard_put(
    text=oauth_token,
    ttl_minutes=15,   # short-lived — expires if B doesn't pull
    max_pulls=1,      # consumed on first pull
)
# Pass clip['handle_id'] to Agent B out-of-band (env var, config, etc.)
print(f'handle: {clip["handle_id"]}')

# ─────────────────────────────────────────────────────────────

# Agent B: retrieve the token
token = clipboard_pull(handle_id)   # returns raw string; entry consumed

What you get back

Agent A gets a ClipHandle with the handle_id. Agent B calls clipboard_pull with that ID and gets the raw token string back. The entry is consumed (max_pulls=1) so subsequent pulls fail cleanly.

Follow-up calls

For human retrieval, the pull_url in the handle shows the token in a browser tab (useful for debugging). Don't use this for long-lived secrets — use a secrets manager for those.

Notes

Clipboard is plain-text only. For files or binary data, use share. The TTL clock starts at creation, not at first pull.