Connect an AI assistant (MCP server)
MyAppBuilder includes an MCP server so an external AI assistant (any client that speaks the Model Context Protocol) can read your apps, propose changes, apply them to the draft after you review them, run business tests and read test records — acting as you, with only the permissi
Beta — ready to use, but some details may still change.
Connect an AI assistant (MCP server)
MyAppBuilder includes an MCP server so an external AI assistant (any client that speaks the Model Context Protocol) can read your apps, propose changes, apply them to the draft after you review them, run business tests and read test records — acting as you, with only the permissions you grant.
NEXT_PUBLIC_FLAG_PUBLIC_API=on). While it is off, every address below answers 404 and the Connected AI assistants settings are hidden.How to connect
- In your assistant, add a remote MCP server with the address
https://<your MyAppBuilder host>/api/mcp(transport: Streamable HTTP). - The assistant discovers how to sign in on its own (
/.well-known/oauth-protected-resource→/.well-known/oauth-authorization-server), registers itself and opens MyAppBuilder in your browser. - Sign in, then choose: - one workspace — the assistant never sees other workspaces; - all apps of that workspace, or only specific apps; - the permissions (scopes) below. Write permissions are never pre-selected.
- Click Allow access. You are sent back to the assistant.
To disconnect, open Settings › Connected AI assistants (/settings/assistants) and click Disconnect. Workspace admins and owners see and can disconnect every member's assistants; other members see their own.
Permissions (scopes)
| Scope | What it allows | Needs workspace role |
|---|---|---|
projects:read | List apps; read pages, tables and fields, workflows, roles; readiness checks; preview changes | viewer |
projects:write | Apply reviewed changes to the draft as a new version | editor |
tests:run | Run business tests against the draft in the isolated runner | editor |
data:read | Read records of the test environment, as your builder role allows | viewer |
A viewer can't grant write permissions. Permissions are also re-checked on every request against your current role: if you are demoted to viewer, the assistant loses projects:write and tests:run immediately; if you leave the workspace, the connection stops working.
There is no permission for publishing, secrets or environment variables, live data, file uploads, data sources, billing, custom domains or workspace members. An assistant can't do those things, whatever it asks for.
Tools
| Tool | Scope | What it does |
|---|---|---|
list_projects | projects:read | Apps the connection may access, with their draft version |
get_project_overview | projects:read | Pages, tables, workflows and roles of one app — no secrets, no records |
check_readiness | projects:read | The publish checklist and business readiness checks (never publishes) |
propose_changes | projects:read | Turns a plain-language request — or operations in MyAppBuilder's AI operation format — into validated changes. Nothing is applied: it returns the change list, the exact commands, the baseVersion and a proposalId (valid 30 minutes) |
apply_changes | projects:write | Applies a proposal (proposalId) to the draft as one all-or-nothing transaction — exactly the previewed commands, once |
run_business_tests | tests:run | Runs the app's business tests in the isolated runner; nothing real is sent |
list_test_records | data:read | Reads one table's test records (file fields are left out) |
The intended flow is: overview → propose_changes → the assistant shows you the change list → you agree → apply_changes with the proposalId.
- A proposal is stored for 30 minutes, belongs to the connection (another assistant — even yours — can't apply it) and to one app, and is applied at most once. Its commands are fingerprinted (SHA-256) when stored and checked again before applying.
- If applying fails (for example the app changed since the preview), the proposal isn't used up — but it will keep failing until the assistant proposes again on the new version.
- Sending
commands+baseVersion+descriptiondirectly (withoutproposalId) still works for older clients; such versions are labelled "Assistant (<name>, unreviewed): …" and the audit entry recordsreviewed: false.
Review and undo
- Applied changes only affect the draft. Publishing always happens in MyAppBuilder, by a person.
- Each
apply_changescall creates a new version labelled "Assistant (<assistant name>): …" (or "Assistant (<name>, unreviewed): …" when the assistant sent commands without aproposalId). Undo it in the builder or restore an earlier version from Versions — see Undo and versions. - Commands go through the same validation as the built-in AI copilot (the same allow-list), and a change made from a stale
baseVersionis refused so the assistant must re-read the app first. - Every applied change, test run, connection, disconnection and suspicious token reuse is written to the workspace audit log.
Limits
- Access tokens last 1 hour; refresh tokens 30 days and rotate on every use. Re-using an old refresh token (or an authorization code) disconnects that assistant for safety — reconnect it.
- About 120 MCP requests per minute per connection; 20
apply_changesand 10run_business_testscalls per minute; client registration 20 per hour and token requests 60 per minute per IP address. These limits are shared across all server instances (counted in the database), so they hold on deployments with several instances. - At most 50 unapplied proposals are kept per connection (the oldest are dropped).
list_test_recordsreturns at most 100 records per page.- The server is stateless and answers with plain JSON (no server-sent event stream).
For developers
- Discovery:
GET /.well-known/oauth-protected-resource(RFC 9728; also at/.well-known/oauth-protected-resource/api/mcp) andGET /.well-known/oauth-authorization-server(RFC 8414). - Registration:
POST /api/oauth/register(RFC 7591). Public clients only (token_endpoint_auth_method: "none"); redirect URIs must behttps://…orhttp://localhost,http://127.0.0.1orhttp://[::1](any port). They must match exactly when authorizing. - Authorization:
GET /oauth/authorizewithresponse_type=code,code_challenge_method=S256(PKCE is required;plainis refused),scope,stateand optionallyresource=<host>/api/mcp. The redirect carriescode,stateandiss. - Tokens:
POST /api/oauth/token(form-encoded) withgrant_type=authorization_code(+code_verifier,redirect_uri,client_id) orgrant_type=refresh_token(+client_id). Codes are single use and expire after 5 minutes. - Revocation:
POST /api/oauth/revoke(RFC 7009). Revoking a refresh token disconnects the assistant. - MCP:
POST /api/mcpwithAuthorization: Bearer <access token>, one JSON-RPC 2.0 message per request:initialize,ping,tools/list,tools/call(protocol2025-06-18). Without a valid token the answer is401withWWW-Authenticate: Bearer resource_metadata="…"; a tool outside the granted scopes answers403witherror="insufficient_scope". - Origin check (MCP DNS-rebinding protection): a request that carries an
Originheader must come from MyAppBuilder's own address (APP_URL) or an origin the operator lists inPUBLIC_API_ALLOWED_ORIGINS(comma-separated); others get403. Requests withoutOrigin(desktop apps, CLIs, servers) are accepted — they still need a bearer token. - MyAppBuilder stores only hashes of codes and tokens. Expired codes and tokens are deleted a day after they expire, unapplied proposals after 30 minutes, and a registered assistant that was never authorized is removed after 30 days (it simply registers again).
Troubleshooting
- 404 on every address — the operator hasn't enabled the public API on this deployment.
- "The redirect address does not exactly match" — the assistant changed its callback address; let it register again.
- A tool is missing from the assistant — it isn't in the permissions you granted, or your role no longer allows it. Disconnect and connect again with the permission.
- "This project changed in another window" — someone edited the app after the preview; ask the assistant to propose the change again.
- "Proposal not found, expired or already applied" — proposals last 30 minutes and apply once; ask the assistant to propose again.
- 403 "this Origin may not call the MCP endpoint" — a browser-based assistant runs on a site the operator hasn't allowed; the operator adds it to
PUBLIC_API_ALLOWED_ORIGINS.