Windsurf Supabase MCP Server

Windsurf Supabase MCP Server

A Model Context Protocol server optimized for integrating Supabase with the Windsurf Editor, providing database interactions through natural language with enhanced error handling and response formatting.

hertzfelt

Databases
Developer Tools
Search
TypeScript
Visit Server

README

Windsurf Supabase MCP Server

A Windsurf-optimized MCP server for Supabase integration

This repository contains a Windsurf-optimized version of the Supabase MCP server, specifically enhanced to work seamlessly with the Windsurf Editor. It builds upon the Model Context Protocol (MCP) standard, adding crucial improvements for better error handling, response formatting, and SQL query processing.

Key Modifications for Windsurf

1. Enhanced Error Handling

We faced several challenges with the original error handling system:

  • Malformed SQL queries would cause silent failures
  • Stream parsing errors were difficult to debug
  • Error messages weren't LLM-friendly

Our solutions:

  • Added structured error responses with detailed context
  • Improved error messages for better LLM understanding
  • Added validation for SQL query structure
  • Enhanced stream error detection and recovery

2. Response Formatting

The original response format had limitations:

  • Inconsistent JSON structure across different response types
  • Missing metadata for UI components
  • Limited type safety

Our improvements:

  • Standardized JSON response format
  • Added metadata for UI component generation
  • Implemented strict TypeScript types
  • Added support for streaming complex data structures

3. SQL to REST Conversion

We enhanced the SQL to REST conversion:

  • Added support for more complex SQL operations
  • Improved query validation
  • Better handling of JOINs and subqueries
  • Enhanced error messages for invalid SQL

4. Authentication & Headers

Key improvements in authentication handling:

  • Flexible API key management
  • Support for bearer token authentication
  • Better header management for PostgREST requests
  • Enhanced security validation

Integration with Windsurf

This MCP server is specifically designed to work with the Windsurf Editor, providing:

  • Seamless database interactions through natural language
  • Real-time query validation and correction
  • Enhanced error messages for better debugging
  • Optimized response formatting for UI components

Example Usage in Windsurf

// Example of enhanced response handling
const response = await postgrestRequest({
  method: 'GET',
  path: '/todos?is_completed=eq.false',
});

// Response includes metadata for UI components
const { data, metadata } = response;

Installation

  1. Clone this repository:
git clone https://github.com/hertzfelt/windsurf-supabase-mcp.git
  1. Install dependencies:
npm install
  1. Configure your Supabase connection:
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key

Usage with Windsurf

This server provides two main tools:

  1. postgrestRequest: Enhanced PostgREST API access
const result = await postgrestRequest({
  method: 'GET',
  path: '/users',
});
  1. sqlToRest: Improved SQL to REST conversion
const query = 'SELECT * FROM users WHERE age > 18';
const { method, path } = await sqlToRest({ sql: query });

Contributing

Contributions are welcome! Please read our Contributing Guidelines for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Playwright MCP Server

Playwright MCP Server

Provides a server utilizing Model Context Protocol to enable human-like browser automation with Playwright, allowing control over browser actions such as navigation, element interaction, and scrolling.

Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript