Repository navigation
fix(mcp-server-supabase): detect deno.jsonc as the default edge function import map - #559
Merged
Rodriguespn merged 4 commits intoNov 17, 2026
Conversation
…ion import map When deploy_edge_function is called without import_map_path and the function has no existing import map, the server falls back to a file-name heuristic. That heuristic only matched deno.json and import_map.json, so a function configured through deno.jsonc deployed with no import map and its `imports` were silently dropped, even though the tool's `files` description tells agents to include deno.jsonc. The heuristic also used whichever matching file came first in `files`, so the chosen map depended on the order the agent listed them in. Pick the default with a fixed precedence instead: deno.json, then deno.jsonc (matching the Supabase CLI), then the legacy import_map.json. An explicit import_map_path and a previously deployed import map still take priority, as before. Adds tests for a deno.jsonc-only deploy and for deno.json winning over deno.jsonc and import_map.json regardless of file order. Fixes supabase#558
Rodriguespn
approved these changes
Nov 17, 2026
Rodriguespn
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the fix and for contributing, @officialasishkumar! We'll merge this.
…./platform Move the deno.json / deno.jsonc / import_map.json precedence logic into src/platform/import-map.ts and export DEFAULT_IMPORT_MAP_FILENAMES and getDefaultImportMapPath from the `@supabase/mcp-server-supabase/platform` entrypoint so the hosted MCP server can reuse it instead of keeping a copy. Builds on the fix from supabase#559 (credit to Asish Kumar). Refs AI-1500 Co-authored-by: Asish Kumar <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…o edge-function.ts Fold DEFAULT_IMPORT_MAP_FILENAMES and getDefaultImportMapPath into the existing edge-function module and its test file instead of a separate import-map module. The ./platform entrypoint re-exports them from there. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Merged
Rodriguespn
pushed a commit
that referenced
this pull request
Nov 20, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>mcp-server-supabase: 0.19.0</summary> ## [0.19.0](mcp-server-supabase-v0.18.0...mcp-server-supabase-v0.19.0) (2026-11-19) ### Features * **mcp apps:** create project and create branch ui ([#573](#573)) ([a4e8c43](a4e8c43)) ### Bug Fixes * **mcp-server-supabase:** detect deno.jsonc as the default edge function import map ([#559](#559)) ([16bde19](16bde19)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
Fixes #558.
When
deploy_edge_functionis called withoutimport_map_pathand the function has no existing import map, the server guesses one from the uploaded file names. The guess only matchesdeno.jsonandimport_map.json. A function configured throughdeno.jsonctherefore deploys with no import map, and itsimportsare dropped, even though thefilesdescription tells agents to includedeno.jsonc. When several matching files are present, the first one infileswins, so the result depends on array order.What is the new behavior?
The default import map is chosen by a fixed precedence:
deno.json, thendeno.jsonc(assupabase functions deploydoes), then the legacyimport_map.json. File order no longer matters. An explicitimport_map_pathstill wins, and so does the import map of an existing function. No tool metadata changes.How to Review
Import map selection
packages/mcp-server-supabase/src/platform/api-platform.tsdeployEdgeFunctionnow callsgetDefaultImportMapPath, which walksDEFAULT_IMPORT_MAP_FILENAMESin order. Fallback order (explicit → existing → heuristic) is unchanged.Tests
packages/mcp-server-supabase/src/server.functions.test.tsdeno.jsonc-only deploy getsimport_map_pathending indeno.jsonc. Withimport_map.json,deno.jsoncanddeno.jsonpassed in that order,deno.jsonis chosen.Review questions
import_map.jsonstay as the last fallback? This PR keeps it for backward compatibility.Verification
Run on Node 24.22.3 / pnpm 10.34.9 after
pnpm run build:pnpm --filter @supabase/mcp-server-supabase test:unit --run: 34 files, 915 tests passed.api-platform.tschange reverted,test:unit --run src/server.functions.test.ts -t "import map"fails both new tests; the three existing import-map tests still pass.pnpm typecheckinpackages/mcp-server-supabaseandbiome checkon both changed files: clean.Additional context
Supabase CLI reference for the precedence:
apps/cli/src/shared/functions/deploy.tsin supabase/cli checksdeno.json, thendeno.jsonc.