Skip to content

Conversation

gregnr
Copy link
Collaborator

@gregnr gregnr commented Jun 23, 2025

Supabase MCP supports custom platform implementations based on the environment it is running in. This PR makes it more flexible by allowing you to implement only a subset of platform operations.

Before:

const myPlatform: SupabasePlatform = {
  executeSql() { ... },
  listMigrations() { ... },
  applyMigration() { ... },
  // every other possible platform operation must be implemented
}

After:

const myPlatform: SupabasePlatform = {
  // grouped by feature category now
  database: {
    executeSql() { ... },
    listMigrations() { ... },
    applyMigration() { ... },
  },
  functions: { ... },
  // option to not implement anything else
}

Why?

Self-hosted Supabase can support some but not all platform operations (e.g. it can't support account level or branching operations). In order to make this MCP server compatible with self-hosted, we need a way to conditionally provide tools based on which platform operations are available.

This also gives us the flexibility to choose a subset of features to implement on the remote MCP implementation (useful during development and quick iterations).

How?

Now that we support feature groups, we can extend this logic to also filter by platform operations. The SupabasePlatform interface is now grouped by feature (database, account, functions, etc) and each group is optional. We add logic in the server that conditionally adds tools only if the platform methods for that group are implemented.

@gregnr gregnr force-pushed the feat/conditional-tools-by-platform branch from 14bf20d to f3a655a Compare June 27, 2025 04:08
@madhavpujara-at
Copy link

any updates on when will this be merged

@nthtrung09it
Copy link

waiting ...

Copy link
Contributor

@mattrossman mattrossman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅ Confirmed in Cursor that specifying an unimplemented --features group correctly fails the load the server, and that debug correctly falls back to debugging.

@gregnr gregnr force-pushed the feat/conditional-tools-by-platform branch from 52db6cc to e13978e Compare August 27, 2025 17:32
@gregnr gregnr merged commit 2c80ffc into main Aug 27, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants