Skip to content
MyAppBuilder
BetaGuide

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.

Beta, off by default. The MCP server and its sign-in only exist when the operator of your MyAppBuilder deployment has enabled them (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

  1. In your assistant, add a remote MCP server with the address https://<your MyAppBuilder host>/api/mcp (transport: Streamable HTTP).
  2. 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.
  3. 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.
  4. 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)

ScopeWhat it allowsNeeds workspace role
projects:readList apps; read pages, tables and fields, workflows, roles; readiness checks; preview changesviewer
projects:writeApply reviewed changes to the draft as a new versioneditor
tests:runRun business tests against the draft in the isolated runnereditor
data:readRead records of the test environment, as your builder role allowsviewer

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

ToolScopeWhat it does
list_projectsprojects:readApps the connection may access, with their draft version
get_project_overviewprojects:readPages, tables, workflows and roles of one app — no secrets, no records
check_readinessprojects:readThe publish checklist and business readiness checks (never publishes)
propose_changesprojects:readTurns 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_changesprojects:writeApplies a proposal (proposalId) to the draft as one all-or-nothing transaction — exactly the previewed commands, once
run_business_teststests:runRuns the app's business tests in the isolated runner; nothing real is sent
list_test_recordsdata:readReads 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 + description directly (without proposalId) still works for older clients; such versions are labelled "Assistant (<name>, unreviewed): …" and the audit entry records reviewed: false.

Review and undo

  • Applied changes only affect the draft. Publishing always happens in MyAppBuilder, by a person.
  • Each apply_changes call creates a new version labelled "Assistant (<assistant name>): …" (or "Assistant (<name>, unreviewed): …" when the assistant sent commands without a proposalId). 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 baseVersion is 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_changes and 10 run_business_tests calls 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_records returns 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) and GET /.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 be https://… or http://localhost, http://127.0.0.1 or http://[::1] (any port). They must match exactly when authorizing.
  • Authorization: GET /oauth/authorize with response_type=code, code_challenge_method=S256 (PKCE is required; plain is refused), scope, state and optionally resource=<host>/api/mcp. The redirect carries code, state and iss.
  • Tokens: POST /api/oauth/token (form-encoded) with grant_type=authorization_code (+ code_verifier, redirect_uri, client_id) or grant_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/mcp with Authorization: Bearer <access token>, one JSON-RPC 2.0 message per request: initialize, ping, tools/list, tools/call (protocol 2025-06-18). Without a valid token the answer is 401 with WWW-Authenticate: Bearer resource_metadata="…"; a tool outside the granted scopes answers 403 with error="insufficient_scope".
  • Origin check (MCP DNS-rebinding protection): a request that carries an Origin header must come from MyAppBuilder's own address (APP_URL) or an origin the operator lists in PUBLIC_API_ALLOWED_ORIGINS (comma-separated); others get 403. Requests without Origin (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.

Related

Was this helpful?