Docs menu

POINT OPENX AT A REPO

Workbenches

Goal: Turn the tools your team writes into something every AI, app and teammate can call.

A warm query is a tool built from your data. A workbench is a tool built from your code: group your tools into one repo that declares what it does, and OpenX builds it and hosts it in your tenant.

THE MODEL

Declare a tool once, reach it every way

A workbench declares its tools and the modes they're reached through. The same tool definition serves AI over MCP, code over a REST API, and people through a Web interface - one definition, not three builds.

import { APIMode, MCPMode, WebMode, Workbench } from 'jsr:@fathym/fai@0.0.909/workbenches';

export default Workbench('triage')
  .Tools({ Classify: classifyTool, Escalate: escalateTool })
  .Modes({
    MCP: MCPMode(), // each tool method becomes an MCP tool
    API: APIMode(), // each tool method becomes POST /{tool}/{method}
    Web: WebMode({ handler: serve }), // your own fetch handler for pages
  });

Run it locally, then host it

A workbench runs with fai run, the runtime that ships with fAI. Run it on your laptop until it does what you want:

fai run workbench.ts --mode MCP
fai workbenches describe workbench.ts

describe lists the modes the workbench declares and each mode's input, without starting it. When it's ready, push the repo (or publish it to JSR) and point OpenX at it: OpenX hosts it by running the same fai run in your tenant. That step is Host Your Own Workbench.

What ships

MCP modeThe tools as an MCP server any AI can connect to
API modeEvery tool method as a REST endpoint, with an OpenAPI catalog
Web modeYour own HTTP server - pages, assets, whatever you write
ConsumesOne workbench calls another's hosted mode; OpenX wires the URL in at deploy
Custom modesDeclare a mode beyond MCP, API and Web (a webhook receiver, say) in your workbench package; nothing to register

A mode's key is its name: MCP, API and Web are names like any other, and OpenX reads nothing into them. Which ports speak MCP, and which of those Thinky may use, you set per port in the inspector: Serve MCP from a Workbench.

How to call each mode: Reach a Hosted Workbench. How they build on each other: Workbenches Build on Each Other.

Where your workbench's image lives

OpenX builds a hosted workbench into a container image, and keeps that image where your workspace chooses, never in Fathym's registry. A person chooses once for the whole workspace: open Source Control, then the Builds tab, under Where images are kept. Nothing builds until someone saves a choice, and OpenX never picks for you.

The setting lists where an image can be kept, each with its cost in the window's words:

WhereWhat it costs
Your landing zone's Azure registry"For private and public images alike. Each workbench pulls only its own image, signed in as itself, with no password."
GitHub Packages in your organisation, public"No credential; once public, GitHub cannot make it private again."
GitHub Packages in your organisation, private"Needs a classic GitHub token of one of your people, kept in your vault; it acts as that person and reads every package they can see."

There is a public and a private GitHub line for each organisation connected on the Connections tab. With none connected, the tab says "Connect a GitHub organisation in Connections to keep images in its packages." For a private line, type the token as a vault reference, such as $secret:ghcr-read-token, in The token, as a vault reference. A pasted token is refused; only a reference into your workspace's own vault is kept.

  • A pre-selection is not a choice. When your landing zone has an Azure registry, its line shows chosen when you open the tab, with "Pre-selected for you. Nothing is saved until you press Save." Close the tab and nothing is saved.
  • Save records who chose. Press Save and the tab shows "Chosen by" the person and the day. Until then it reads "Not chosen yet: nothing builds until someone saves a choice."
  • No registry, no Azure choice. With no Azure registry in your landing zone, the Azure line reads "Your landing zone has no Azure registry yet, so it cannot be chosen here. This setting does not make one."
  • Only a person saves it. Saving needs Workspace.SourceControl.Manage. An AI can read the choice with get_workspace, but a proposal that sets it is refused with IMAGE_STORE_PERSON_ONLY.

The recipe in your repository

The recipe is the Dockerfile OpenX builds your workbench's image from, with its base image pinned by digest, so the same workbench always gives the same file. OpenX keeps it with your code, not at Fathym.

  • From a repository. The first build of a workbench that builds from a repository opens a pull request on that repository, through your organisation's own GitHub App. It adds the files under .openx/workbenches/orders/ for a workbench named orders, on a new branch whose name starts openx/workbench-recipe/. You review and merge it like any other pull request. The README beside the Dockerfile says the build file follows; it arrives with a later pull request.
  • Only when it changes. A later build with the same recipe opens nothing, even when you declined the earlier pull request. A changed recipe opens a new pull request on a new branch.
  • Never your branches. OpenX writes only to a branch it opened and never moves your default branch. If a branch of the name it would use already exists with no pull request from OpenX, it stops with SOURCE_RECIPE_BRANCH_TAKEN: delete that branch on GitHub and build again.
  • From a JSR package. A workbench built from a package has no repository, so its recipe is kept in your landing zone's storage account, in workbench-recipes under the workbench's name. Only files that changed are written.

The pull request needs the App's Contents and Pull requests write permissions, which an owner grants on GitHub.

Still landing

  • Signing a browser in to a Web mode. A Web mode set to None opens in any browser tab. One set to Identity doesn't sign a browser in yet; calls with a key work. Where to set it: Reach a Hosted Workbench.
  • Persistent vaults. A vault holds what a workbench needs to keep. Vaults persist across runs on your laptop; a hosted workbench's storage doesn't survive a redeploy yet. Persistent hosted vaults are coming.
  • Custom domains and container sizes for a hosted workbench are coming.

Try one

fathym/sample-api-workbench is a small public workbench with two tools in API mode; its README walks the local run and the OpenX deploy. fathym/sample-ui-workbench adds a Web mode that reads from it. To run a published one without cloning anything:

fai run jsr:@fathym/sample-api-workbench --mode API

Next steps

On fathym.com: Workbenches →

On this page