Skip to content

Conditional tools based on platform implementation #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ You can enable or disable specific tool groups by passing the `--features` flag
npx -y @supabase/mcp-server-supabase@latest --features=database,docs
```

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

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

## Tools

Expand Down Expand Up @@ -198,9 +198,9 @@ Enabled by default. Use `database` to target this group of tools with the [`--fe
- `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).
- `execute_sql`: Executes raw SQL in the database. LLMs should use this for regular queries that don't change the schema.

#### Debug
#### Debugging

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

- `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.
- `get_advisors`: Gets a list of advisory notices for a Supabase project. LLMs can use this to check for security vulnerabilities or performance issues.
Expand Down
9 changes: 7 additions & 2 deletions packages/mcp-server-supabase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,19 @@
},
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.cjs"
},
"./platform": {
"import": "./dist/platform/index.js",
"types": "./dist/platform/index.d.ts",
"import": "./dist/platform/index.js",
"default": "./dist/platform/index.cjs"
},
"./platform/api": {
"types": "./dist/platform/api-platform.d.ts",
"import": "./dist/platform/api-platform.js",
"default": "./dist/platform/api-platform.cjs"
}
},
"dependencies": {
Expand Down
11 changes: 7 additions & 4 deletions packages/mcp-server-supabase/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
MCP_CLIENT_VERSION,
} from '../test/mocks.js';
import { createSupabaseMcpServer } from './index.js';
import { createSupabaseApiPlatform } from './platform/api-platform.js';

type SetupOptions = {
accessToken?: string;
Expand All @@ -34,11 +35,13 @@ async function setup(options: SetupOptions = {}) {
}
);

const platform = createSupabaseApiPlatform({
apiUrl: API_URL,
accessToken,
});

const server = createSupabaseMcpServer({
platform: {
apiUrl: API_URL,
accessToken,
},
platform,
projectId,
readOnly,
features,
Expand Down
7 changes: 5 additions & 2 deletions packages/mcp-server-supabase/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export * from './platform/api-platform.js';
export type { SupabasePlatform } from './platform/index.js';
export * from './server.js';
export {
createSupabaseMcpServer,
type SupabaseMcpServerOptions,
} from './server.js';
export { featureGroupSchema, type FeatureGroup } from './types.js';
Loading