Menu

MCP: p2p

P2P apps: signaling, relay, TURN, mailbox

Toolsetp2p (default)
Tools10
Permissions granted by weird mcp setupp2p:read, p2p:write
With --read-onlyp2p:read
Turn it onon by default

weird_p2p_apps#

P2P apps. List the user's p2p apps, or show one (by app_id) with its addresses, origins, settings, mailbox and billing state. Small credit charge per successful request (charge key p2p.reads per_request in weird_credits_charges); failed calls are free.

Changes somethingno (read-only)
Needs confirmed: trueno
Costa small credit charge per successful request (failed calls are free)
CallslistP2pApps, getP2pApp

Arguments:

  • app_id, string — show this app instead of listing

weird_p2p_app_create#

Create a p2p app. Create a p2p app answering on its name under the p2p domain, with the web origins allowed to connect, its limits and the offline mailbox on or off. BILLS HOURLY while it exists (see weird_credits_charges; the first hour must be covered). Charge keys (see weird_credits_charges): recurring.p2p-app-hourly at per_hour, every hour while it exists; recurring.p2p-app-hourly at per_mb_hour_cached × the mailbox's cached MB, every hour while it exists; p2p.relay-traffic at per_mb_relayed, as used; p2p.mailbox-traffic at per_mb_served_mailbox, as used.

Changes somethingyes
Needs confirmed: trueyes (costs credits)
CallscreateP2pApp

Arguments:

  • confirmed, boolean, required — must be true, and only after the user explicitly agreed to this action and its cost or consequence
  • idempotency_key, string — optional, for an action that costs credits: pass the same value again if you retry this exact action; a repeat never creates or bills a second one. Leave it out the first time: the answer returns the key used
  • mailbox_enabled, boolean — turn the offline mailbox on
  • name, string, required — a DNS label: 1-63 of a-z, 0-9 and inner hyphens
  • origins, null or array of strings — web origins allowed to connect (exact, or *.domain wildcards; at most 20); none admits any origin
  • settings, object — limits as key: positive integer, held under their ceilings

weird_p2p_app_update#

Change a p2p app. Change a p2p app's origins, settings, relay, mailbox or who may mint mailbox tokens; keys left out are untouched. Free. origins and settings each REPLACE the whole list or map: read them first with weird_p2p_apps and send the complete new value. Turning the mailbox off drops its stored messages.

Changes somethingyes
Needs confirmed: trueno
Call firstweird_p2p_apps
CallsupdateP2pApp

Arguments:

  • app_id, string, required — the app's id
  • mailbox_enabled, null or boolean — the offline mailbox on or off (off drops its messages)
  • mailbox_open_mint, null or boolean — whether browsers may mint mailbox tokens themselves
  • origins, null or array of strings — the COMPLETE new origin list (replaces the current one; an empty list admits any origin)
  • relay_enabled, null or boolean — the relay on or off
  • settings, object — the COMPLETE new settings map (replaces the current one)

weird_p2p_app_delete#

Delete a p2p app. Delete a p2p app: its clients lose it at once, its mailbox is dropped and its hourly billing stops. Free. Irreversible.

Changes somethingyes
Needs confirmed: trueyes (cannot be undone)
CallsdeleteP2pApp

Arguments:

  • app_id, string, required — the app's id
  • confirmed, boolean, required — must be true, and only after the user explicitly agreed to this action and its cost or consequence
  • idempotency_key, string — optional, for an action that costs credits: pass the same value again if you retry this exact action; a repeat never creates or bills a second one. Leave it out the first time: the answer returns the key used

weird_p2p_domains#

App hostnames. List a p2p app's own hostnames with their state and the DNS record each needs. Small credit charge per successful request (charge key p2p.reads per_request in weird_credits_charges); failed calls are free.

Changes somethingno (read-only)
Needs confirmed: trueno
Costa small credit charge per successful request (failed calls are free)
CallslistP2pAppDomains

Arguments:

  • app_id, string, required — the app's id (from weird_p2p_apps)

weird_p2p_domain_attach#

Add an app hostname. Add one of the user's hostnames to a p2p app; the answer names the record to point it at (it goes live once the record has held two minutes). Free. At most 5 per app; a hostname another product uses is refused.

Changes somethingyes
Needs confirmed: trueno
CallsattachP2pAppDomain

Arguments:

  • app_id, string, required — the app's id
  • hostname, string, required — a fully qualified hostname of the user's
  • wildcard, boolean — a wildcard hostname (its zone must be hosted for the user)

weird_p2p_domain_verify#

Check an app hostname. Check an app hostname's DNS now instead of waiting for its next turn. Free.

Changes somethingyes
Needs confirmed: trueno
CallsverifyP2pAppDomainDns

Arguments:

  • app_id, string, required — the app's id
  • domain_id, string, required — the app hostname's id (from weird_p2p_domains)

weird_p2p_domain_detach#

Remove an app hostname. Remove a hostname from a p2p app; clients using it lose the app. Free. Irreversible (attach it again to restore it).

Changes somethingyes
Needs confirmed: trueyes (cannot be undone)
CallsdetachP2pAppDomain

Arguments:

  • app_id, string, required — the app's id
  • confirmed, boolean, required — must be true, and only after the user explicitly agreed to this action and its cost or consequence
  • domain_id, string, required — the app hostname's id (from weird_p2p_domains)
  • idempotency_key, string — optional, for an action that costs credits: pass the same value again if you retry this exact action; a repeat never creates or bills a second one. Leave it out the first time: the answer returns the key used

weird_p2p_mailbox#

Mailbox deposit or replay. Deposit a payload in a room of a p2p app's offline mailbox (action send), or replay a room's messages (action receive). Free. Cached and served bytes are billed per MB. The mailbox must be on (weird_p2p_app_update). Payloads are stored as sent: encrypt sensitive data first.

Changes somethingyes
Needs confirmed: trueno
CallsmintP2pMailboxCredentials

Arguments:

  • action, string, required — send or receive
  • after, string — receive: replay forward from this seq
  • app_id, string, required — the app's id
  • base64, boolean — send: the payload is base64
  • before, string — receive: scroll back from this seq
  • limit, integer — receive: at most this many
  • payload, string — send: the payload (text, or base64 with base64 true)
  • room, string, required — the room id

weird_p2p_protocol#

P2P protocol document. Return the protocol a p2p app's clients speak: discovery, signaling messages, origins and limits, TURN, the relay and the offline mailbox. Free. Read it before writing client code.

Changes somethingno (read-only)
Needs confirmed: trueno

No arguments.

This page is generated from the weird CLI; it changes when the CLI does.