Getting "Cursor MCP Client Closed" error after integrating Supabase


Hey Cursor community! :waving_hand:

I’m currently integrating Supabase as the Main Cloud Provider (MCP) in my Cursor AI project built with React Native (Expo) + Yarn.

I’ve set up Supabase correctly, using the @supabase/supabase-js v2 client, and I’m importing it through a singleton file (supabaseClient.ts). However, I keep getting this error in Cursor:

javascript

CopyEdit

MCP Error: Supabase client closed

Here’s what I’ve done so far:

  • Created a singleton Supabase client using createClient.
  • Imported it only once in lib/supabaseClient.ts.
  • Hooked it into an AuthContext to track user state and auth.
  • Using Expo + Yarn (React Native) in Cursor.

What I need help with:

  • Why is Cursor MCP showing the “client closed” error?
  • Is there something specific about Cursor’s MCP architecture that closes or resets the Supabase client?
  • How can I permanently persist the client and avoid reinitializing?
  • Should I manage Supabase outside of MCP, or is there a Cursor-specific pattern to follow?

Would appreciate any help, tips, or working examples! :folded_hands:

I have the same problem, but with @alexander-zuev mcp

Hi there, i recall there were other threads specific to supabase already discussed with same issue, could you have a look there? Try the forum search with MCP Client Closed Supabase.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.