Skip to content

Commit 3c33d83

Browse files
committed
chore: rename registry to tool-schemas, align with AI SDK naming
1 parent 8e34333 commit 3c33d83

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,4 @@ export {
164164
type UpdateStorageConfigOutput,
165165
} from './tools/storage-tools.js';
166166

167-
export { supabaseMcpTools } from './tools/registry.js';
167+
export { supabaseMcpToolSchemas } from './tools/tool-schemas.js';

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { createSupabaseApiPlatform } from './platform/api-platform.js';
2929
import type { SupabasePlatform } from './platform/types.js';
3030
import { BRANCH_COST_HOURLY, PROJECT_COST_MONTHLY } from './pricing.js';
3131
import { createSupabaseMcpServer } from './server.js';
32-
import { supabaseMcpTools } from './tools/registry.js';
32+
import { supabaseMcpToolSchemas } from './tools/tool-schemas.js';
3333

3434
let mockServer: ReturnType<typeof setupServer> | undefined;
3535

@@ -2842,7 +2842,7 @@ describe('tools', () => {
28422842
expect(toolsWithoutOutputSchema).toEqual([]);
28432843
});
28442844

2845-
test('all tools are included in supabaseMcpTools registry', async () => {
2845+
test('all tools are included in supabaseMcpToolSchemas registry', async () => {
28462846
// Enable all features to ensure we check all possible tools
28472847
const { client } = await setup({
28482848
features: [
@@ -2862,14 +2862,14 @@ describe('tools', () => {
28622862
// Check that every tool from the MCP server exists in the registry
28632863
for (const tool of tools) {
28642864
expect(
2865-
supabaseMcpTools,
2866-
`Tool "${tool.name}" should be in supabaseMcpTools registry`
2865+
supabaseMcpToolSchemas,
2866+
`Tool "${tool.name}" should be in supabaseMcpToolSchemas registry`
28672867
).toHaveProperty(tool.name);
28682868
}
28692869

28702870
// Also verify that the registry doesn't have extra entries
28712871
// (tools that don't exist in the server)
2872-
const registryToolNames = Object.keys(supabaseMcpTools);
2872+
const registryToolNames = Object.keys(supabaseMcpToolSchemas);
28732873
const serverToolNames = tools.map((t) => t.name);
28742874

28752875
const extraToolsInRegistry = registryToolNames.filter(

packages/mcp-server-supabase/src/tools/registry.ts renamed to packages/mcp-server-supabase/src/tools/tool-schemas.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,22 @@ import {
8989
} from './storage-tools.js';
9090

9191
/**
92-
* Complete registry of all Supabase MCP tools with their input and output schemas.
93-
* Used for type-safe parsing of tool calls and results.
92+
* All Supabase MCP tool schemas (input + output pairs).
93+
*
94+
* Pass to AI SDK's `mcpClient.tools()` `schemas` option to get typed tool
95+
* inputs and outputs:
96+
* https://ai-sdk.dev/docs/ai-sdk-core/mcp-tools#typed-tool-outputs
9497
*
9598
* @example
9699
* ```typescript
97-
* import { supabaseMcpTools } from '@supabase/mcp-server-supabase';
98-
* import { parseToolCall } from '@supabase/mcp-utils';
100+
* import { supabaseMcpToolSchemas } from '@supabase/mcp-server-supabase';
99101
*
100-
* const parsed = parseToolCall(toolCall, supabaseMcpTools);
101-
* if (parsed.name === 'execute_sql') {
102-
* console.log(parsed.input.query); // Typed input
103-
* }
102+
* const tools = await mcpClient.tools({
103+
* schemas: supabaseMcpToolSchemas,
104+
* });
104105
* ```
105106
*/
106-
export const supabaseMcpTools = {
107+
export const supabaseMcpToolSchemas = {
107108
// Account tools
108109
list_organizations: {
109110
inputSchema: listOrganizationsInputSchema,

packages/mcp-server-supabase/test/e2e/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { anthropic } from '@ai-sdk/anthropic';
22
import { StreamTransport } from '@supabase/mcp-utils';
33
import { createMCPClient } from '@ai-sdk/mcp';
4-
import { createSupabaseMcpServer, supabaseMcpTools } from '../../src/index.js';
4+
import { createSupabaseMcpServer, supabaseMcpToolSchemas } from '../../src/index.js';
55
import { createSupabaseApiPlatform } from '../../src/platform/api-platform.js';
66
import { ACCESS_TOKEN, API_URL, MCP_CLIENT_NAME } from '../mocks.js';
77

@@ -48,4 +48,4 @@ export function getTestModel(modelId?: string) {
4848
return anthropic(modelId ?? DEFAULT_TEST_MODEL);
4949
}
5050

51-
export { supabaseMcpTools };
51+
export { supabaseMcpToolSchemas };

0 commit comments

Comments
 (0)