Supabase MCP repeatedly requires reauthentication: OAuth token refresh failed during initialize

Open 💬 11 comments Opened Mar 7, 2026 by markussmueller
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.111.0

What subscription do you have?

Unknown

Which model were you using?

Unknown

What platform is your computer?

Darwin 25.3.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Ghostty

What issue are you seeing?

My Supabase MCP integration seems to require reauthentication repeatedly.

After previously authenticating Supabase MCP, Codex sometimes starts with this error instead of refreshing the existing auth session:

⚠ MCP client for `supabase` failed to start: MCP startup failed: handshaking with MCP server
  failed: Send message error Transport
  [rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttp
  ClientWorker<rmcp::transport::auth::AuthClient<reqwest::async_impl::client::Client>>>] error:
  Auth error: OAuth token refresh failed: Failed to parse server response, when send initialize
  request

⚠ MCP startup incomplete (failed: supabase)

The practical result is that I have to authenticate Supabase again and again, even though the expected behavior seems to be token refresh or stable session reuse.

What steps can reproduce the bug?

  1. Configure the Supabase MCP server in Codex CLI and authenticate it successfully.
  2. Use Codex normally for some time, or return in a later session after the auth/token has aged.
  3. Start Codex again.
  4. Observe that Supabase MCP sometimes fails during startup with the refresh/initialize error above.
  5. Reauthenticate Supabase MCP to get it working again, until the cycle repeats.

I have not pinned down a minimal deterministic repro beyond the repeated pattern above.

What is the expected behavior?

If the stored auth session is still refreshable, Codex should refresh it successfully and start the Supabase MCP server without manual intervention.

If the auth session is invalid, Codex should report that clearly rather than failing during MCP initialize with a parse error.

Additional information

This looks related to the broader MCP OAuth / handshake issues that have been reported before, but I could not find an existing issue with this exact Supabase error string.

Potentially related reports:

  • #5254
  • #6020
  • #6572
  • #9535
  • #11297

The key detail here is the combination of:

  • Supabase MCP
  • repeated reauthentication requirement
  • OAuth token refresh failed
  • Failed to parse server response
  • failure while sending the MCP initialize request

If maintainers want, I can provide more environment details or try with additional logging enabled.

View original on GitHub ↗

11 Comments

github-actions[bot] contributor · 4 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #12285
  • #13766

Powered by Codex Action

markussmueller · 4 months ago

I reviewed the bot suggestions and I don't think either is a true duplicate:

  • #12285 was a Snowflake streamable_http initialize/response-decoding issue using a PAT, and it was closed in favor of #11284 (Cannot initialize Streamable HTTP MCP servers). That looks like a broader transport compatibility problem, but not specifically an OAuth refresh / repeated reauthentication failure.
  • #13766 is a local Dart MCP server handshake timeout on stdio. Different transport and different failure mode.

This issue is specifically about Supabase MCP auth refresh failing during startup:

Auth error: OAuth token refresh failed: Failed to parse server response, when send initialize request

The distinctive behavior here is that Supabase appears to require repeated manual reauthentication instead of refreshing the stored auth session.

So there may be some shared initialize/handshake surface area, but I don't think this should be closed as a duplicate of either suggested issue.

markussmueller · 4 months ago

Additional data point: I previously contacted Supabase support about this, and they indicated they believe this is on the Codex side rather than the Supabase side.

They specifically pointed me to #6020 as a related Codex MCP startup/handshake issue affecting other MCP servers as well.

I still don't think this issue is a strict duplicate of #6020, because the observable failure here is specifically:

Auth error: OAuth token refresh failed: Failed to parse server response, when send initialize request

and the user-facing behavior is repeated manual reauthentication for Supabase.

But this does seem like more evidence that the root cause may live in the Codex MCP client / rmcp auth+initialize path rather than in Supabase alone.

thedaviddias · 4 months ago

Faced the issue today where:

  • /mcp shows that Supabase MCP is enabled
  • but Codex says "OAuth token refresh failed: Failed to parse server response"
  • restarting, enabling/disabling the supabase MCP in the settings didn't trigger the auth window

Compared to other tools like Claude Code, the experience is really not great. Codex should trigger opening the auth page if the token needs to be refreshed.

gabrieuz · 4 months ago

codex mcp login supabase solve the problem to me.

venkat0304 · 2 months ago

I am running below command every other day to authenticate with supabase. But, on claude code i connected like a 2 months back and its still working. Wondering how to make the connection work without breaking.

codex mcp login supabase

ID 019e0e56-91e1-7932-ab6c-2953ce75cee6

alexgshaw · 2 months ago

Also running into this issue

jmo-sg · 2 months ago

This issue affects me and I use both Codex and Claude. I often have to restart Codex after manual reauthentication which is a real time waster. Claude does not suffer this issue.

Starvingg · 1 month ago

Any update on this issue? The MCP Server connection is buggy. Sometimes it works if explicitly asked. But if Codex gives me a plan with Supabase as a consideration, it should run the Migration file that was created.

jcarioti · 1 month ago

Still having this same issue with multiple OAuth MCP servers, not just Supabase.

Codex is simply not handling OAuth refresh properly. Seems pretty clear from all of the related reports.

zeevenn · 4 days ago

some issue