AI & Agents
The Remote MCP Endpoint
The MCP server is a developer tool: it runs on your machine and holds a service
key or an API key. A deployed backend can also serve MCP itself, at /mcp, for
the people who use your application. An assistant one of them connects reads and
writes the project as that person, and every call runs under their own
row-level security.
It is off unless you turn it on, and both variables are required:
REBASE_MCP_ENABLED=trueREBASE_PUBLIC_URL=https://app.example.com # this deployment's real originWithout REBASE_PUBLIC_URL, a JWT secret, or a data driver that can scope a query
to one user, the endpoint declines to mount and says why in the boot log. No
REBASE_ROLE turns it on.
A deployment that answers on more than one name, such as an old domain kept
while clients move to a new one, lists the others in
REBASE_PUBLIC_URL_ALIASES:
REBASE_PUBLIC_URL=https://app.example.comREBASE_PUBLIC_URL_ALIASES=https://app.example.org # comma-separated originsA request to an alias gets documents, an issuer and a challenge naming that
alias, so a client connected under either URL keeps working, and a token minted
under any of them is accepted. A Host that is not listed is answered as
REBASE_PUBLIC_URL. An entry that is not an origin is skipped with a warning.
rebase dev is the one exception: it switches /mcp on for the server it
starts, and that server names its own address, http://localhost:<port>, as
the public URL, so there is nothing to configure. A REBASE_MCP_ENABLED line
in the shell or in .env still decides, false included. The dev banner
prints the endpoint on an MCP: line once it has mounted.
Connecting a client
Section titled “Connecting a client”rebase mcp connect # pick the clients to connect, from a listrebase mcp connect --client claude-code,cursorrebase mcp connect --print # the URL, the command and the install links; changes nothingrebase mcp url # the URL alonerebase mcp connect asks the server where /mcp is, by reading the document it
publishes at /.well-known/oauth-protected-resource/mcp, so the URL is right
behind a proxy, under REBASE_PUBLIC_URL, and on a dev port that moved. Then it
connects each client you pick:
| Client | --client |
What happens |
|---|---|---|
| Claude Code | claude-code |
Runs claude mcp add --transport http <name> <url> |
| Cursor | cursor |
Opens Cursor’s install link |
| VS Code | vscode |
Opens VS Code’s install link |
| Claude (claude.ai, desktop, mobile) | claude |
Prints the steps for Settings → Connectors, with the URL to paste |
| ChatGPT | chatgpt |
Prints the steps for its connector settings |
The clients it finds installed are ticked already. Claude and ChatGPT connect
from their own servers, which cannot reach localhost, so against a dev server
they are listed as needing a deployed project. --client all names every one.
With no terminal, or under --json, and no --client, the command prints what
--print does and connects nothing.
The server it asks is the project’s own: REBASE_BASE_URL, else the running
rebase dev. --cloud asks the Corabase Cloud project the directory is linked
to, and --url <server> any backend. A server with /mcp off answers nothing
there, and the command says how to switch it on.
The server is registered as the project’s name, with -local for one on this
machine, so a local and a deployed project can both be connected; --name
changes it. It is never rebase, the name of the developer MCP
server in a project’s .mcp.json, which a second server of the
same name would hide.
The admin panel offers the same steps. Its drawer has a Connect AI button
that shows the URL the server publishes, the claude mcp add command, the
Cursor and VS Code install links and, on a deployed project, the connector
steps for Claude and ChatGPT. Below them it lists the agents the signed-in
person has connected, each with a way to disconnect it. Everyone signed in
sees the button while /mcp is on. While it is off, only an administrator
does, with how to turn it on.
What a connection gets
Section titled “What a connection gets”-
OAuth, with a consent screen. A client finds the authorization server through
/.well-known/oauth-protected-resource, registers itself (dynamic registration is on by default;REBASE_MCP_OPEN_REGISTRATION=falselimits it to clients you register), and sends the person to a consent screen that signs them in through your existing/auth/login. An account with a second factor is then asked for its authenticator code or a recovery code, through the existing/auth/mfa/challengeroutes. When your app’s own frontend keeps a session in the same browser, the screen offers that account, and Allow consents as it with no password; that is how someone who signs in only with Google, GitHub or an email link connects. Otherwise it signs in with a password, and someone with none sets one first with/auth/forgot-password(your app’s “Forgot password”); the screen tells them so. It also names the host the authorization code is sent to, and says that host is not verified: anyone may register a client under any name, so the host is the part a person can check. -
Seventeen tools, three scopes. The same scopes every credential uses.
data:readofferslist_tables,describe_table,query_table,count_rows,aggregate_rows,get_row, the three views,show_table,show_recordandshow_app,show_app_guide, and the experimentallist_appsandopen_app;data:writeaddscreate_row,update_rowand the experimentalsave_appanddelete_app;data:deleteaddsdelete_row. A client that asks for nothing getsdata:read. Each one narrows to a table:data:read:postslists, describes and readspostsand nothing else. A scope decides which tools are offered and which tables they reach, not which rows: an empty list can be RLS working, anddata:writestill cannot write a row the person could not. -
Three tools put your admin panel in front of the person. In a client that renders MCP Apps, such as Claude, they open the admin panel’s own views in the conversation, drawn from the table descriptors the backend serves to this person — columns, enums, validation, relations — with the UI preferences the panel composes: the
ui-config.jsonthe bundle shipped, the workspace’s, and the person’s own (an API key has none), so labels, column order, hidden columns and enum labels match the panel. Your project’s own panel customizations show where the backend serves its MCP view.-
show_tabletakesquery_table’s arguments, plusview(table,list,cardsorkanban), and opens the table’s view: the person can search, filter, sort and page, open a row’s form, and add rows. -
show_recordopens one row’s form (id), or a form for a new row that starts from thevaluesthe model filled in, for the person to check and save themselves. -
show_appruns an app the model writes for the task at hand: one React component (code) and thetablesit reads. It imports Corabase’s own packages, so the same code works in your project:@rebasepro/app:useRows,useRow,useRowCount,useAggregateanduseRowWritesover the project’s rows;@rebasepro/cms: the admin panel’sCollectionPanel(withCollectionToolbarand its pieces, andonRowClick, which hands the app the clicked row asuseRowsreads it),RecordFormandFormField,RecordDetail,FieldValueanduseSidePanel, each naming its table by path, with your custom fields, views and actions;@rebasepro/ui, the whole UI kit,SplitViewand the KPI tiles and charts included.
The server compiles it first, so a syntax error, a module the view does not serve, or a name it does not serve from
@rebasepro/cmsor@rebasepro/appis the call’s error, with its line. An error while it runs is shown in its place and told to the model with the person’s next message. An app may use only the tables it lists. Its styles are Tailwind’s standard utilities, built with the view before any app arrives: an arbitrary value such ash-[560px]does nothing there, so an exact size is astyle.show_app’s description carries only the essentials, because a client may cut a long tool description short (claude.ai does at about 4,000 characters). It tells the model to callshow_app_guidefirst, which returns every hook, component and prop an app may use, with a worked example.show_app_guideis offered wherevershow_appis.
Every read and save in the view is one of the read and write tools’ calls, made as the person under their RLS, so a form offers only what their connection was granted: without
data:writeit is read-only, and a field their roles cannot read is not in it. That is the boundary an app’s code works within too: it runs in the view, so every call it makes is one of those tools, as the person, and it can do nothing the model could not do with the same tools. On the hosted connector every write is also planned and confirmed by the server. Within that,useRowWritesasks the person before it writes, so an app does not write without their click; the admin’s own controls (a form’s Save, a delete, a table edit) behave as they do on ashow_tablescreen. The model is told what they changed. It reads the rows each tool answers, not the descriptors the view draws with. A client without MCP Apps, such as Claude Code or Cursor, shows nothing, and the model reads the same rows it would fromquery_table. -
-
Experimental: apps saved to the project.
save_appkeeps an app the model built withshow_appso it opens again: it compiles the code asshow_appdoes and stores it with itstitle,tablesandvisibility, which ispersonal(its owner, the default),roles(anyone holding one of itsroles) orteam(everyone who signs in). Saving for more than yourself takes the admin role, since a shared app is code an AI wrote, running for other people. Only its owner or an admin replaces (id) or deletes one, and a person keeps at most 200.list_appslists the apps the caller may open,open_appopens one asshow_appwould, anddelete_appremoves one. Seeing an app is not reaching its data: an opened app reads and writes through the tools above, as whoever opens it, under their RLS. The apps live inrebase.saved_apps, which the backend creates the first time a tool uses it and grants to no end user. The admin panel opens the same apps: addsavedAppsViewfrom@rebasepro/cmsto yourviews. It runs an app in an iframe sandboxed withoutallow-same-originand with no network of its own, and relays its tool calls toPOST /api/admin/apps/mcp, the same tools for the admin panel’s session, which is mounted with the admin routes whether or notREBASE_MCP_ENABLEDis set. The tools’ names and shapes may still change. -
Grants made before 0.24 keep their reach.
mcp:readis read asdata:read, andmcp:writeasdata:write data:delete, on stored grants and on tokens already issued. -
An API key works too.
/mcpalso acceptsAuthorization: Bearer rk_…, for a client configured with a header rather than an OAuth flow. The key reaches the tools itsdata:*scopes cover, as whoever it acts as: a personal key as its owner, a service key asapi-key:<id>. -
The SDK’s vocabulary, REST’s answers. The tools take what the SDK takes —
where({"status": ["==", "paid"]}),orderBy(["created_at", "desc"]or"created_at:desc"),limit,offset,searchString, anddatafor a write — and read throughGET /api/data/<table>’s path, so a row comes back as REST serves it (ISO dates, abelongsToas its foreign key, e.g.authorId) and can be sent back in an update unchanged.query_tableanswers{ data, meta }withmeta.totalandmeta.hasMore, andcount_rows{ count };tools/listgives both,aggregate_rowsandget_rowanoutputSchema, loose where an answer varies.aggregate_rowsisGET /api/data/<table>/aggregate:selectis a list in REST’s grammar (["count()", "sum(total)"]),groupBya list of fields, and it answers{ data }with one row per group, plusmeta.hasMoreon a grouped call, whose groups page withlimitandoffsetand sort withorderBy. On a table anafterReadhook rewrites it servescount()alone, as REST does. As on REST, alimitabove 1000, an undeclared argument and an edit or delete of a trashed row (404) are refused; setting the soft-delete field tonullrestores it.deleted: "only"(or"include") onquery_table,count_rowsandaggregate_rowsreads the trash, as REST’s?deleted=does, so a rowdelete_rowtrashed can be found again to restore. Its description tells the model the delete is permanent only where the table has no soft-delete field. -
The listing names the tables;
describe_tablegives one’s schema.list_tablesanswers{ tables: [{ name, description, kind? }] }— no label — anddescribe_table { table }that table’s OpenAPIrow(the columns this caller is served) andcreate(the writable ones) schemas, itsprimaryKey, servedrelationsandrls(raw SQL redacted withoutschema:read), plussoftDeleteFieldwhere rows go to a trash, and the presentation the caller’s UI preferences give it:title, and per columnlabel,valueLabels,hidden,hiddenInForm,readOnly. What a connection may learn about the schema is decided by the same serializerGET /api/schema/tablesuses. The tool descriptions tell the model to describe a table before writing to it. A 200-table project’s listing is about 5k tokens, and each description under 1k; with every schema in the listing it was about 150k. -
A token for this endpoint only. An MCP access token is refused by
/api/data,/api/adminand the WebSocket, so connecting an assistant does not hand it a session.
Every request to /mcp re-reads the person’s account. A deleted or disabled
account, or a “sign out everywhere” or password change after the token was
issued, stops a connected client at once with a 401. A demotion applies to its
next tool call. Every refresh makes the same checks and refuses such a grant
for good. A guest session cannot consent at all.
One limit. Disconnecting a client (DELETE /api/oauth/grants/:clientId, with the
person’s own session) revokes its refresh tokens at once, but an access token
already issued keeps working until it expires, within the hour.
Skills
Section titled “Skills”The endpoint can also serve Agent Skills
over MCP: instructions an assistant loads when the task needs them, such as how
your team files an order or what a field means. Put each skill in its own
folder, with a SKILL.md whose frontmatter has a name matching the folder
and a description, plus any files it links to. Then name the parent folder
in the backend config:
// skills/order-intake/SKILL.md, skills/order-intake/references/fields.md, …createRebaseBackend({ ...options, // the rest of your backend config mcp: { skills: "./skills" }});The path is relative to the working directory. The data tools stay as they
are, and skills sits beside tools when a backend brings its own.
- What a client sees. Clients on protocol revision 2026-07-28 or later
(Claude Code, Claude) list the skills and load one when it is relevant.
Claude Code names each one
<connector>:<skill>. These are served through the MCP skills extension (io.modelcontextprotocol/skills):skills/list,skills/get, andresources/readofskill://<name>/…. Each skill comes with a SHA-256 manifest of its files. The client checks every file against that manifest, and the person’s approval is bound to it. - Who can read them. Every authenticated connection, whatever its scopes. Put nothing in a skill that is not for everyone who connects.
- When they change. The folder is read on the first request that needs it, so an edit takes effect at the next deploy or restart. A file that changes on disk before then is refused, not served against a manifest it no longer matches.
- What is left out. A skill that breaks a rule is skipped, and the boot log
says why. The rules: no frontmatter, a name that differs from its folder’s,
a symlink inside, or more than 512 files or 16 MiB. Hidden files such as
.gitkeepare never served. A skill over Claude Code’s own limits (100 KB per file, 400 KB in all) is served with a warning, because Claude Code will not load it.
The endpoint answers both protocol eras. A 2025-era client opens with
initialize, as before. A 2026-07-28 client sends no handshake. Every request
carries its protocol version and capabilities in params._meta, plus the
MCP-Protocol-Version, Mcp-Method and Mcp-Name headers, which must agree
with the body. Its capabilities come from server/discover. Skills are
declared only there.
The routes are in Endpoints and the variables in Configuration.