Skip to content

Commit 007926d

Browse files
authored
Merge pull request #10 from supabase-community/feat/branching
feat: support branching workflow via mcp
2 parents 079088b + 6584d19 commit 007926d

File tree

8 files changed

+1374
-271
lines changed

8 files changed

+1374
-271
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ The following Supabase tools are available to the LLM:
138138
- `get_project_url`: Gets the API URL for a project.
139139
- `get_anon_key`: Gets the anonymous API key for a project.
140140

141+
#### Branching (Experimental)
142+
143+
- `enable_branching`: Enables branching on a project (requires a paid plan).
144+
- `create_branch`: Creates a development branch with migrations from production branch.
145+
- `list_branches`: Lists all development branches.
146+
- `delete_branch`: Deletes a development branch.
147+
- `merge_branch`: Merges migrations and edge functions from a development branch to production.
148+
- `reset_branch`: Resets migrations of a development branch to a prior version.
149+
- `rebase_branch`: Rebases development branch on production to handle migration drift.
150+
141151
#### Development Tools
142152

143153
- `generate_typescript_types`: Generates TypeScript types based on the database schema. LLMs can save this to a file and use it in their code.

package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mcp-server-supabase/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"@types/node": "^22.8.6",
4242
"date-fns": "^4.1.0",
4343
"msw": "^2.7.3",
44+
"nanoid": "^5.1.5",
4445
"openapi-typescript": "^7.5.0",
4546
"openapi-typescript-helpers": "^0.0.15",
4647
"prettier": "^3.3.3",

packages/mcp-server-supabase/src/management-api/types.ts

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,6 +1346,9 @@ export interface components {
13461346
/** @enum {string} */
13471347
message: "ok";
13481348
};
1349+
BranchActionBody: {
1350+
migration_version?: string;
1351+
};
13491352
BranchUpdateResponse: {
13501353
workflow_run_id: string;
13511354
/** @enum {string} */
@@ -2364,6 +2367,10 @@ export interface components {
23642367
version: string;
23652368
name?: string;
23662369
}[];
2370+
V1CreateMigrationBody: {
2371+
query: string;
2372+
name?: string;
2373+
};
23672374
V1RunQueryBody: {
23682375
query: string;
23692376
};
@@ -2705,7 +2712,11 @@ export interface operations {
27052712
};
27062713
cookie?: never;
27072714
};
2708-
requestBody?: never;
2715+
requestBody: {
2716+
content: {
2717+
"application/json": components["schemas"]["BranchActionBody"];
2718+
};
2719+
};
27092720
responses: {
27102721
201: {
27112722
headers: {
@@ -2733,7 +2744,11 @@ export interface operations {
27332744
};
27342745
cookie?: never;
27352746
};
2736-
requestBody?: never;
2747+
requestBody: {
2748+
content: {
2749+
"application/json": components["schemas"]["BranchActionBody"];
2750+
};
2751+
};
27372752
responses: {
27382753
201: {
27392754
headers: {
@@ -2761,7 +2776,11 @@ export interface operations {
27612776
};
27622777
cookie?: never;
27632778
};
2764-
requestBody?: never;
2779+
requestBody: {
2780+
content: {
2781+
"application/json": components["schemas"]["BranchActionBody"];
2782+
};
2783+
};
27652784
responses: {
27662785
201: {
27672786
headers: {
@@ -5310,7 +5329,11 @@ export interface operations {
53105329
};
53115330
cookie?: never;
53125331
};
5313-
requestBody?: never;
5332+
requestBody: {
5333+
content: {
5334+
"application/json": components["schemas"]["V1CreateMigrationBody"];
5335+
};
5336+
};
53145337
responses: {
53155338
200: {
53165339
headers: {

0 commit comments

Comments
 (0)