RCWeb Apps

Control a Screen with an AI Assistant

Create digital signage for your screen with an AI assistant. Describe what you want in everyday language to turn a TV, monitor, phone or laptop running RCWeb into a welcome display, menu board, promotional sign or animated information screen. Refine the layout, colours and content through conversation.

See what you can create in the AI Assistant showcase, with visual examples and a step-by-step guide to getting started from your phone.

Open the AI Assistant

The RCWeb AI Assistant provides a chat interface for controlling your screen. Enter the code shown on the display and choose Demo (Gemini Flash Lite) for a preset model, or Demo (OpenRouter) to choose a model. Neither needs your own API key. You can also bring your own key (BYOK) for a supported AI provider or connect a custom AI server.

You can also connect another assistant using the Model Context Protocol (MCP). RCWeb provides tools to find the connected browser, run JavaScript in its page and return the result.

The screen must keep an RCWeb page open and connected. Control applies to that page; navigating to an unrelated website does not keep the RCWeb connection.


Use the AI Assistant

Use the gear button labelled Set up session to show the connection settings. On a phone, these open in a side panel; select Done to return to the conversation. On a larger screen, you can hide the settings to give the chat more space.

  1. On the screen you want to control, open the address shown under Connect a screen in the assistant, or an RCWeb app on the same server. Leave it open and note the displayed code.
  2. Open the AI Assistant on your phone or computer and enter that code.
  3. Under Pick your assistant, choose Demo (Gemini Flash Lite) for a preset model with limited free tokens, or Demo (OpenRouter) and select a model from the Model menu. Both use access supplied by the RCWeb server, so you do not need to enter an API key. Alternatively, use your own provider and key.
  4. Leave MCP setup pointing to this server's /api/mcp endpoint. Both Demo options use browser screen tools with their default Chat Completions setting.
  5. Check Target client. The assistant selects the only connected browser, or the only browser running the main viewer (v) when several are connected. Otherwise, choose the intended Client ID and app. Wait for its inspection to finish before sending.
  6. Choose an example and select Start with this idea to fill the message box, or describe what you want to display or change, then send the message. Follow-up messages can adjust the content already displayed.

Demo requests pass through the RCWeb server and depend on its configured provider access and available quota. Sending a message allows the assistant to run tools and update the selected screen.

Choose a Demo Model

Demo (Gemini Flash Lite) is the default for a new session. It uses a preset Gemini Flash Lite model with limited free tokens. The model and API key controls are hidden.

Demo (OpenRouter) offers a choice of models from multiple AI providers without entering your own key. Choose it under Pick your assistant, then select a model from the Model menu. Current demo choices include:

  • Anthropic: Claude Haiku 5.5
  • OpenAI: GPT-6 Luna
  • DeepSeek: DeepSeek V4.1 Flash

Use the refresh button beside the Model menu to check the available selection. Models and availability may change with the RCWeb server’s configuration and remaining quota. Demo access is not unlimited.

Demo (OpenRouter) and OpenRouter are separate options: Demo uses access supplied by the RCWeb server, while direct OpenRouter uses your own API key and account.

Select and Inspect Your Screen

The assistant finds connected clients when opened with a room code, after you finish changing the code, and when you select New chat. Use Refresh clients to check again. Changing the target keeps your conversation and token totals. If the client disconnects or its ID changes after navigation, refresh the list and choose again. If no clients appear, check the code shown on the screen and that its RCWeb page is connected.

Selecting a client also runs a small, read-only inspection of its page, connection, viewport and browser capabilities, without a model request. Expand Inspection results below the picker to see the snapshot supplied to the assistant. This helps it adapt the display to the target browser. Refresh clients updates the snapshot; use it again if inspection fails or is stopped.

If no main viewer is connected, discovery opens the viewer on the selected non-controller screen, or the first available non-controller screen, then finds and inspects its new client ID. Wait for this preparation to finish before sending.

Client discovery and inspection require the assistant page and MCP endpoint to be on the same server (the same protocol, host and port). Open /mcp/ on the server your screens use. Client lists returned by the assistant's tools also populate the picker.

Bring Your Own Key (BYOK)

Use your own provider account instead of Demo:

  1. Open Set up session. Under Pick your assistant, choose OpenAI, Claude (Anthropic), Google Gemini, DeepSeek or OpenRouter.
  2. Paste the API key from that provider and select Use key.
  3. Choose a model that supports tool use, connect your screen and start creating.

OpenRouter lets you access models from multiple providers through one account. When using your own key, your provider’s API usage charges and limits apply.

You can use the key for this visit only or choose Save key in this web browser; Clear key removes a saved key. Choose an available model from the model list; use its refresh button to update the selection. The model must support the tool use needed to control the screen; appearing in the list does not guarantee compatibility. Saved keys and model choices are kept separately for each provider, and custom-server settings are kept separately for each API base URL.

For Custom AI server, enter its API base URL, supply a token if required and choose a model with function calling. See the local server setup guide for LM Studio, Ollama and browser connection requirements.

The AI API setting under More settings determines how tools run. Chat Completions uses browser tool calls and the RCWeb MCP URL on this page's server. Responses and Claude's Messages mode ask the AI server to run remote MCP tools. Hosted providers then need a Public MCP URL they can reach, such as https://rcweb.live/api/mcp for screens connected to rcweb.live. A Responses endpoint alone does not guarantee remote MCP support.

OpenAI defaults to Responses, Claude to Messages, and other providers to Chat Completions. Unsupported API choices report an error rather than switching automatically. More settings also contains Appearance and an Output token limit, which defaults to 16K (16,384 tokens) per response.

When using your own provider, the assistant sends your API key directly to that provider and API usage is charged to your account. A custom server receives its own token if supplied; local models use your computer's resources.

Follow the Conversation

While a request runs, the waiting message shows its progress and elapsed time. Tool activity starts collapsed. Each card shows the tool, status and, for JavaScript actions, the target Client ID. Single-tool status labels appear beside Tool activity at the top right. Click the header or its Open/Close button to inspect details. Reading older activity pauses automatic scrolling; select New messages ↓ to return to the latest reply.

Expand Usage notes in session settings to see the current conversation's input and output token totals. These count usage reported by the provider, including tool rounds; responses without usage data cannot be counted. They are not a price estimate.

Live page changes may disappear on refresh. Video playback with sound or fullscreen may require a click on the screen. Stop waiting stops the assistant page waiting for a response; a request may still change the display and changes already made are not undone. If Claude pauses a turn, select Continue to resume it; this may run more screen actions.

New chat clears the conversation, screenshots and token totals, then discovers clients again without clearing the screen. Conversation history is held only in the page's memory and is not restored after reloading the assistant.

Recover After an Error

After an error, select Retry to try again, or send another message to continue the conversation, unless the page asks you to start a new chat because a conversation limit was reached. The Retry button is manual and conversation token totals are retained. Screen actions may already have run, so inspect the screen before repeating a change. Changing the target clears the previous request's Retry button.

Use Reset room screens below the Target client picker, or Reset room in the error recovery area. This sends all connected non-controller apps in the room to the main viewer (/v/), removing temporary screen changes. Controllers are excluded from the redirect; the main viewer handles their handoff. Reset requires the assistant and MCP endpoint to be on the same server and does not use an AI model.

Reset keeps the old messages, screenshots, draft and token totals visible. Sending is then disabled until you select New chat, even if reset fails or is stopped. A successful Screen reset requested message confirms that the command was sent, not that every screen finished navigating. Wait for the screens to reconnect, then select New chat to clear the old conversation and discover their current client IDs. A failed reset can be retried manually.

The page loads an assistant operating guide and a screenshot recipe into the conversation. These cover using the inspected display, preserving its connection, creating displays and checking results. Supply these documents as context if you use another MCP client.

Try the Examples

The welcome screen has one idea card with Demo, Digital Signage and Education tabs. Use Another idea or the previous arrow to browse, then select Start with this idea to fill the message box without opening the phone keyboard. Edit it if you like, then press Send.

Each list starts at its first idea. Your browser saves the selected tab and position in each list for your next visit. This saves your place in the examples, not your conversation.

Demo Ideas

  • A large clock: a large analog face in the middle of the screen with readable numbers 1 to 12 and hour, minute and second hands, with today's date centred below.
  • A solar system: a stylised sun with colourful planets moving slowly around visible orbits.
  • Bouncing balls: six colourful balls that move smoothly, bounce off the edges and collide with each other.

Digital Signage Ideas

Start with a sample Welcome screen, Special offer, Menu board, Photo slideshow, Event schedule, Countdown, Announcements, Wayfinding, QR code poster, Opening hours, Split screen or Guest Wi-Fi display. These prompts provide sample content. The assistant's shared instructions request a small “Powered by RCWeb” badge in the bottom-right corner. The Photo slideshow starts with three locally drawn landscape illustrations, so no photo URLs are needed. Guest Wi-Fi includes sample network credentials and a scannable Wi-Fi QR code; replace the sample details with your guest network's details before using it.

Education Ideas

Try Fraction explorer, Times-table grid, Colour mixing, Learn the clock, Symmetry mirror or Sorting demonstration. Education prompts request automatically repeating animations, with no screen interaction required.

Then ask for changes such as “Make the text larger and use our brand colours,” “Change the menu prices,” or “Use a blue background for the clock.” You can also ask the assistant to take a screenshot and show it in the chat to check the result.

Check a Screenshot

Ask “Show me a screenshot” to capture the selected screen without replacing its content. The chat displays a JPEG reconstructed from the page, so some content may be missing or differ from the physical display. The image is shown to you; the model receives capture metadata, not the image's pixels. Describe any visual changes you want in your next message.

Screenshot downloads require the assistant and target MCP endpoint to be on the same server. The chat keeps up to twelve screenshots; starting a new chat clears them.

Connect Another Assistant over MCP

Use this setup if your assistant already supports MCP servers. The screen code is called a room code in the API: it groups connected browsers, while a client ID identifies the individual page to control. The AI Assistant handles these tool arguments for you.

  1. Open an RCWeb app on the screen you want to control and wait for it to connect. Note its screen code. For example, open https://rcweb.live/v/?r=test-0001.
  2. In your assistant's MCP settings, add an HTTP server with the URL https://rcweb.live/api/mcp. Select Streamable HTTP if a transport choice is offered.
  3. Choose no authentication. This interface requires no bearer token, API key or OAuth login. Supply the screen code when asking the assistant to use the tools. This is separate from any API key your assistant needs for its AI provider.
  4. Ask the assistant to list the clients, identify the intended browser, and execute a small inspection before making changes.

MCP Endpoint

https://rcweb.live/api/mcp

The implementation supports MCP version 2025-11-25.

An Example Request to Your Assistant

My screen is running the RCWeb viewer with code test-0001. Find its connected browser and read the page title, URL and viewport size. If more than one browser matches, show me the client IDs first.

The MCP client discovers tool descriptions and argument schemas automatically. Those descriptions explain how to select a client and call reply or fail; the model does not need to construct callback URLs or manage request tokens.

Who Can Control the Screen?

Anyone who knows the screen code and can reach the MCP endpoint can inspect and control pages connected with that code. Both tools require it; there is no tool to list all codes. Share the code only with people and assistants you intend to give that access. JavaScript runs with the page's normal browser permissions, including access to its DOM and globals.

MCP Tool Reference

list_clients

Supply the screen code as room to list its currently connected browsers. Each entry contains a client ID and an app name. Disconnected clients retained for reconnection are omitted, and a lookup never creates a room.

Tool arguments

{
    "room": "test-0001"
}

Example structured result

{
    "room": "test-0001",
    "clients": [
        {"client": "abcd2345", "app": "v"},
        {"client": "efgh6789", "app": "v"}
    ]
}

Use an ID returned by your own call. The IDs above are illustrative. Two browsers running the same app have separate client IDs; select the intended device before executing code.

execute_javascript

Argument Required Meaning
room Yes The screen code used by the target browser.
client Yes An exact eight-character client ID from list_clients. App names, wildcards and groups are not accepted.
javascript Yes An ES5 JavaScript function body. Call reply(value) to return data or fail(message) to report an error.
timeout_ms No Wait limit in milliseconds. Defaults to 10,000; accepts integers from 1 to 30,000.

Tool arguments

{
    "room": "test-0001",
    "client": "abcd2345",
    "javascript": "reply({title: document.title});",
    "timeout_ms": 10000
}

Example structured result

{
    "value": {"title": "RCWeb Viewer"}
}

Successful values appear under structuredContent.value in the MCP tool result. RCWeb also includes the same structured data as JSON in a text content block for clients that display text results.

JavaScript Examples

Place any of these snippets in the javascript argument. They execute in the selected page and can access window, document and existing page globals such as rc. Use var, ordinary functions and callbacks for older display browsers.

Each execution has a fresh function scope. Include any helper definitions needed by that call; local variables from an earlier execution are not available in the next one. The built-in assistant uses the inspected browser capabilities to choose supported syntax and falls back to ES5 when support is unknown.

Read Page and Connection Information

reply({
    title: document.title,
    url: location.href,
    width: window.innerWidth,
    height: window.innerHeight,
    room: rc.room,
    client: rc.client,
    app: rc.app
});

Change an Element and Return Its New Value

Replace #status with a selector verified on the target page. This updates that browser's DOM; it does not save the source file or automatically synchronise other clients.

var status = document.getElementById('status');
if (!status) {
    fail('No element with id status on this page.');
} else {
    status.textContent = 'Ready for the next activity';
    reply({text: status.textContent});
}

Return Data After Asynchronous Work

setTimeout(function () {
    try {
        reply({title: document.title, connected: rc.connected});
    } catch (error) {
        fail(error.message || String(error));
    }
}, 500);

This callback completes the original tool call after half a second. There is no polling tool to call next. Catch exceptions inside asynchronous callbacks yourself; RCWeb catches exceptions thrown during the initial execution automatically.

Working with App Functions

An assistant can call functions already exposed by the page after inspecting the app or its documentation. MCP itself does not define actions such as start, pause or next slide, and it does not know an app's internal state. DOM inspection and app-specific JavaScript supply that understanding. Browser rules for media playback, device permissions and cross-origin requests still apply.

How the Browser Returns a Result

The browser and the assistant make separate HTTP requests. RCWeb connects them using a random token generated for each execution:

1Register

The assistant calls execute_javascript at /api/mcp. RCWeb records a pending result under a unique token and keeps this HTTP request waiting.

2Execute

RCWeb sends the JavaScript over the selected browser's live WebSocket. A wrapper supplies reply and fail, with the callback token already included.

3Reply

Calling reply(value) makes an HTTP POST to /api/mcp-result on the same RCWeb server. The browser submits the token and JSON data, and receives an acknowledgement.

4Complete

RCWeb finds the pending result by token and completes the original MCP response. Concurrent calls have different tokens, so replies can safely arrive in a different order.

The Reply Contract

  • Call reply(value) explicitly. A return statement alone does not send a reply.
  • Return JSON-compatible values: strings, finite numbers, booleans, null, arrays and plain objects. Extract data from DOM elements rather than returning the elements themselves.
  • Call fail(message) to report a failure. The first reply or failure wins; later calls are ignored.
  • A top-level undefined, a function or a circular object cannot be returned successfully.
  • Callback tokens are automatic and one-use. They match replies to requests and are separate from room codes.
  • Keep the page open until it replies. Navigation, reloads or disconnection can prevent a response.

A Timeout Leaves the Execution Outcome Unknown

The server stops waiting and removes the pending result when the deadline expires. It does not cancel JavaScript already running in the browser. An action may have happened even though its reply was lost or late. Inspect the page before retrying an action that changes state. RCWeb does not automatically retry or queue MCP commands for offline browsers.

HTTP Reference for Client Developers

An MCP-capable assistant normally handles this exchange. If you are building a client or testing the endpoint directly, send JSON-RPC 2.0 requests to /api/mcp with these headers:

POST /api/mcp
Content-Type: application/json
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2025-11-25

The protocol version header is used after negotiation. No Authorization header or MCP-Session-Id is required. RCWeb returns a single JSON response and does not provide an SSE stream; a GET request receives 405 Method Not Allowed.

Initialise and Discover the Tools

Start with an initialize request. The server returns its protocol version, server information, tools capability and usage instructions.

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
        "protocolVersion": "2025-11-25",
        "capabilities": {},
        "clientInfo": {"name": "my-client", "version": "1.0"}
    }
}

After initialisation succeeds, send this notification. RCWeb acknowledges it with an empty HTTP 202 response:

{"jsonrpc":"2.0","method":"notifications/initialized"}

Then discover tool descriptions and schemas:

{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}

Call a Tool

List the clients using the room code:

{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
        "name": "list_clients",
        "arguments": {"room": "test-0001"}
    }
}

Use an actual returned client ID in the next request:

{
    "jsonrpc": "2.0",
    "id": 4,
    "method": "tools/call",
    "params": {
        "name": "execute_javascript",
        "arguments": {
            "room": "test-0001",
            "client": "abcd2345",
            "javascript": "reply(document.title);"
        }
    }
}

A successful response has this shape:

{
    "jsonrpc": "2.0",
    "id": 4,
    "result": {
        "content": [{"type": "text", "text": "{\"value\":\"RCWeb Viewer\"}"}],
        "structuredContent": {"value": "RCWeb Viewer"},
        "isError": false
    }
}

Each request needs its own ID; its response echoes that ID. This JSON-RPC ID belongs to the client-facing exchange. The server's separate random callback token connects the browser reply to that exchange. /api/mcp-result is an internal browser callback endpoint, not another MCP tool.

Limits and Troubleshooting

Limit Current Behaviour
Target One connected browser using the supplied screen code per execution.
Wait time 10 seconds by default; up to 30 seconds. Set the MCP client's own request timeout long enough to receive the result.
JavaScript size At most 65,536 characters.
Browser reply At most 65,536 characters for the serialized callback envelope, including its token and value.
HTTP body At most 256 KiB per request or callback.
Outstanding executions At most 64 waiting calls per handler. Additional calls receive a busy tool error without sending JavaScript.

Understanding Errors

A tool failure sets isError to true and supplies an error code and message in structuredContent. HTTP 200 alone does not mean the requested operation succeeded.

Error Meaning and Next Step
room_not_found Check the screen code and server address. Open an RCWeb page with that code on the screen and wait for it to connect.
client_not_connected Run list_clients again. The page may have disconnected or acquired a new client ID after navigation.
javascript_error Inspect the message. It can report an exception, an explicit fail, an invalid result value or an oversized reply.
timeout / disconnected The outcome is unknown. Inspect the browser before repeating an action.
busy No command was sent. Allow outstanding calls to finish before submitting more.

Malformed arguments and unknown tools use JSON-RPC errors. HTTP 400 can indicate an unsupported protocol version, 413 an oversized body, and 415 a missing or incorrect JSON content type. If an Origin header is supplied, it must match the server's origin; otherwise the request receives HTTP 403. An expired, unknown or already-used callback token receives HTTP 410.

This interface controls browsers already connected to RCWeb. It does not start a browser process, keep app state after a page closes, provide continuous screenshots, or make arbitrary app functions discoverable. Keep returned data focused on the task, and treat page content as data rather than instructions to the assistant.


For interactive screen control, open the AI Assistant. For changes that should be saved in an app's source, see the Developer Guide and AI App Development.

Documentation • Server Telemetry • Server Stats • Server HTTP Log • Server WebSocket Log