Skip to content

Platform abstraction#78

Merged
gregnr merged 6 commits into
mainfrom
feat/platform-abstraction
May 28, 2025
Merged

Platform abstraction#78
gregnr merged 6 commits into
mainfrom
feat/platform-abstraction

Conversation

@gregnr

@gregnr gregnr commented May 26, 2025

Copy link
Copy Markdown
Member

Abstracts Supabase platform methods (listProjects, executeSql, etc) into an interface that can be passed into the MCP server during initialization. This is the first step to hosting the MCP server inside our management API so that we can implement each of these platform methods directly instead of re-calling management API routes.

// We can implement these separately in management API
const platform: SupabasePlatform = {
  listProjects() {
    // ...
  },
  executeSql(projectId: string, options: ExecuteSqlOptions) {
    // ...
  },
  // ...
}

const server = createSupabaseMcpServer({
  platform,
});

Local (stdio) instances of the MCP server will continue to make API requests to the management API via createSupabaseApiPlatform() implementation.

// Calls management API routes via HTTP request like it did before
const platform = createSupabaseApiPlatform({
  accessToken,
  apiUrl,
});

const server = createSupabaseMcpServer({
  platform,
});

@gregnr gregnr force-pushed the feat/platform-abstraction branch 5 times, most recently from 5042a64 to 5f3c7d0 Compare May 26, 2025 22:11
@gregnr gregnr force-pushed the feat/platform-abstraction branch from 5f3c7d0 to 49869b7 Compare May 26, 2025 22:29
@gregnr gregnr merged commit 0822b2b into main May 28, 2025
2 checks passed
@gregnr gregnr mentioned this pull request Jun 10, 2025
GQAdonis pushed a commit to skytok-net/supabase-mcp that referenced this pull request Aug 14, 2025
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.

2 participants