Skip to content

Commit 2c80ffc

Browse files
authored
Merge pull request #103 from supabase-community/feat/conditional-tools-by-platform
Conditional tools based on platform implementation
2 parents adac4a1 + e13978e commit 2c80ffc

20 files changed

+582
-350
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ You can enable or disable specific tool groups by passing the `--features` flag
160160
npx -y @supabase/mcp-server-supabase@latest --features=database,docs
161161
```
162162

163-
Available groups are: [`account`](#account), [`docs`](#knowledge-base), [`database`](#database), [`debug`](#debug), [`development`](#development), [`functions`](#edge-functions), [`storage`](#storage), and [`branching`](#branching-experimental-requires-a-paid-plan).
163+
Available groups are: [`account`](#account), [`docs`](#knowledge-base), [`database`](#database), [`debugging`](#debugging), [`development`](#development), [`functions`](#edge-functions), [`storage`](#storage), and [`branching`](#branching-experimental-requires-a-paid-plan).
164164

165-
If this flag is not passed, the default feature groups are: `account`, `database`, `debug`, `development`, `docs`, `functions`, and `branching`.
165+
If this flag is not passed, the default feature groups are: `account`, `database`, `debugging`, `development`, `docs`, `functions`, and `branching`.
166166

167167
## Tools
168168

@@ -202,9 +202,9 @@ Enabled by default. Use `database` to target this group of tools with the [`--fe
202202
- `apply_migration`: Applies a SQL migration to the database. SQL passed to this tool will be tracked within the database, so LLMs should use this for DDL operations (schema changes).
203203
- `execute_sql`: Executes raw SQL in the database. LLMs should use this for regular queries that don't change the schema.
204204

205-
#### Debug
205+
#### Debugging
206206

207-
Enabled by default. Use `debug` to target this group of tools with the [`--features`](#feature-groups) option.
207+
Enabled by default. Use `debugging` to target this group of tools with the [`--features`](#feature-groups) option.
208208

209209
- `get_logs`: Gets logs for a Supabase project by service type (api, postgres, edge functions, auth, storage, realtime). LLMs can use this to help with debugging and monitoring service performance.
210210
- `get_advisors`: Gets a list of advisory notices for a Supabase project. LLMs can use this to check for security vulnerabilities or performance issues.

packages/mcp-server-supabase/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,19 @@
2525
},
2626
"exports": {
2727
".": {
28-
"import": "./dist/index.js",
2928
"types": "./dist/index.d.ts",
29+
"import": "./dist/index.js",
3030
"default": "./dist/index.cjs"
3131
},
3232
"./platform": {
33-
"import": "./dist/platform/index.js",
3433
"types": "./dist/platform/index.d.ts",
34+
"import": "./dist/platform/index.js",
3535
"default": "./dist/platform/index.cjs"
36+
},
37+
"./platform/api": {
38+
"types": "./dist/platform/api-platform.d.ts",
39+
"import": "./dist/platform/api-platform.js",
40+
"default": "./dist/platform/api-platform.cjs"
3641
}
3742
},
3843
"dependencies": {

packages/mcp-server-supabase/src/index.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
MCP_CLIENT_VERSION,
99
} from '../test/mocks.js';
1010
import { createSupabaseMcpServer } from './index.js';
11+
import { createSupabaseApiPlatform } from './platform/api-platform.js';
1112

1213
type SetupOptions = {
1314
accessToken?: string;
@@ -34,11 +35,13 @@ async function setup(options: SetupOptions = {}) {
3435
}
3536
);
3637

38+
const platform = createSupabaseApiPlatform({
39+
apiUrl: API_URL,
40+
accessToken,
41+
});
42+
3743
const server = createSupabaseMcpServer({
38-
platform: {
39-
apiUrl: API_URL,
40-
accessToken,
41-
},
44+
platform,
4245
projectId,
4346
readOnly,
4447
features,
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
export * from './platform/api-platform.js';
21
export type { SupabasePlatform } from './platform/index.js';
3-
export * from './server.js';
2+
export {
3+
createSupabaseMcpServer,
4+
type SupabaseMcpServerOptions,
5+
} from './server.js';
6+
export { featureGroupSchema, type FeatureGroup } from './types.js';

0 commit comments

Comments
 (0)