
Rebase
io.github.rebasepro由 GitHub 账号 rebasepro 发布v0.28.2更新于 Nov 7, 2026
Schema, database, document, user and dev-server tools for a Rebase backend project.
概览
本地 stdio MCP 服务器,让助手管理 Rebase 项目的 schema、数据库、文档、用户、存储、定时任务和云端部署。
- 可以做什么
- 生成与内省 schema、预览变更、推送并迁移数据库,以及管理数据库分支
- 读取、创建、更新和删除集合中的文档
- 列出、创建、更新和删除用户,列出角色,重置密码
- 启动、停止本地开发服务器并读取其日志
- 列出、删除存储对象并生成下载链接;列出、触发、启停定时任务并读取日志
- 调用后端函数、管理项目注册表,以及在 Rebase Cloud 上开通、部署、回滚和设置环境变量
- 适用场景
- 适用于在 Rebase 项目中工作、希望助手直接修改 schema 或数据、执行迁移、查看数据库分支,或处理用户与存储而无需切到终端时。也适合驱动本地开发服务器,以及部署或回滚已关联的 Rebase Cloud 项目。
- 运行要求
- 通过 npx 从 npm 包以 stdio 在本地运行,需要 Node 22.22.0 或更高版本,且仅支持 ESM。将 REBASE_PROJECT_DIR 设为包含 rebase.json 的目录;REBASE_BASE_URL 默认指向本地后端,REBASE_API_TOKEN 用于访问远程项目。运行中的 rebase dev 服务器会被自动发现。
安装
在 SourceWeft 中
- 打开 控制台中的 Rebase,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@rebasepro/mcp
Model Context Protocol (MCP) server that exposes Rebase schema, database, document CRUD, user management, and dev server tools to AI assistants.
Installation
A project made by rebase init already has it, pinned to the CLI's version: the
server drives the project's own CLI and calls its own backend, so it should be
the same release as both.
ESM-only: "type": "module" with no CommonJS build, so it is loaded with
import. It needs Node >=22.22.0 (its engines floor), where require()
of it resolves too: Node has supported require(esm) since 22.12.
Run the project's copy:
What This Package Does
@rebasepro/mcp implements the Model Context Protocol over stdio, allowing AI assistants (Gemini, Claude, Cursor, etc.) to interact with a Rebase project. It provides tools and exposes collection definitions and generated schemas as MCP resources. It has native support for managing multiple local and remote projects.
Multi-Project Support
The MCP server supports managing multiple Rebase projects simultaneously. This is ideal when working in an IDE with multiple open workspaces or when interacting with both local development servers and remote staging/production environments.
- Registry: Project configurations are stored in
~/.rebase/projects.json. - Auto-Discovery: If
rebase devis running locally, the MCP server automatically discovers the active development port and service key from.rebase/state.jsoninside the project directory, giving you zero-config local development.
Which project a run resolves to
One precedence, in this order:
- The environment block —
REBASE_PROJECT_DIR,REBASE_BASE_URL,REBASE_API_TOKEN. If any of them is set, thedefaultproject is rebuilt from them on every start. The rebuild is whole-entry: a token registered against the oldprojectDiris dropped rather than carried into a directory it was never issued for. - The server's working directory, when it holds a
rebase.json.~/.rebase/projects.jsonis machine-wide, and a project you are standing in outranks a home-directory cache. - The persisted
default, when neither of the first two says anything.
A default derived from 1 or 2 is never written back to the registry: it is recomputed at every start, and persisting it would put one project's directory, backend URL and dev service key in the file every other project on the machine reads.
Auto-discovery fills gaps in all three cases and never overrules a value one of them supplied — not the token and not the baseUrl. Discovery reads the dev server's service key, which is an unscoped admin secret, so a narrow rk_live_* key you registered is what gets used even while rebase dev is running; likewise a project registered against https://staging.example.com stays there rather than being silently redirected to the local dev port. A baseUrl disagreement between the two is reported on stderr. Filling a gap is not: with no token registered, the SDK tools run on the discovered service key — full admin — and nothing says so.
rebase init writes "env": { "REBASE_PROJECT_DIR": "." } into the scaffolded .mcp.json — relative to the client's working directory, which for a project-level config file is the project.
Configuration
The server reads configuration from environment variables and .env files:
The server attempts to load .env from $REBASE_PROJECT_DIR/.env or $REBASE_PROJECT_DIR/app/.env. Those values configure the server itself. They are not passed on to the CLI or the dev server it spawns: those read the active project's own .env, and a variable handed down would outrank it, and the branch the checkout is switched to, as if you had exported it in your shell.
Destructive-Tool Safety Gate
rebase_project_add accepts any baseUrl, and the CLI tools connect with whatever DATABASE_URL the project's .env declares. That means the same tool list that edits a scratch database on your laptop can drop production rows — with nothing in between but the assistant's judgement about which project is currently active.
Every tool that changes the target environment is refused unless that target is on the loopback interface. The gate is a list of what is not gated, so a newly added tool is protected by default:
- Not gated — reads:
rebase_schema_plan,rebase_doctor,rebase_db_branch_list,rebase_db_branch_info,rebase_db_branch_diff,list_documents,get_document,list_users,list_roles,storage_list_objects,storage_get_download_url,cron_list_jobs,cron_get_job,cron_get_job_logs,rebase_dev_logs, and the Rebase Cloud readsrebase_cloud_status,rebase_cloud_logs,rebase_cloud_env_list,rebase_cloud_deployments_list. - Not gated — Rebase Cloud writes:
rebase_cloud_provision,rebase_cloud_deploy,rebase_cloud_env_set,rebase_cloud_rollback. Provisioning creates a project and links this directory; the others change the linked cloud project, but they spawnrebase cloud, which acts on the project.rebase/cloud.jsonlinks with the CLI's own credential and the control plane's own permission checks; they never usebaseUrlorDATABASE_URL, which is all the gate can check. - Not gated — local only:
rebase_schema_introspect,rebase_db_branch_switch,rebase_schema_generate,rebase_db_generate,rebase_generate_sdk, the dev-server tools, and the project-registry tools. These write local files or local state and have no remote target to check. - Gated against
DATABASE_URL: every other CLI tool —rebase_db_push,rebase_db_migrate,rebase_db_branch_create,rebase_db_branch_delete. - Gated against the project
baseUrl: every other SDK tool —create_document,update_document,delete_document,create_user,update_user,delete_user,rebase_auth_reset_password,storage_delete_object,cron_trigger_job,cron_toggle_job,invoke_function.
The two targets are not interchangeable: CLI tools never see baseUrl, so a localhost backend sitting next to a production DATABASE_URL is checked against the database, not the backend. create_user and update_user set roles, so they can mint an admin; invoke_function calls any function with any HTTP method; cron_toggle_job disables a scheduled backup silently. None of those is recoverable in the sense "additive" suggests, which is why the list is now the other way round.
The DATABASE_URL the gate checks is resolved the way the spawned CLI resolves it. A DATABASE_URL exported in the shell the server was started from wins outright. Otherwise the gate reads every DATABASE_URL and ADMIN_CONNECTION_STRING (the fallback the branch commands accept) in <root>/.env, <root>/backend/.env, DOTENV_CONFIG_PATH and the parent directory's .env, parsing each file with dotenv as the CLI does, and refuses if any of them is remote. If no connection string can be resolved at all, the DB tools are refused: an unverifiable target is not a safe one, and the child does its own resolution from files this process may not see.
Only loopback (localhost and *.localhost, 127.0.0.0/8, ::1, 0.0.0.0) counts as local — private ranges like 10.x and 192.168.x do not, since those are as likely to be a shared staging cluster as a laptop.
Set REBASE_MCP_ALLOW_REMOTE_WRITES=true to opt out.
The branch tools (rebase_db_branch_*) also require an admin, checked through GET /auth/me — which answers a signed-in user's access token only, so with a service key (including the one discovery supplies) or an rk_live_* API key every branch tool fails with "Admin authorization failed".
Untrusted Data Marking
Rows, user records, storage listings, cron jobs, function responses and CLI output are returned inside an explicit <<<UNTRUSTED_DATA …>>> envelope. Anything stored in your database was written by somebody, and it arrives on the same channel as the tool contract the assistant is following; the envelope tells the model to treat it as inert content rather than instructions. It is a marker, not a sandbox — an assistant with these tools is only as safe as the content you let it read.
Tools
53 tools, in 10 groups. Tools marked ⚠ are refused against a non-local
target unless REBASE_MCP_ALLOW_REMOTE_WRITES=true — see the gate above.
Schema & database (13)
Spawn the Rebase CLI in the active project directory.
Schema planning (1)
Ask the backend what a change would do. No CLI, no files written.
Documents (5)
CRUD over a collection through @rebasepro/client.
Users & roles (6)
Dev server (3)
Storage (3)
Cron (5)
Functions (1)
Project registry (7)
Rebase Cloud (9)
Spawn rebase cloud … --json in the active project directory, against the project it is linked to, with the CLI's own credential. Provisioning creates a project; deploy, env set and rollback change the linked one. The loopback gate does not apply to them, because they never use baseUrl or DATABASE_URL.
Resources
The server exposes MCP resources for AI context:
Collection files are discovered from app/config/collections/, config/collections/, or collections/ under the active project directory.
Quick Start
Add to your AI assistant's MCP config (e.g. .gemini/settings.json):
MCP Registry
A stable release publishes this server to the
MCP Registry as
io.github.rebasepro/rebase — the listing MCP clients read when they offer an
install. Two files carry that identity, and they must agree:
Neither is edited by hand on a release. publishable-packages.mjs --set-version
writes the version into server.json alongside every package.json, and
pnpm check:publishable-set refuses a tree where the two disagree — the registry
validates a publish by downloading the tarball the manifest names, so a manifest
left behind fails the release at its last step, once npm can no longer be
rewritten.
The stable publish workflow pushes the registry entry itself, after npm, the tag
and the fleet image, on the OIDC token it already holds for npm provenance. A
hand-run release.sh cannot — the login is a device-code flow — so it prints
the command to finish the job:
Install mcp-publisher with brew install mcp-publisher, and check a manifest
without publishing anything using mcp-publisher validate.
Related Packages
@rebasepro/client— Used internally for data and admin API calls
来源:packages/mcp/README.md,提交 69ea948
工具
0版本历史
10- v0.28.2最新Nov 7, 2026
- v0.28.1Nov 5, 2026
- v0.28.0Nov 5, 2026
- v0.27.0Nov 3, 2026
- v0.26.0Oct 29, 2026
- v0.25.1Oct 14, 2026
- v0.25.0Oct 14, 2026
- v0.23.0Sep 27, 2026
- v0.22.0Sep 21, 2026
- v0.21.1Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分