Developer

Clipboard API

Read and write the system clipboard from your custom applet.

Clipboard API

The Clipboard API provides read and write access to the system clipboard (plain text).

Capabilities required: clipboard:read and/or clipboard:write

Frontend (iframe)

import { createResourceClient } from "@rightplace/sdk";

const rp = createResourceClient();
await rp.ready();

// Write text to clipboard
await rp.clipboard.write("Hello from my applet!");

// Read text from clipboard
const text = await rp.clipboard.read();
// -> "Hello from my applet!"

Backend (Node.js)

import { createResourceServer } from "@rightplace/sdk/server";

const server = createResourceServer({
  methods: {
    copyResult: async (params, { rp }) => {
      await rp.clipboard.write(params.text);
      return { ok: true };
    },

    pasteInput: async (_params, { rp }) => {
      const text = await rp.clipboard.read();
      return { text };
    },
  },
});

server.start();

MCP

Not exposed as an MCP tool - reading or writing the user’s clipboard from an agent tool isn’t something we want to expose by default. Use an applet-scoped method if you need to clip agent output to the system clipboard.

RobinPath Bridge

Clipboard write is a static method on the bridge (no MCP round-trip):

rightplace.clipboard_copy "sha: a1b2c3d4"
log "copied!"

There is no rightplace.clipboard_read - a RobinPath script cannot read the clipboard. (This mirrors the iframe SDK: applets must declare clipboard:read and call rp.clipboard.read() from the iframe.)

API Reference

rp.clipboard.read()

ParameterTypeDescription
ReturnsPromise<string>The current clipboard text

Throws if no text is on the clipboard.

rp.clipboard.write(text)

ParameterTypeDescription
textstringThe text to copy to clipboard
ReturnsPromise<void>

Manifest Configuration

{
  "capabilities": [
    "clipboard:read",
    "clipboard:write"
  ]
}

Notes

  • Only plain text is supported. Images and files cannot be read or written through this API.
  • The clipboard:read and clipboard:write capabilities are separate - you can request only the one you need.