Repository navigation
feat: add OpenCode support to MCP clients - #41825
Conversation
- Add OpenCodeMcpConfig interface and type guard - Add OpenCode to MCP_CLIENTS array with remote config - Include OAuth authentication instructions - Add OpenCode icons with correct naming convention - Fix duplicate JSON config display by removing primaryInstructions Resolves FE-2350
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThe changes add support for a new OpenCode MCP client by introducing configuration type definitions and integrating it into the MCP URL builder system with appropriate configuration handlers and authentication instructions. Changes
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| return ( | ||
| <div className="space-y-2"> | ||
| <p className="text-xs text-foreground-light">Add the Supabase MCP server to Factory:</p> | ||
| <p className="text-xs text-foreground-light">Add Supabase MCP server to Factory:</p> |
There was a problem hiding this comment.
Minor grammer updates here
| Restart Factory or type <code>/mcp</code> within droid to complete OAuth authentication | ||
| flow. |
There was a problem hiding this comment.
Minor grammer updates here
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/ui-patterns/src/McpUrlBuilder/constants.tsx (1)
410-422: Consider direct URL access for consistency.The
transformConfigimplementation usesgetMcpUrl(config)to extract the URL, while all other MCP clients in this file directly accessconfig.mcpServers.supabase.url. Both approaches work correctly, but using direct access would maintain consistency with the established pattern.♻️ Suggested refactor for consistency
transformConfig: (config): OpenCodeMcpConfig => { - const mcpUrl = getMcpUrl(config) return { $schema: 'https://opencode.ai/config.json', mcp: { supabase: { type: 'remote', - url: mcpUrl, + url: config.mcpServers.supabase.url, enabled: true, }, }, } },
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
apps/docs/public/img/mcp-clients/opencode-dark-icon.svgis excluded by!**/*.svgapps/docs/public/img/mcp-clients/opencode-icon.svgis excluded by!**/*.svg
📒 Files selected for processing (2)
packages/ui-patterns/src/McpUrlBuilder/constants.tsxpackages/ui-patterns/src/McpUrlBuilder/types.ts
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-01-02T05:58:55.226Z
Learnt from: meGauravJain
Repo: supabase/supabase PR: 41658
File: apps/studio/components/interfaces/Connect/content/prisma/content.tsx:70-85
Timestamp: 2026-01-02T05:58:55.226Z
Learning: In Prisma configuration or related connection setup code, prefer the environment variable name DIRECT_URL for direct/non-pooled database connections instead of DATABASE_URL_UNPOOLED, per Prisma documentation. Update code that reads database connection strings to use DIRECT_URL where applicable, and document why this is preferred (explicit, documented behavior). Ensure your environment provides DIRECT_URL when using direct connections and fallback handling if needed.
Applied to files:
packages/ui-patterns/src/McpUrlBuilder/types.tspackages/ui-patterns/src/McpUrlBuilder/constants.tsx
📚 Learning: 2026-01-07T07:36:26.799Z
Learnt from: joshenlim
Repo: supabase/supabase PR: 41758
File: packages/api-types/types/platform.d.ts:5391-5392
Timestamp: 2026-01-07T07:36:26.799Z
Learning: packages/api-types/types/platform.d.ts is auto-generated by openapi-typescript and must not be edited directly; documentation changes (e.g., for max_table_sync_workers) should be made in the OpenAPI spec and then types regenerated.
Applied to files:
packages/ui-patterns/src/McpUrlBuilder/constants.tsx
🧬 Code graph analysis (1)
packages/ui-patterns/src/McpUrlBuilder/constants.tsx (3)
packages/ui-patterns/src/McpUrlBuilder/types.ts (2)
OpenCodeMcpConfig(136-145)getMcpUrl(194-214)packages/ui-patterns/src/McpUrlBuilder/index.ts (1)
getMcpUrl(12-12)packages/ui-patterns/src/McpUrlBuilder/utils/getMcpUrl.ts (1)
getMcpUrl(18-55)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: typecheck
🔇 Additional comments (6)
packages/ui-patterns/src/McpUrlBuilder/types.ts (3)
136-145: LGTM - Well-defined configuration interface.The
OpenCodeMcpConfiginterface clearly defines the structure for OpenCode MCP configuration with appropriate types. The nested structure with$schema,type: 'remote', and optionalenabledfield follows good configuration practices.
183-185: LGTM - Type guard implementation is correct.The type guard follows the established pattern used by other MCP config type guards in this file and correctly identifies OpenCode configurations by checking for distinctive properties.
207-209: LGTM - URL extraction correctly implemented.The
getMcpUrlhandler properly extracts the URL from the OpenCode configuration structure, matching the nestedmcp.supabase.urlpath defined in theOpenCodeMcpConfiginterface.packages/ui-patterns/src/McpUrlBuilder/constants.tsx (3)
10-10: LGTM - Import correctly added.The
OpenCodeMcpConfigtype is properly imported alongside other MCP config types.
384-384: LGTM - Improved instruction clarity.The wording adjustments to Factory's instructions enhance conciseness and readability without changing the functional content.
Also applies to: 398-402
404-440: OpenCode MCP client implementation is correct.The icon files exist in the repository (
opencode-icon.svgandopencode-dark-icon.svg), the configuration follows the established naming pattern used by other MCP clients, and the OAuth authentication instructions inalternateInstructionsare clear and appropriate. The implementation is ready for merge.
🎭 Playwright Test ResultsDetails
Skipped testsFeatures › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected |
Braintrust eval report
|
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Docs update: adds [fx](https://fx.sh) to the MCP client list, following the same pattern as the recently added Warp (#48838), GitHub Copilot CLI (#46150) and OpenCode (#41825) clients. fx is a native coding agent and an MCP client. It supports Streamable HTTP and the full OAuth flow (metadata discovery, PKCE, Dynamic Client Registration fallback, refresh), so it connects to the hosted Supabase MCP server without a proxy. ## What is the current behavior? fx is not in the client list, so users have to hand-write the config. fx keys servers under `mcp` rather than `mcpServers` and names the transport `http`, which is easy to get wrong by adapting another client's snippet. ## What is the new behavior? fx appears in the **AI Agent CLI** group, in both the docs page and the dashboard's Connect panel. It renders as: > **fx** > > Add this configuration to `~/.fx/mcp.json`: > > ```json > { > "mcp": { > "supabase": { > "type": "http", > "url": "https://mcp.supabase.com/mcp" > } > } > } > ``` > > fx reads MCP servers only from this profile, so a file inside a repository cannot add one. If a session is already open, apply the change with `/mcp reload`. > > Then authenticate from the fx shell. This opens your browser to complete the OAuth flow: > > ```bash > /mcp auth supabase --open > ``` > > Confirm the server is connected with `/mcp list`. > > For more details, see [MCP configuration](https://fx.sh/docs/capabilities/mcp) in fx. fx is configured by file only, so it gets an `alternate` instruction block and no `install` command, matching Cursor, VS Code, Warp and Antigravity. ## Additional context The config above was verified end to end against the hosted server: the OAuth flow completes and `/mcp list` reports the server connected. Two notes on the diff: - **`types.ts`** gains an `FxMcpConfig` interface, a type guard and a branch in `getMcpUrl`. fx's shape is not covered by any existing interface (`OpenCodeMcpConfig` is the other `mcp`-rooted one, but carries `$schema` and `type: 'remote'`). Since `getMcpUrl` throws on an unrecognized shape and runs for every client with instructions, the guard is required rather than cosmetic. Antigravity (#43597) and OpenCode (#41825) added their shapes the same way. - **Tests.** `utils/getMcpIconSrc.test.ts` gains a case for the new dark icon variant, alongside the existing cursor and perplexity cases. `types.test.ts` is new and checks that every client's `transformConfig` output round-trips back through `getMcpUrl`, which is what guards the throw above. Happy to drop either if you'd rather keep the diff to the usual shape for a client addition. Prettier passes with the repo config, `tsc --noEmit` is clean, and both test files pass. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added fx as a supported MCP client in the MCP URL builder. * Added profile-based setup guidance, OAuth authentication instructions, connection verification, and documentation links. * Added light and dark fx icons for improved visual support. * **Bug Fixes** * Improved MCP URL detection for fx configurations. * **Tests** * Added coverage for MCP URL extraction and dark-mode icon selection. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Ali Waseem <[email protected]>
Resolves FE-2350
I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Feature add opencode MCP using opencode ♾️
Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.