Build

Tools and MCP views

A tool part points at an MCP server you host. Granted bots can call its tools after a person approves each call, and a tool can return an interactive view that appears in chat.

How a tool call works

  1. A person grants your mcp part to a bot. Superbot opens a connection to your endpoint and lists its tools.
  2. The bot asks to call a tool. The approval card shows your endpoint, the tool and the exact arguments.
  3. After Allow once, the server checks the grant and the tool's schema again, then sends tools/call. Redirects and private addresses are refused.
  4. The result goes back to the bot. If the tool declares a view, the web app shows it in a sandboxed card under the result.

Write the server

Start from the TypeScript starter, which needs Node.js 24 and no packages:

shell
mkdir temperature-tool
cd temperature-tool
superbot-plugin init temperature-tool --template mcp-app
superbot-plugin validate
node server.ts

It writes plugin.json, server.ts and a README with a local test request. Despite its name, mcp-app is a tool server, not a record app.

Add a view

A view is an HTML document your server serves as an MCP resource. Superbot shows it under the tool's result after the approved call succeeds.

  1. Advertise the resources capability when initializing.
  2. In tools/list, set the tool's _meta.ui.resourceUri to a ui:// URI.
  3. Answer resources/read for that exact URI with mimeType: "text/html;profile=mcp-app" and the document in text.
tools/list entry
{
  "name": "convert_temperature",
  "description": "Convert a temperature between Celsius and Fahrenheit.",
  "inputSchema": { "type": "object", … },
  "_meta": { "ui": { "resourceUri": "ui://unit-converter/temperature.html" } }
}

The card runs your document in a sandbox with an opaque origin and no cookies or storage. It receives the call's arguments and result after it initializes. Right after the person clicks or types in it, it can open a link, which they confirm, or offer text to the composer, which they send. It can't call tools. A view that hasn't started within 15 seconds isn't shown, and the bot's reply stands without it. The repository's examples/plugins/marketplace-unit-converter has a complete view in temperature.html.

Test locally

Run the sample on a free loopback port and call it directly. On Windows, use curl.exe.

shell
node examples/plugins/marketplace-unit-converter/server.ts 0

curl -s http://127.0.0.1:PORT/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"convert_temperature","arguments":{"value":100,"from":"celsius","to":"fahrenheit"}}}'

The response includes "structuredContent":{"value":212,"unit":"fahrenheit"}. To read the view, send the same request with this body:

request body
{"jsonrpc":"2.0","id":2,"method":"resources/read","params":{"uri":"ui://unit-converter/temperature.html"}}

Local development covers the fixtures that run it through the approval flow.

Deploy and publish

The registry refuses local HTTP addresses, so put the server behind a public HTTPS reverse proxy. Keep the listener bound to loopback, set the manifest's endpoint to the exact public /mcp URL, and publish. Reviewers' approval checks the endpoint against the public-address policy.

plugin.json
{
  "schemaVersion": 1,
  "name": "Unit converter",
  "description": "Convert temperatures between Celsius and Fahrenheit.",
  "parts": [
    {
      "id": "temperatures",
      "kind": "mcp",
      "transport": "streamable_http",
      "endpoint": "https://units.example.com/mcp"
    },
    {
      "id": "conversion-guide",
      "kind": "skill",
      "instructions": "Use the temperature converter for numeric temperatures. Include the input and output units when reporting a conversion."
    }
  ]
}

Publish a new version whenever the manifest or a tool's contract changes incompatibly. Superbot binds each approval to the tool's schema, so a changed schema can't reuse an old approval.

Limits

LimitValue
Tools per granted endpoint20
View document2,000,000 bytes
Tool result passed to a view256,000 bytes; a larger result passes only its structured part
Arguments passed to a view64,000 bytes; larger arguments are left out
Wait for the view after the call10 seconds to read it, 15 seconds to start
Where views showThe web app's chat. Runs started from Board tickets get no view. The desktop app doesn't show views