Skip to content

Hide mutating tools from read-only tools/list#283

Open
Lubrsy706 wants to merge 2 commits into
supabase:mainfrom
Lubrsy706:fix/read-only-list-tools
Open

Hide mutating tools from read-only tools/list#283
Lubrsy706 wants to merge 2 commits into
supabase:mainfrom
Lubrsy706:fix/read-only-list-tools

Conversation

@Lubrsy706

Copy link
Copy Markdown

Summary

  • add an optional listedTools subset to createMcpServer so tools/list can differ from callable tools
  • use that subset in Supabase read-only mode to hide write tools from MCP clients while preserving existing runtime read-only errors for stale callers
  • add a regression test that verifies read-only tools/list contains no readOnlyHint: false tools

Fixes #281.

Verification

  • pnpm --filter @supabase/mcp-utils typecheck
  • pnpm --filter @supabase/mcp-utils build
  • pnpm --filter @supabase/mcp-server-supabase typecheck
  • CI=1 pnpm --filter @supabase/mcp-server-supabase exec vitest run --project unit src/server.test.ts -t "read-only mode excludes write tools from tools/list"
  • CI=1 pnpm --filter @supabase/mcp-server-supabase exec vitest run --project unit src/server.test.ts -t "cannot apply migration in read-only mode"
  • pnpm exec biome check packages/mcp-utils/src/server.ts packages/mcp-server-supabase/src/server.ts packages/mcp-server-supabase/src/server.test.ts
  • pnpm --filter @supabase/mcp-server-supabase build

Note: the full src/server.test.ts suite still hits the existing delete branch failure tracked by #282 / #279 on current main.

@raulb raulb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the contribution @Lubrsy706 !! (and sorry for late reviewing). I left a couple of suggestions. Hope these made sense! Let me know otherwise.

Comment thread packages/mcp-server-supabase/src/server.ts
Comment thread packages/mcp-server-supabase/src/server.test.ts
@Lubrsy706 Lubrsy706 requested a review from a team as a code owner July 12, 2026 04:21
@Lubrsy706

Copy link
Copy Markdown
Author

Implemented both review suggestions in 09294dc, replied to and resolved both threads. The focused regression test, Supabase package typecheck, Biome check, and all 11 mcp-utils tests pass. The four GitHub Actions runs currently show action_required, so they need maintainer approval before they can execute. @raulb, could you please re-review when convenient?

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.

read-only stdio mode still exposes mutating tools in tools/list

2 participants