Build a ChatGPT app
A web app whose actions are tools ChatGPT uses as the person signed in: they add the app's address in ChatGPT, sign in with their account in the app, and allow it. The answers show in the chat as a widget. One placeholder model and two tools to build your own on.
What you'll build
What it shows: Actions as MCP tools with export const mcp, a sign-in held to the same roles as the app's pages, the account and author taken from caller rather than the model's params, and a widget ChatGPT renders from the tool's answer (MCP Apps).
Before you start
- The CLI:
npm i -g @inferencebureau/apps, thenib-apps loginonce. - ChatGPT, with Developer mode while it's unlisted.
- Resend, for sign-up and password emails.
Create the app from the recipe
One command creates the app on Inference Bureau and downloads its files into ./my-chatgpt-app. Web is the default platform, so the recipe id is all it takes.
ib-apps create my-chatgpt-app --recipe chatgpt-appTour what the recipe loaded
The recipe replaces the starter, keeping the coding-agent guidance. Here's where each piece lives.
| Where | What's there |
|---|---|
settings.ib.ts | mcp turns on the server at <app address>/mcp and names it for ChatGPT and the consent page. |
item/actions/create.ts | Add an item: its declared params are the tool's input. It only adds, so destructive: false and ChatGPT doesn't ask first. |
api/actions/listItems.ts | List items, newest first, with a search. readOnly, so a read-only sign-in still gets it. |
widgets/items.html | The list both tools show in the chat, with an Add field. One self-contained page: no requests of its own, theming from ChatGPT's CSS variables. |
accessControl/permissions.ib.ts | An account's members read and add its items, on the pages and through MCP alike. |
web/app/connect/ | /connect: the address to add and ChatGPT's steps. |
tests/items.test.ts | The tools' actions as a sign-in from ChatGPT calls them, held to the caller's roles and account. |
export const run: ActionRun = async ({ params, record, caller }) => {
if (!caller?.accountId) throw new Error("Sign in to an account first.");
record.title = String(params.title ?? "").trim().slice(0, 200);
record.account = caller.accountId; // from who's signed in, never from params
record.createdBy = caller.userId ?? null;
await save(record);
};
export const params: ActionParams = {
title: { type: "string", required: true, description: "A short title." },
notes: { type: "string", description: "Anything else worth keeping with it." },
};
export const mcp: ActionMcp = {
title: "Add an item",
description: "Adds an item to the user's list, shared with the rest of their account.",
destructive: false,
widget: "items",
};Check what it set on the app
Nothing to do here: this is what the recipe configured, so you know where to look in Settings later.
<app address>/mcp, signed in as the app's usersFinish setup
- Open the app and create an account
- Turn on Developer mode in ChatGPT, then open
/connectand add the address it shows - Sign in when ChatGPT asks and choose Allow, then rename
itemand add your own tools
Development has its own address, so ib-apps dev is enough to try it. In ChatGPT, turn on Developer mode under Settings → Apps → Advanced settings, then Create app with the address /connect shows and OAuth.
Run it
ib-apps dev syncs both ways while you work and runs the development server.
cd my-chatgpt-app
ib-apps devTry it end to end
Make it yours
Rename item and give it your fields; keep account so each account sees its own.
Any action with export const mcp is a tool. See Claude and ChatGPT apps.
ib-apps test runs its tests, then ib-apps deploy sends development to production. See Deploys.