Supabase MCP #4169

Open
opened 2026-02-16 17:42:52 -05:00 by yindo · 13 comments
Owner

Originally created by @proflivio on GitHub (Jan 4, 2026).

Originally assigned to: @rekram1-node on GitHub.

Question

I'm trying to setup a remote project-scoped supabase mcp. Whichever method I try (oauth or bearer api key), the debug output is allways the same. opencode.json is in my project root, I tried both loading the api key from env and hardcoding it.

Here's the debug output.

┌  MCP OAuth Debug
│
●  Server: supabase
│
●  URL: https://mcp.supabase.com/mcp?project_ref=[redacted]
│
●  Auth status: ○ not authenticated
│
◇  HTTP response: 401 Unauthorized
│
●  WWW-Authenticate: Bearer error="invalid_request", error_description="No access token was provided in this request", resource_metadata="https://mcp.supabase.com/.well-known/oauth-protected-resource/mcp?project_ref=[redacted]"
│
▲  Server returned 401 Unauthorized
│
●  Testing OAuth flow (without completing authorization)...
│
■  Connection error: Dynamic client registration failed: HTTP 404
│
└  Debug complete```

Is it even possible to use the supabase mcp, or am I doing something wrong?
Originally created by @proflivio on GitHub (Jan 4, 2026). Originally assigned to: @rekram1-node on GitHub. ### Question I'm trying to setup a remote project-scoped supabase mcp. Whichever method I try (oauth or bearer api key), the debug output is allways the same. `opencode.json` is in my project root, I tried both loading the api key from env and hardcoding it. Here's the debug output. ``` ┌ MCP OAuth Debug │ ● Server: supabase │ ● URL: https://mcp.supabase.com/mcp?project_ref=[redacted] │ ● Auth status: ○ not authenticated │ ◇ HTTP response: 401 Unauthorized │ ● WWW-Authenticate: Bearer error="invalid_request", error_description="No access token was provided in this request", resource_metadata="https://mcp.supabase.com/.well-known/oauth-protected-resource/mcp?project_ref=[redacted]" │ ▲ Server returned 401 Unauthorized │ ● Testing OAuth flow (without completing authorization)... │ ■ Connection error: Dynamic client registration failed: HTTP 404 │ └ Debug complete``` Is it even possible to use the supabase mcp, or am I doing something wrong?
Author
Owner

@cravenceiling commented on GitHub (Jan 4, 2026):

I think you need to setup supabase auth (or something like that) first to connect an mcp client.

Edit:

Did you try this?

https://supabase.com/docs/guides/auth/oauth-server/mcp-authentication#prerequisites

@cravenceiling commented on GitHub (Jan 4, 2026): I think you need to setup supabase auth (or something like that) first to connect an mcp client. Edit: Did you try this? https://supabase.com/docs/guides/auth/oauth-server/mcp-authentication#prerequisites
Author
Owner

@proflivio commented on GitHub (Jan 4, 2026):

No, I think it's for connecting mcp to an app (correct me if I'm wrong), I just need it for local development.

I have no trouble adding it to Claude Code (oauth) or Kilo (access token).

Edit:
I tried adding another mcp that doesn't require auth (svelte) with the opencode mcp add command. Here's the output:

┌  Add MCP server
│
◇  Enter MCP server name
│  svelte
│
◇  Select MCP server type
│  Remote
│
◇  Enter MCP server URL
│  https://mcp.svelte.dev/mcp
│
◇  Does this server require OAuth authentication?
│  No
│
●  Remote MCP server "svelte" configured with URL: https://mcp.svelte.dev/mcp
│
└  MCP server added successfully

Then, running opencode mcp list gives this:

┌  MCP Servers
│
▲  No MCP servers configured
│
└  Add servers with: opencode mcp add

Bug, or silly me?

@proflivio commented on GitHub (Jan 4, 2026): No, I think it's for connecting mcp to an app (correct me if I'm wrong), I just need it for local development. I have no trouble adding it to Claude Code (oauth) or Kilo (access token). **Edit:** I tried adding another mcp that doesn't require auth (svelte) with the `opencode mcp add` command. Here's the output: ``` ┌ Add MCP server │ ◇ Enter MCP server name │ svelte │ ◇ Select MCP server type │ Remote │ ◇ Enter MCP server URL │ https://mcp.svelte.dev/mcp │ ◇ Does this server require OAuth authentication? │ No │ ● Remote MCP server "svelte" configured with URL: https://mcp.svelte.dev/mcp │ └ MCP server added successfully ``` Then, running `opencode mcp list` gives this: ``` ┌ MCP Servers │ ▲ No MCP servers configured │ └ Add servers with: opencode mcp add ``` Bug, or silly me?
Author
Owner

@rekram1-node commented on GitHub (Jan 4, 2026):

Can u show ur opencode.json?

@rekram1-node commented on GitHub (Jan 4, 2026): Can u show ur opencode.json?
Author
Owner

@lakshyaag commented on GitHub (Jan 4, 2026):

Following, facing the same issue since last night.

Here's my opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "myprovider": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "PrimeIntellect",
      "options": {
        "baseURL": "https://api.pinference.ai/api/v1",
        "apiKey": "{env:PRIME_API_KEY}"
      },
      "models": {
        "google/gemini-3-flash-preview": {
          "name": "Gemini 3 Flash Preview"
        },
        "google/gemini-3-pro-preview": {
          "name": "Gemini 3 Pro Preview"
        },
        "openai/gpt-5.2": {
          "name": "GPT 5.2"
        },
        "anthropic/claude-sonnet-4.5": {
          "name": "Claude Sonnet 4.5"
        },
        "anthropic/claude-opus-4.5": {
          "name": "Claude Opus 4.5"
        }
      }
    }
  },
  "mcp": {
    "playwright": {
      "type": "local",
      "command": [
        "npx",
        "@playwright/mcp@latest"
      ],
      "enabled": true
    },
    "supabase": {
      "type": "remote",
      "url": "https://mcp.supabase.com/mcp?project_ref=voplznrezagtsebsfswl",
      "enabled": true,
      "oauth": {}
    }
  }
}

Here is the output of: opencode mcp debug supabase

❯ opencode mcp debug supabase

┌  MCP OAuth Debug
│
●  Server: supabase
│
●  URL: https://mcp.supabase.com/mcp?project_ref=voplznrezagtsebsfswl
│
●  Auth status: ○ not authenticated
│
◇  HTTP response: 401 Unauthorized
│
●  WWW-Authenticate: Bearer error="invalid_request", error_description="No access token was provided in this request", resource_metadata="https://mcp.supabase.com/.well-known/oauth-protected-resource/mcp?project_ref=voplznrezagtsebsfswl"
│
▲  Server returned 401 Unauthorized
│
●  Testing OAuth flow (without completing authorization)...
│
■  Connection error: Dynamic client registration failed: HTTP 404
│
└  Debug complete
@lakshyaag commented on GitHub (Jan 4, 2026): Following, facing the same issue since last night. Here's my `opencode.json`: ``` { "$schema": "https://opencode.ai/config.json", "provider": { "myprovider": { "npm": "@ai-sdk/openai-compatible", "name": "PrimeIntellect", "options": { "baseURL": "https://api.pinference.ai/api/v1", "apiKey": "{env:PRIME_API_KEY}" }, "models": { "google/gemini-3-flash-preview": { "name": "Gemini 3 Flash Preview" }, "google/gemini-3-pro-preview": { "name": "Gemini 3 Pro Preview" }, "openai/gpt-5.2": { "name": "GPT 5.2" }, "anthropic/claude-sonnet-4.5": { "name": "Claude Sonnet 4.5" }, "anthropic/claude-opus-4.5": { "name": "Claude Opus 4.5" } } } }, "mcp": { "playwright": { "type": "local", "command": [ "npx", "@playwright/mcp@latest" ], "enabled": true }, "supabase": { "type": "remote", "url": "https://mcp.supabase.com/mcp?project_ref=voplznrezagtsebsfswl", "enabled": true, "oauth": {} } } } ``` Here is the output of: `opencode mcp debug supabase` ``` ❯ opencode mcp debug supabase ┌ MCP OAuth Debug │ ● Server: supabase │ ● URL: https://mcp.supabase.com/mcp?project_ref=voplznrezagtsebsfswl │ ● Auth status: ○ not authenticated │ ◇ HTTP response: 401 Unauthorized │ ● WWW-Authenticate: Bearer error="invalid_request", error_description="No access token was provided in this request", resource_metadata="https://mcp.supabase.com/.well-known/oauth-protected-resource/mcp?project_ref=voplznrezagtsebsfswl" │ ▲ Server returned 401 Unauthorized │ ● Testing OAuth flow (without completing authorization)... │ ■ Connection error: Dynamic client registration failed: HTTP 404 │ └ Debug complete ```
Author
Owner

@proflivio commented on GitHub (Jan 4, 2026):

Can u show ur opencode.json?

@rekram1-node I made a new folder when i tested with mcp add, there was no json there after the success message.

I added svelte manually to the original folder json, it works now, but supa - no luck.

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "supabase": {
      "type": "remote",
      "url": "https://mcp.supabase.com/mcp?project_ref=[project]",
      "oauth": {},
      /*
      "headers": {
        "Authorization": "Bearer {env:SUPABASE_ACCESS_TOKEN}",
      },
      */
      "enabled": true
    },
    "svelte": {
      "type": "remote",
      "url": "https://mcp.svelte.dev/mcp",
      "enabled": true,
    },
  },
}

Following, facing the same issue since last night.

@lakshyaag My debug outputs started giving me time out after 5s messages occasionally.

@proflivio commented on GitHub (Jan 4, 2026): > Can u show ur opencode.json? @rekram1-node I made a new folder when i tested with `mcp add`, there was no json there after the success message. I added svelte manually to the original folder json, it works now, but supa - no luck. ```jsonc { "$schema": "https://opencode.ai/config.json", "mcp": { "supabase": { "type": "remote", "url": "https://mcp.supabase.com/mcp?project_ref=[project]", "oauth": {}, /* "headers": { "Authorization": "Bearer {env:SUPABASE_ACCESS_TOKEN}", }, */ "enabled": true }, "svelte": { "type": "remote", "url": "https://mcp.svelte.dev/mcp", "enabled": true, }, }, } ``` > Following, facing the same issue since last night. @lakshyaag My debug outputs started giving me time out after 5s messages occasionally.
Author
Owner

@cravenceiling commented on GitHub (Jan 4, 2026):

I somehow managed to connect the supabase mcp server with this config:

"mcp": {
  "supabase": {
    "type": "remote",
    "url": "https://mcp.supabase.com/mcp?project_ref=<YOUR-PROJET-REF>",
    "oauth": {},
    "headers": {
      "Authorization": "Bearer <YOUR_sbp_token>",
    },
    "enabled": true
  }
}

I create the token here: https://supabase.com/dashboard/account/tokens

Image
@cravenceiling commented on GitHub (Jan 4, 2026): I somehow managed to connect the supabase mcp server with this config: ```text "mcp": { "supabase": { "type": "remote", "url": "https://mcp.supabase.com/mcp?project_ref=<YOUR-PROJET-REF>", "oauth": {}, "headers": { "Authorization": "Bearer <YOUR_sbp_token>", }, "enabled": true } } ``` I create the token here: https://supabase.com/dashboard/account/tokens <img width="1341" height="400" alt="Image" src="https://github.com/user-attachments/assets/6bc907dc-f977-428a-af6e-7538b7648b1e" />
Author
Owner

@andreapiso commented on GitHub (Jan 5, 2026):

I somehow managed to connect the supabase mcp server with this config:

"mcp": {
  "supabase": {
    "type": "remote",
    "url": "https://mcp.supabase.com/mcp?project_ref=<YOUR-PROJET-REF>",
    "oauth": {},
    "headers": {
      "Authorization": "Bearer <YOUR_sbp_token>",
    },
    "enabled": true
  }
}

I create the token here: https://supabase.com/dashboard/account/tokens

Image

This does not work for me - i get

  WWW-Authenticate: Bearer error="invalid_request", error_description="No access token was provided in this request", resource_metadata="https://mcp.supabase.com/.well-known/oauth-protected-resource/mcp"

even though the token is clearly there.

@andreapiso commented on GitHub (Jan 5, 2026): > I somehow managed to connect the supabase mcp server with this config: > > ``` > "mcp": { > "supabase": { > "type": "remote", > "url": "https://mcp.supabase.com/mcp?project_ref=<YOUR-PROJET-REF>", > "oauth": {}, > "headers": { > "Authorization": "Bearer <YOUR_sbp_token>", > }, > "enabled": true > } > } > ``` > > I create the token here: https://supabase.com/dashboard/account/tokens > > <img alt="Image" width="1341" height="400" src="https://private-user-images.githubusercontent.com/53354136/531778143-6bc907dc-f977-428a-af6e-7538b7648b1e.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Njc2MDE4MDQsIm5iZiI6MTc2NzYwMTUwNCwicGF0aCI6Ii81MzM1NDEzNi81MzE3NzgxNDMtNmJjOTA3ZGMtZjk3Ny00MjhhLWFmNmUtNzUzOGI3NjQ4YjFlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAxMDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMTA1VDA4MjUwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU4YjlmZTVmZDU0MDYyOWIyNjFjY2Q5OGJjMWY0Y2Y5ZTBjM2JkMTFlMWVjY2EwMjE4OGFlM2ZkMjY5YmRmZjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.UvC8AIrK_LbZgsLoxBmD0lukePy0dZnQfmpdv7v203Y"> This does not work for me - i get ``` WWW-Authenticate: Bearer error="invalid_request", error_description="No access token was provided in this request", resource_metadata="https://mcp.supabase.com/.well-known/oauth-protected-resource/mcp" ``` even though the token is clearly there.
Author
Owner

@proflivio commented on GitHub (Jan 5, 2026):

@cravenceiling Yeah, it connects today with the token, yesterday it didn't. Nevertheless, the debug output remains the same as yesterday, with an addition of a Client ID.

┌  MCP OAuth Debug
│
●  Server: supabase
│
●  URL: https://mcp.supabase.com/mcp?project_ref=[project]
│
●  Auth status: ○ not authenticated
│
●    Client ID: [some uuid]
│
◇  HTTP response: 401 Unauthorized
│
●  WWW-Authenticate: Bearer error="invalid_request", error_description="No access token was provided in this request", resource_metadata="https://mcp.supabase.com/.well-known/oauth-protected-resource/mcp?project_ref=[project]"
│
▲  Server returned 401 Unauthorized
│
●  Testing OAuth flow (without completing authorization)...
│
■  Connection error: Dynamic client registration failed: HTTP 404
│
└  Debug complete

Edit:
MCP connection works in my empty test dir, not in the project folder where I really need it. Go figure...

@proflivio commented on GitHub (Jan 5, 2026): @cravenceiling Yeah, it connects today with the token, yesterday it didn't. Nevertheless, the debug output remains the same as yesterday, with an addition of a `Client ID`. ``` ┌ MCP OAuth Debug │ ● Server: supabase │ ● URL: https://mcp.supabase.com/mcp?project_ref=[project] │ ● Auth status: ○ not authenticated │ ● Client ID: [some uuid] │ ◇ HTTP response: 401 Unauthorized │ ● WWW-Authenticate: Bearer error="invalid_request", error_description="No access token was provided in this request", resource_metadata="https://mcp.supabase.com/.well-known/oauth-protected-resource/mcp?project_ref=[project]" │ ▲ Server returned 401 Unauthorized │ ● Testing OAuth flow (without completing authorization)... │ ■ Connection error: Dynamic client registration failed: HTTP 404 │ └ Debug complete ``` **Edit:** MCP connection works in my empty test dir, not in the project folder where I really need it. Go figure...
Author
Owner

@bluet commented on GitHub (Jan 6, 2026):

This works for me (after lots of tries).
Please note that this will allow the mcp to have access to ALL projects.

    "mcp": {
        "supabase": {
            "type": "remote",
            "url": "https://mcp.supabase.com/mcp",
            "headers": {
                "Authorization": "Bearer sbp_token"
            },
            "enabled": true
        },
    }
@bluet commented on GitHub (Jan 6, 2026): This works for me (after lots of tries). Please note that this will allow the mcp to have access to ALL projects. ``` "mcp": { "supabase": { "type": "remote", "url": "https://mcp.supabase.com/mcp", "headers": { "Authorization": "Bearer sbp_token" }, "enabled": true }, } ```
Author
Owner

@andreapiso commented on GitHub (Jan 6, 2026):

This works for me (after lots of tries). Please note that this will allow the mcp to have access to ALL projects.

    "mcp": {
        "supabase": {
            "type": "remote",
            "url": "https://mcp.supabase.com/mcp",
            "headers": {
                "Authorization": "Bearer sbp_token"
            },
            "enabled": true
        },
    }

This still does not work for me

┌  MCP OAuth Debug
│
●  Server: supabase
│
●  URL: https://mcp.supabase.com/mcp
│
●  Auth status: ○ not authenticated
│
◇  HTTP response: 401 Unauthorized
│
●  WWW-Authenticate: Bearer error="invalid_request", error_description="No access token was provided in this request", resource_metadata="https://mcp.supabase.com/.well-known/oauth-protected-resource/mcp"
│
▲  Server returned 401 Unauthorized
│
●  Testing OAuth flow (without completing authorization)...
│
■  Connection error: Dynamic client registration failed: HTTP 404
│
└  Debug complete
@andreapiso commented on GitHub (Jan 6, 2026): > This works for me (after lots of tries). Please note that this will allow the mcp to have access to ALL projects. > > ``` > "mcp": { > "supabase": { > "type": "remote", > "url": "https://mcp.supabase.com/mcp", > "headers": { > "Authorization": "Bearer sbp_token" > }, > "enabled": true > }, > } > ``` This still does not work for me ``` ┌ MCP OAuth Debug │ ● Server: supabase │ ● URL: https://mcp.supabase.com/mcp │ ● Auth status: ○ not authenticated │ ◇ HTTP response: 401 Unauthorized │ ● WWW-Authenticate: Bearer error="invalid_request", error_description="No access token was provided in this request", resource_metadata="https://mcp.supabase.com/.well-known/oauth-protected-resource/mcp" │ ▲ Server returned 401 Unauthorized │ ● Testing OAuth flow (without completing authorization)... │ ■ Connection error: Dynamic client registration failed: HTTP 404 │ └ Debug complete ```
Author
Owner

@SalamanderXing commented on GitHub (Jan 7, 2026):

Having the same issue. Using the token made it work.. but it's a hack.

@SalamanderXing commented on GitHub (Jan 7, 2026): Having the same issue. Using the token made it work.. but it's a hack.
Author
Owner

@vuon9 commented on GitHub (Jan 22, 2026):

I got the same issue when I tried opencode mcp debug github, but actually the MCP works!

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "opencode-google-antigravity-auth"
  ],
  "mcp": {
    "github": {    
      "type": "remote",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer TOKEN"
      },
      "enabled": true
    }
  }
}

Removing enabled doesn't help to solve the issue on the debug feature.

❯ opencode mcp debug github

┌  MCP OAuth Debug
│
●  Server: github
│
●  URL: https://api.githubcopilot.com/mcp/
│
●  Auth status: ✗ not authenticated
│
◇  HTTP response: 401 Unauthorized
│
●  WWW-Authenticate: Bearer error="invalid_request", error_description="No access token was provided in this request", resource_metadata="https://api.githubcopilot.com/.well-known/oauth-protected-resource/mcp/"
│
▲  Server returned 401 Unauthorized
│
●  Testing OAuth flow (without completing authorization)...
│
■  Connection error: Incompatible auth server: does not support dynamic client registration
│
└  Debug complete
@vuon9 commented on GitHub (Jan 22, 2026): I got the same issue when I tried `opencode mcp debug github`, but actually the MCP works! ``` { "$schema": "https://opencode.ai/config.json", "plugin": [ "opencode-google-antigravity-auth" ], "mcp": { "github": { "type": "remote", "url": "https://api.githubcopilot.com/mcp/", "headers": { "Authorization": "Bearer TOKEN" }, "enabled": true } } } ``` Removing enabled doesn't help to solve the issue on the debug feature. ``` ❯ opencode mcp debug github ┌ MCP OAuth Debug │ ● Server: github │ ● URL: https://api.githubcopilot.com/mcp/ │ ● Auth status: ✗ not authenticated │ ◇ HTTP response: 401 Unauthorized │ ● WWW-Authenticate: Bearer error="invalid_request", error_description="No access token was provided in this request", resource_metadata="https://api.githubcopilot.com/.well-known/oauth-protected-resource/mcp/" │ ▲ Server returned 401 Unauthorized │ ● Testing OAuth flow (without completing authorization)... │ ■ Connection error: Incompatible auth server: does not support dynamic client registration │ └ Debug complete ```
Author
Owner

@xxvv commented on GitHub (Jan 22, 2026):

I switched to git bash to run opencode mcp auth supabase, and it works properly.

@xxvv commented on GitHub (Jan 22, 2026): I switched to `git bash` to run opencode mcp auth supabase, and it works properly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4169