Skip to main content

Build an extension

An extension is a package that adds capabilities to Rational AI: MCP tools for agents, skills, a messaging channel, a source that Knowledge syncs from, or a processing workflow. Write a manifest.json that declares what the package provides, add the code it runs, package it, and install it from the Control Room.

To install or configure an extension someone else built, see Manage extensions.

Before you begin​

  • An administrator account in the Control Room. Only administrators can add private extensions.
  • A UUID for the extension (uuidgen). Generate it once and keep it for every release.

Lay out the package​

Keep one source directory per extension:

my-extension/
├── manifest.json # identity and providers (required)
├── icon.png # icon shown in the Extensions list
├── skills/ # optional: one folder per skill, each with a SKILL.md
└── dist/ # built code the manifest points at

A remote MCP extension ships no code. The manifest.json alone is the package.

Write the manifest​

Every manifest starts with the same fields:

FieldRequiredDescription
idYesThe extension's UUID. Keep it for the life of the extension.
nameIdentifierYesA short slug, such as time. With version, it names the package root.
versionYesThe release version, such as 1.0.0.
nameYesThe name shown in the Control Room.
descriptionNoWhat the extension does, shown before install.
iconNoAn image URL or a data: URI. Leave it empty to use the bundled icon.png.
channelProviders, mcpServerProvidersYesProvider arrays. Include them, empty if unused.
sourceProviders, workflowProviders, ruleProviders, knowledgeProviders, widgetProvidersNoFurther provider arrays. Omit the ones you don't use.
listingNoHow the extension appears in the Marketplace. See List the extension in the Marketplace.

What the extension does depends on which provider arrays you fill:

Provider arrayWhat it adds
mcpServerProvidersTools that agents and touchpoints call, from a local process or a remote MCP server
channelProvidersA messaging channel users talk to the assistant through
sourceProvidersA source that a Knowledge syncs files from
workflowProvidersA processing workflow for Knowledge files
ruleProvidersA processing rule that routes files to workflows
knowledgeProvidersA ready-to-use Knowledge with its views, collections, records, agents and BI dashboards, as in Marketplace solutions
widgetProvidersA custom element that renders a tool's calls in the chat

Skills don't need a provider. Rational AI registers every skills/<name>/SKILL.md in the package when the extension is installed. It reads name, description and version from the file's front matter, and uses the folder name when name is missing. To offer skills in chat, see Use skills in chat.

Add a local MCP server​

A local server is a process Rational AI starts over stdio. Omit transportType and give the command and arguments:

{
"id": "fcb66d0a-1557-4041-8f93-2adc1999608f",
"nameIdentifier": "time",
"version": "1.0.0",
"name": "Time",
"description": "Get the current time and convert between IANA time zones.",
"icon": "",
"channelProviders": [],
"mcpServerProviders": [
{
"id": "time-server",
"name": "Time-server",
"path": "",
"command": "uvx",
"arguments": ["mcp-server-time", "--local-timezone=Europe/Rome"],
"configuration": {}
}
]
}
FieldDescription
idA stable identity for the server across releases. Older manifests omit it, and the name is used instead.
command, argumentsThe process to start and its arguments.
pathThe working directory, relative to the package root, such as dist.
environmentEnvironment variables for the process.
installScript, uninstallScriptCommands run once when the extension is installed or removed.
beforeCallScript, afterCallScriptCommands run around each tool call.
configurationThe values the administrator enters. See Declare configuration fields.

Add a remote MCP server​

A remote server already runs elsewhere, and Rational AI connects to it over HTTP. Set transportType to http and give a url and optional headers:

{
"id": "407134fe-a77a-4fe5-8d9e-5ab08c4a01ad",
"nameIdentifier": "github-remote",
"version": "1.0.0",
"name": "GitHub (Remote)",
"icon": "https://example.com/github.svg",
"channelProviders": [],
"mcpServerProviders": [
{
"name": "GitHub Remote MCP Server",
"transportType": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": { "Authorization": "Bearer ${accessToken}" },
"configuration": {
"accessToken": {
"title": "GitHub Personal Access Token",
"provider": { "kind": "value", "type": "{ \"type\": \"string\" }" },
"isRequired": true,
"isHidden": false
}
}
}
]
}

A remote server authenticates with a value carried in a header, such as a token or key. A manifest can't describe an interactive OAuth flow, so use a server that accepts a token.

Add a channel​

A channel lets users reach the assistant through a messaging service. Declare it under channelProviders:

{
"channelProviders": [
{
"id": "4c0369fa-ac30-4851-993f-ada2965d5e0c",
"name": "Telegram chat service",
"description": "Exchange messages through Telegram.",
"type": "Telegram",
"configuration": {
"token": {
"alias": "Bot Token",
"description": "The bot token issued by BotFather.",
"type": "{\"type\": \"string\"}",
"isRequired": true,
"isHidden": false
}
}
}
]
}

type is one of Telegram, Whatsapp, Email, Teams, Slack, RationalAI, OpenAIApi or None. A channel with a runtime block is program-driven: Rational AI runs your program over stdio with the channel-rpc-v1 protocol to provision the channel, receive messages, and send replies. TODO(verify): the request and response shapes of channel-rpc-v1.

Add a source​

A source provider becomes a source type you can attach to a Knowledge. At each sync, Rational AI runs the program in runtime, writes the source configuration as JSON to its stdin, and reads a { "files": [...] } list from its stdout. Rational AI then downloads the files itself.

{
"sourceProviders": [
{
"id": "c0b2f8d3-4e5a-4b7c-9d2e-3f6a8b0c1d22",
"name": "ArXiv Catchup",
"description": "Download arXiv PDFs matching a category and time window.",
"runtime": {
"path": "dist",
"command": "uv",
"arguments": ["run", "arxiv_catchup.py", "list"],
"protocol": "list-json-v1"
},
"expiry": { "mode": "window" },
"configuration": {
"category": {
"alias": "Category",
"description": "arXiv category to fetch, for example cs.AI.",
"type": "{\"type\":\"string\"}",
"isRequired": true,
"isHidden": false
}
}
}
]
}
FieldDescription
runtime.command, runtime.argumentsThe program that lists the files.
runtime.pathIts working directory, relative to the package root.
runtime.protocolThe contract version. Use list-json-v1.
expiry.modewindow deletes previously synced files that the program no longer returns. none (the default) never deletes.

Each entry in files needs a unique filename and either a url to download or the file's content encoded in base64. It can also carry mimeType, submittedDate and loadAsResource:

{
"files": [
{ "filename": "piece.jpg", "url": "https://example.com/piece.jpg", "mimeType": "image/jpeg" },
{ "filename": "piece.json", "content": "eyJ0aXRsZSI6ICIuLi4ifQ==", "mimeType": "application/json", "loadAsResource": false }
]
}

A file with loadAsResource omitted or true becomes a resource of the Knowledge and is processed. A file with false is stored next to the others for a workflow to read, and never becomes a resource. Set false on metadata and sidecar files, or they arrive as empty resources. A processing rule can't stop a file from being loaded. Changing the flag on a file that already synced takes effect on the next sync.

A sync fails if the program writes nothing to stdout or stderr for 30 minutes.

Add a workflow​

A workflow provider points at a script in the package. On install, Rational AI registers it as a processing workflow that can be assigned to Knowledge files.

{
"workflowProviders": [
{
"id": "transcribe-media",
"name": "Transcribe Audio/Video",
"description": "Transcribe an audio or video file into a Markdown resource.",
"path": "dist",
"script": "transcribe_workflow.py",
"timeout": 30,
"isActive": true
}
]
}
FieldDescription
pathThe folder inside the package that holds the script, such as dist.
scriptThe script's filename, relative to path.
timeoutThe timeout of each run, in minutes.
isActiveWhether the workflow can be assigned right after install. Default: true.

The script is an ordinary workflow: a process(document, options) function passed to run, with its dependencies declared inline in PEP 723 format:

#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = ["rational-client", "faster-whisper"]
# ///
from rational_client.core import File, Knowledge
from rational_client.utils import run


def process(document: File, options: dict):
knowledge = Knowledge(document.knowledge_id)
resource = knowledge.create_resource(name=document.name, file_id=document.id)
markdown = transcribe(document.get_data()) # your logic here
return {str(resource.resource_id): markdown}


run(process)

A workflow installed from an extension appears in Settings → Workflows and can be assigned, but it is read-only. Uninstalling the extension deletes the workflow, unless a Knowledge uses it. In that case the workflow stays and becomes editable.

A rule provider has the same id, name, path and script fields and registers a processing rule. Installing a newer release updates a rule whose code changed.

Add a chat widget​

A widget provider ships a script that defines one custom element. When an agent calls a tool with the same name as the element, the chat renders the call with your element instead of the raw arguments.

{
"widgetProviders": [
{ "tagName": "ticket-routing", "path": "dist/widget/tickets.js", "description": "Pick the office that handles a ticket." }
]
}

tagName must equal the tool name, and a custom element name must contain a hyphen, so name the tool accordingly. path is relative to the package root.

Declare configuration fields​

A provider that needs values (credentials, endpoints, options) declares a configuration map. Each key is one field of the form the administrator fills in after install.

FieldDescription
title (MCP servers), alias (channels and sources)The label of the field.
descriptionHelp text. HTML links are allowed.
isRequiredWhether a value is required.
isHiddentrue for values the administrator doesn't enter, such as a webhook URL.
defaultValueThe pre-filled value.
type (channels and sources)A JSON Schema encoded as a string, such as "{\"type\":\"string\"}".
provider (MCP servers)Where the value comes from. { "kind": "value", "type": "<JSON Schema as a string>" } is typed in. { "kind": "connector", "type": "braveApiKey" } is a saved connector of that type.

A hidden field with { "kind": "connector", "type": "rational" } is filled with the built-in Rational AI connector. Use it for a server that calls the Rational AI API. Its value has baseUrl and apiKey.

Use a field's value elsewhere in the MCP server entry with ${fieldName}, in environment, arguments, url and headers. Reach inside an object value with a dot:

"environment": {
"BACKEND_ADDRESS": "${rationalai.baseUrl}",
"BACKEND_API_KEY": "${rationalai.apiKey}"
}

In arguments, ${fieldName?--flag} adds --flag only when the value is set and not false. An argument that resolves to an empty string is dropped.

List the extension in the Marketplace​

A manifest with a listing block becomes a solution in the Marketplace when its release is published to the Rational AI catalogue. A private upload keeps no listing. Texts are maps keyed by language, and the only allowed keys are it and en.

{
"listing": {
"tagline": { "en": "Companies, contacts and pipelines in one place.", "it": "Aziende, contatti e pipeline in un solo posto." },
"industries": ["services"],
"useCases": ["customer-service", "sales"],
"description": "listing/description.{lang}.md",
"screenshots": [
{ "path": "listing/pipeline.{lang}.png", "label": { "en": "Pipeline" }, "caption": { "en": "Opportunities by stage" } }
],
"setup": [
{ "key": "owners", "title": { "en": "Assign the owners" }, "text": { "en": "Set Owner on companies and contacts." } }
]
}
}
FieldDescription
taglineThe line under the name.
industriesKeys from a fixed list: manufacturing, public-sector, retail, culture, defense, energy, healthcare, finance, services.
useCasesKeys from a fixed list, such as compliance, sales, customer-service or document-processing. An unknown key is refused on upload, and the error lists the allowed ones.
descriptionThe path of a Markdown file in the package. {lang} is replaced by each language.
summary, stepsThe How it works section: a short paragraph, and steps with when, title and text.
collectionsThe collections the solution creates, each with its name, a description and the names of its views.
screenshotsImages with path, label and caption. PNG, JPEG or WebP, up to 5 MB each. {lang} in the path selects a per-language image.
coverAn optional cover image: a 16:9 PNG from 1600×900 to 7680×4320 pixels.
setupThe checklist shown after install. Each step has a unique key of lowercase letters, digits and hyphens, plus title and text.
sourceThe outside source the solution reads: name, schedule and reads.
questionsExample questions for the assistant.

The name, version, and icon come from the manifest. The counts of views, dashboards, tools, skills, workflows, and example records are computed from the package on upload.

Package the extension​

The package is a .tar.bz2 (or .zip) with exactly one root folder named <nameIdentifier>-<version>, which holds manifest.json. Paths in the manifest, such as dist, are relative to that folder. The package can't contain symbolic links, and is limited to 1 GiB compressed, 2 GiB expanded and 100,000 files.

  1. Build your code into dist/.

  2. Create the archive. This make-tar.sh reads the name and version from the manifest and packages manifest.json, icon.png and dist/. Add other folders, such as skills/, to payload.

    #!/bin/sh
    set -eu
    cd "$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
    python3 - <<'PYTHON'
    import json, re, tarfile
    from pathlib import Path

    manifest = json.loads(Path("manifest.json").read_text())
    identity = [manifest["nameIdentifier"], manifest["version"]]
    if not all(re.fullmatch(r"[A-Za-z0-9][A-Za-z0-9._-]*", value) for value in identity):
    raise ValueError("Invalid package identity")
    package_name = "-".join(identity)
    payload = [Path("manifest.json"), Path("icon.png"), Path("dist")]
    output = Path("artifacts")
    output.mkdir(exist_ok=True)
    with tarfile.open(output / f"{package_name}.tar.bz2", "w:bz2") as archive:
    for path in payload:
    archive.add(path, arcname=f"{package_name}/{path}")
    print(output / f"{package_name}.tar.bz2")
    PYTHON
  3. Run sh make-tar.sh. The archive is written to artifacts/. Keep that folder out of Git.

A remote MCP extension needs no packaging: upload its manifest.json.

Install and test the extension​

  1. Go to Settings → Extensions and select Add private extension.
  2. Choose the archive, or the manifest for a remote extension. You can also drag the file onto the page.
  3. If the card shows Configuration needed, open the extension, select Settings from its options menu, fill in the fields, and save. Saving starts the extension and lists its tools.

To ship a change, raise version and upload again: installing a version that is already installed reuses that release. To edit the installed files in place while you test, see Develop an extension.

Troubleshooting​

SymptomWhat to check
"Package must contain exactly one extension root directory."The archive has files at its top level, or more than one folder. Put everything inside one <nameIdentifier>-<version>/ folder.
"Package root must be named '…'."The root folder doesn't match nameIdentifier and version in the manifest. Rebuild the archive after changing either.
"Unsupported file. Use a .tar.bz2, .zip, .mcpb or manifest .json bundle."The file has another extension. Upload a .tar.bz2, .zip or .mcpb package, or a manifest.json.
"Workflow '…' already exists and is not owned by this extension."A workflow with the same name already exists in the workspace. Rename the workflow provider, or rename the existing workflow.
Your changes don't appear after a new uploadThe version is unchanged, so the release already installed is reused. Raise the version.
A ${fieldName} value reaches the server emptyThe name doesn't match a key of configuration, or the field has no value.
Synced metadata files appear as empty resourcesThe source returns them without "loadAsResource": false.

Next steps​