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.

概覽

AI 產生的概覽

本機 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 伺服器會被自動探索。
安裝前請注意
會變更資料的工具在目標不在 loopback 上時會被拒絕;設定 REBASE_MCP_ALLOW_REMOTE_WRITES=true 可解除限制,此後同樣的工具可能改動正式環境資料。create_user 與 update_user 可授予管理員角色,invoke_function 可呼叫任意後端函式,cron_toggle_job 可無聲停用排程工作。自動探索可能在不提示的情況下改用未限定範圍的管理員服務金鑰,且 Rebase Cloud 的寫入操作不受 loopback 限制約束。資料庫內容以不可信資料信封回傳,這只是標記而非沙箱。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Rebase,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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

bash
pnpm add -D @rebasepro/mcp

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:

bash
pnpm exec rebase-mcp

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 dev is running locally, the MCP server automatically discovers the active development port and service key from .rebase/state.json inside the project directory, giving you zero-config local development.

Which project a run resolves to

One precedence, in this order:

  1. The environment block — REBASE_PROJECT_DIR, REBASE_BASE_URL, REBASE_API_TOKEN. If any of them is set, the default project is rebuilt from them on every start. The rebuild is whole-entry: a token registered against the old projectDir is dropped rather than carried into a directory it was never issued for.
  2. The server's working directory, when it holds a rebase.json. ~/.rebase/projects.json is machine-wide, and a project you are standing in outranks a home-directory cache.
  3. 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:

VariableDefaultDescription
REBASE_PROJECT_DIRprocess.cwd()Project root directory (the rebase.json directory)
REBASE_BASE_URLhttp://localhost:3001Rebase backend URL, when discovery finds no dev server
REBASE_API_TOKEN(empty)Auth token for API calls to the app. REBASE_TOKEN (the CLI's control-plane token) is never sent to the app; the cloud tools pass it to the CLI only
REBASE_MCP_ALLOW_REMOTE_WRITESfalseAllow destructive tools to run against non-local targets (see below)

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 reads rebase_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 spawn rebase cloud, which acts on the project .rebase/cloud.json links with the CLI's own credential and the control plane's own permission checks; they never use baseUrl or DATABASE_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.

ToolRequiredDescription
rebase_schema_generate—Generate Drizzle schema from Rebase TypeScript collection definitions
rebase_db_push ⚠—Apply the current Drizzle schema directly to the database (development shortcut, skips migration files)
rebase_schema_introspect—Introspect the live database and generate Rebase collection definitions from existing tables
rebase_db_generate—Generate SQL migration files from schema changes (compares current Drizzle schema against the last entity)
rebase_db_migrate ⚠—Run all pending SQL migrations against the database
rebase_generate_sdk—Generate a fully-typed JavaScript/TypeScript SDK from collection definitions
rebase_doctor—Detect schema drift between collection definitions, generated Drizzle schema, and the live PostgreSQL database
rebase_db_branch_create ⚠nameCreate a new database branch (Admins only)
rebase_db_branch_list—List all database branches (Admins only)
rebase_db_branch_delete ⚠nameDelete an existing database branch (Admins only)
rebase_db_branch_infonameShow information and status for a database branch (Admins only)
rebase_db_branch_diffnameShow what a database branch changed against the database it was made from (Admins only): added, dropped and altered tables, columns, constraints, indexes, triggers, RLS policies, enum types, views and functions as SQL, and per table the rows the branch inserted, updated and deleted, matched by primary key, with sample rows
rebase_db_branch_switch—Point this checkout at a database branch, or back at the main database (Admins only)

Schema planning (1)

Ask the backend what a change would do. No CLI, no files written.

ToolRequiredDescription
rebase_schema_plancollectionId, collectionShow the SQL a collection change would run, without running any of it

Documents (5)

CRUD over a collection through @rebasepro/client.

ToolRequiredDescription
list_documentscollectionList documents from a Rebase collection with optional filtering, sorting, and pagination
get_documentcollection, idGet a single document by ID from a Rebase collection
create_document ⚠collection, dataCreate a new document in a Rebase collection
update_document ⚠collection, id, dataUpdate an existing document in a Rebase collection
delete_document ⚠collection, idDelete a document from a Rebase collection

Users & roles (6)

ToolRequiredDescription
list_users—List all users registered in the Rebase backend, including their roles
create_user ⚠emailCreate a new user in the Rebase backend
update_user ⚠uidUpdate an existing user (email, display name, roles)
delete_user ⚠uidDelete a user from the Rebase backend
list_roles—List all roles defined in the Rebase backend
rebase_auth_reset_password ⚠emailReset a user's password via the admin API

Dev server (3)

ToolRequiredDescription
rebase_dev_start—Start the Rebase development server (frontend + backend)
rebase_dev_logs—Read recent output from the running Rebase dev server
rebase_dev_stop—Stop the running Rebase development server

Storage (3)

ToolRequiredDescription
storage_list_objects—List files/objects stored in Rebase storage
storage_delete_object ⚠keyDelete an object/file from Rebase storage
storage_get_download_urlkeyMint a temporary signed download URL for a file in Rebase storage

Cron (5)

ToolRequiredDescription
cron_list_jobs—List all scheduled cron jobs and their configuration status
cron_get_jobjobIdGet status and details of a specific scheduled cron job
cron_trigger_job ⚠jobIdManually trigger a cron job run immediately
cron_get_job_logsjobIdRead execution logs for a specific cron job
cron_toggle_job ⚠jobId, enabledEnable or disable a scheduled cron job

Functions (1)

ToolRequiredDescription
invoke_function ⚠nameInvoke a custom backend Hono function (in backend/functions/.ts, served at /api/functions/)

Project registry (7)

ToolRequiredDescription
rebase_project_list—List all registered Rebase projects and show which one is active
rebase_project_switchnameSwitch the active Rebase project by name
rebase_project_use_cloudprojectPoint the data and admin tools (list_documents, get_document, list_users, list_roles, cron_list_jobs, storage_list_objects…) at a Rebase Cloud project's production backend, by its id, slug or name — any project the signed-in account can reach, linked here or not
rebase_project_addnameRegister a new Rebase project
rebase_project_removenameRemove a registered project from the project registry
rebase_project_current—Show details about the currently active Rebase project, including resolved URL and auth status
rebase_project_status—Health-check the active project's backend by calling GET /health

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.

ToolRequiredDescription
rebase_cloud_provision—Give the active project a live backend on Rebase Cloud with no account or signup: provisions a project, sets REBASE_BASE_URL in .env, links the directory and deploys the local collections to it (rebase cloud init --claim), then sets REBASE_API_TOKEN in .env: a key the deployed app accepts, for reading and writing data through its row-level security, expiring with the claim window
rebase_cloud_projects_list—List every Rebase Cloud project the signed-in account can reach, across all its organizations (rebase cloud projects list --all-orgs): id, name, slug, host and status
rebase_cloud_status—Show the Rebase Cloud project this directory is linked to (rebase cloud status)
rebase_cloud_deploy—Deploy this directory to its linked Rebase Cloud project (rebase cloud deploy)
rebase_cloud_logs—Read the linked Rebase Cloud project's log once, the running app's or the latest build's (rebase cloud logs)
rebase_cloud_env_list—List the linked Rebase Cloud project's environment variables, never their values (rebase cloud env list)
rebase_cloud_env_setkey, valueSet one environment variable on the linked Rebase Cloud project (rebase cloud env set KEY --stdin)
rebase_cloud_deployments_list—List the linked Rebase Cloud project's recent deployments, newest first (rebase cloud deployments list)
rebase_cloud_rollback—Put a previous successful deployment of the linked Rebase Cloud project back into service (rebase cloud rollback)

Resources

The server exposes MCP resources for AI context:

URIDescription
rebase://collections/{name}TypeScript source of a collection definition
rebase://schemaGenerated Drizzle schema (schema.generated.ts)

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):

json
{  "mcpServers": {    "rebase": {      "command": "pnpm",      "args": ["--dir", "/path/to/your/project", "exec", "rebase-mcp"],      "env": {        "REBASE_PROJECT_DIR": "/path/to/your/project"      }    }  }}

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:

package.json → mcpNamethe ownership proof, read out of the published npm tarball
server.jsonthe manifest: the same name, the version, and the npm package to install

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:

bash
mcp-publisher login github && mcp-publisher publish

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
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

10
  1. v0.28.2最新Nov 7, 2026
  2. v0.28.1Nov 5, 2026
  3. v0.28.0Nov 5, 2026
  4. v0.27.0Nov 3, 2026
  5. v0.26.0Oct 29, 2026
  6. v0.25.1Oct 14, 2026
  7. v0.25.0Oct 14, 2026
  8. v0.23.0Sep 27, 2026
  9. v0.22.0Sep 21, 2026
  10. v0.21.1Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分