Build an app
Write a TypeScript Executor app with index.ts and package.json, create it with executor apps create, and deploy it with executor apps deploy.
An Executor app is a TypeScript package with index.ts and package.json declaring dependencies.apps. Create apps with executor apps create, activate them with executor apps deploy, and update them with executor apps source, executor apps commit, or Git on Local, Self-host, and Cloud.
The command that matters most: run executor apps framework, save hello/package.json and hello/index.ts, then run executor apps create --name "Hello" --files ./hello and executor apps deploy --app "$APP_ID" --files ./hello.
Prerequisites and permissions: Bash, Node.js, and npm i -g executor@2.0.0-beta.79. The walkthrough uses the Local background service. On Cloud and Self-host, use the organization you approved for app management. Editing and deploying an existing app require an editable app and edit permission.
You’ll know it worked when… deploy returns app and version, and executor execute --code 'return await tools.hello.greet({ name: "Ada" })' returns Hello, Ada!.
How to use it
App commands choose their target in this order: --host, then EXECUTOR_HOST, then the last host remembered by either sign-in command (executor apps login or executor login), then the Local background server.
Every app starts with two files:
package.jsondeclaringdependencies.appspinned to the exact version returned byexecutor apps frameworkso rebuilds stay on that release.index.tsexportingdefineApp(requirements, definition)as the default export.
Local
The commands below use Bash and Node.js and assume no saved hosted sign-in or EXECUTOR_HOST override. If you run a manual Local server instead of the background service, pass its loopback origin (--host http://127.0.0.1:4312), supply its API key with EXECUTOR_API_KEY, and clear any EXECUTOR_ACCESS_TOKEN override.
Check the host's apps version
In a new empty directory, run:
executor apps frameworkNote the returned version (for example 0.0.1-beta.148).
Create the two starter files
Save these two files in ./hello, replacing 0.0.1-beta.148 with the version printed above if your host reports a different release:
{
"name": "hello-app",
"private": true,
"dependencies": {
"apps": "0.0.1-beta.148"
}
}import { defineApp, object, query, router, string } from "apps";
const greet = query(
{
description: "Greet someone by name",
input: object({ name: string() }),
output: object({ message: string() }),
},
async (_ctx, { name }) => ({
message: `Hello, ${name}!`,
}),
);
export default defineApp({}, { tools: router({ greet }) });Create, deploy, and run the tool
Create the app from ./hello, deploy the returned id, and call greet:
APP_ID=$(executor apps create --name "Hello" --files ./hello | node -pe 'JSON.parse(require("fs").readFileSync(0, "utf8")).id')
executor apps deploy --app "$APP_ID" --files ./hello
executor execute --code 'return await tools.hello.greet({ name: "Ada" })'Check that the deploy response includes app and version, and that execution.value.message is "Hello, Ada!" (or open the app’s Tools tab in the dashboard and click Run tool).
Cloud
Sign in for app commands
executor apps loginOpen the printed URL, select your organization, and approve Executor API access. With no EXECUTOR_HOST override, this sign-in defaults to Cloud (https://api.executor.sh). For scripted hosted app commands, use an app-management access token in EXECUTOR_ACCESS_TOKEN and pass the target organization with --organization.
Check the framework version, create, and deploy
Run executor apps framework, put the returned version in hello/package.json, then create and deploy ./hello:
executor apps framework
APP_ID=$(executor apps create --name "Hello" --files ./hello | node -pe 'JSON.parse(require("fs").readFileSync(0, "utf8")).id')
executor apps deploy --app "$APP_ID" --files ./helloCall the deployed tool
Being able to manage an app is separate from being in its tool audience. To run the tool over hosted MCP, use a connection that can call the app. For the tool CLI on 2.0.0-beta.79, sign in separately with executor login --host https://api.executor.sh, then run:
executor execute --code 'return await tools.hello.greet({ name: "Ada" })'Self-host
Sign in against your self-hosted origin for app commands, pin the returned framework version in hello/package.json, create, and deploy:
executor apps login --host https://executor.example.com
executor apps framework
APP_ID=$(executor apps create --name "Hello" --files ./hello | node -pe 'JSON.parse(require("fs").readFileSync(0, "utf8")).id')
executor apps deploy --app "$APP_ID" --files ./hello
You can set EXECUTOR_HOST=https://executor.example.com instead of passing --host on each command. To call the deployed tool from the tool CLI on 2.0.0-beta.79, sign in separately with executor login --host https://executor.example.com first.
Deploying
executor apps create saves source files without building or running them. executor apps deploy compiles the app, runs any SQL migrations, activates the new version if the build succeeds, and returns JSON with app and version. A failed build keeps the previous active version running and reports the failing stage, with a source file and line when available.
executor apps deploy --files first loads the working revision and saves the complete supplied directory as the new working source before building. A failed build can therefore leave the working source updated, and --files does not check for someone else’s edits since you downloaded the app.
Updating an existing app
To detect concurrent changes before deploying edits from a shell:
-
Download the working source into an empty directory and record its
revision.commit:BASE_COMMIT=$(executor apps source --app "$APP_ID" --out ./hello | node -pe 'JSON.parse(require("fs").readFileSync(0, "utf8")).revision.commit') -
Edit files in
./hello, commit with--expected "$BASE_COMMIT", and deploy the returnedrevision.commit:NEW_COMMIT=$(executor apps commit --app "$APP_ID" --files ./hello --expected "$BASE_COMMIT" --message "Update greeting" | node -pe 'JSON.parse(require("fs").readFileSync(0, "utf8")).revision.commit') executor apps deploy --app "$APP_ID" --commit "$NEW_COMMIT" -
Inspect previous commits with
executor apps history --app "$APP_ID".
executor apps commit saves a complete snapshot: any file omitted from --files is deleted from the working source, and the command reports removed.count and up to 100 removed paths.
The CLI uploads a source directory larger than 16 MiB through Git automatically when only its ui/public/ assets push it over the inline limit (non-public code must still fit within 4,096 files and 16 MiB). To clone on Cloud, sign in with executor apps login. On Self-host, use executor apps login --host https://executor.example.com, replacing the example with your server’s origin. Then run:
CLONE_URL=$(executor apps git --app "$APP_ID")
git clone -c credential.helper= -c credential.helper='!executor apps credential' -c credential.useHttpPath=true "$CLONE_URL"
On Local, use the snapshot commands (source, commit, deploy), or use executor as the Git HTTP Basic username and the Local API key as the password.
From the clone, push the commit you want to activate, then deploy it with executor apps deploy --app "$APP_ID" --commit "$(git rev-parse HEAD)".
Deploying through an agent over MCP
On Cloud or Self-host, authorize a Full access MCP connection with All apps and link an account on the built-in Executor app that can create and deploy apps in the target organization. Read your organization ID from tools.executor.context.get({}) and include organization in every path object (path: { organization } for framework.release and appManagement.create, and path: { organization, app } for source, commit, and deploy).
On Local, use a Full access connection. Local links the built-in Executor app’s account automatically.
tools.executor.framework.release({})returns the target’sappsversion forpackage.json.tools.executor.appManagement.create({ body: { name, files } })creates an app from{ path, content }pairs.tools.executor.appManagement.source({ path: { app } })reads the working source and currentrevision.tools.executor.appManagement.commit({ path: { app }, body: { expected, message, files } })saves a new commit.tools.executor.appManagement.deploy({ path: { app }, body: { commit } })builds and activates that commit.
Start a new execute call after deploying to discover and run the newly deployed tool.
Limits
- Host resolution order:
executor appscommands resolve their target in this order:--host, thenEXECUTOR_HOST, then the last host remembered by eitherexecutor apps loginorexecutor login, then the Local background server. Pass--hostorEXECUTOR_HOSTexplicitly when switching between targets. - Pinning
dependencies.apps: declare the exact version returned byexecutor apps frameworkindependencies.appsto keep rebuilds on that release. Omittingdependencies.appsfails the build; a version range can resolve to a different published framework version. - Source size bounds: code outside
ui/public/must be UTF-8 text, at most 4,096 files and 16 MiB total, and each of your own JavaScript or TypeScript files is at most 2,000,000 bytes (JSON files and imported npm packages are outside the per-file JS/TS limit). Files underui/public/may be binary: up to 10,000 files, at most 32 MB per file, and 1 GB total. - Git push size on hosted servers: on hosted Executor, a single Git push larger than about 64 MiB of packed data fails; split large
ui/public/additions across smaller commits. - No secrets in source: never hardcode API keys or tokens in app files. Publishing on Cloud requires an organization owner or admin with app edit access and exposes the selected commit’s files, package name, description, commit ID, and publication date. Connected account records, live app data, and private Git history stay behind (and paths such as
.env,.env.*, and.npmrcare blocked), but credentials or private data written into included files become public. Use Accounts and providers for credentials.