Conditional tools based on platform implementation #103
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
After:
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.