Skip to content
Back to search

supabase-mcp

Supabase MCP server created in Python.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/coleam00--supabase-mcp/badge.svg)](/listings/coleam00--supabase-mcp)

HTML

<a href="/listings/coleam00--supabase-mcp"><img src="/api/listings/coleam00--supabase-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

1. Clone the repository:

   git clone https://github.com/coleam00/supabase-mcp.git
   cd supabase-mcp

Docker Setup

1. Build the Docker image:

   docker build -t mcp/supabase .

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 231 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Supabase MCP Server
  2. A Model Context Protocol (MCP) server that provides tools for interacting with a Supabase database. This server enables AI assistants to perform database operations through a standardized interface.
  3. NOTE: This Supabase MCP server was created as a demonstration of my AI IDE coding workflow. It is still a work in progress which I will expand on in future videos on [my channel](https://youtube.com/@ColeMedin).
  4. ## Features
  5. - **Read Table Rows**: Query data from Supabase tables with optional filtering, pagination, and column selection
  6. - **Create Table Records**: Insert new records into Supabase tables
  7. - **Update Table Records**: Modify existing records in Supabase tables based on filters
  8. - **Delete Table Records**: Remove records from Supabase tables based on filters
  9. ## Prerequisites
  10. - Docker or Docker Desktop
  11. - Supabase account and project
  12. ## Installation
  13. 1. Clone the repository:
  14. ```bash
  15. git clone https://github.com/coleam00/supabase-mcp.git
  16. cd supabase-mcp
  17. ```
  18. ### Docker Setup
  19. 1. Build the Docker image:
  20. ```bash
  21. docker build -t mcp/supabase .
  22. ```
  23. ## Usage
  24. ### Running as an MCP Server with Docker
  25. The Supabase MCP server can be integrated with AI assistants using the Model Context Protocol.
  26. 1. Include the below configuration in your MCP config (in Claude Desktop, Windsurf, etc.)
  27. Be sure to build the container with the installation steps first!
  28. ```json
  29. {
  30. "mcpServers": {
  31. "supabase": {
  32. "command": "docker",
  33. "args": ["run", "--rm", "-i", "-e", "SUPABASE_URL", "-e", "SUPABASE_SERVICE_KEY", "mcp/supabase"],
  34. "env": {
  35. "SUPABASE_URL": "YOUR-SUPABASE-URL",
  36. "SUPABASE_SERVICE_KEY": "YOUR-SUPABASE-SERVICE-ROLE-KEY"
  37. }
  38. }
  39. }
  40. }
  41. ```
  42. 2. Replace `YOUR-SUPABASE-URL` and `YOUR-SUPABASE-SERVICE-ROLE-KEY` with your actual Supabase credentials.
  43. 3. The AI assistant can now access the Supabase database through the MCP server using the provided tools.
  44. For more information on the Model Context Protocol, visit [modelcontextprotocol.io](https://modelcontextprotocol.io).
  45. ### Available Tools
  46. #### Read Table Rows
  47. ```python
  48. read_table_rows(
  49. table_name: str,
  50. columns: Optional[List[str]] = None,
  51. filters: Optional[Dict[str, Any]] = None,
  52. limit: Optional[int] = None,
  53. offset: Optional[int] = None
  54. )
  55. ```
  56. Example:
  57. ```python
  58. # Read active users
  59. read_table_rows(
  60. table_name="users",
  61. columns=["id", "name", "email"],
  62. filters={"is_active": True},
  63. limit=10,
  64. offset=0
  65. )
  66. ```
  67. #### Create Table Records
  68. ```python
  69. create_table_records(
  70. table_name: str,
  71. records: Union[Dict[str, Any], List[Dict[str, Any]]]
  72. )
  73. ```
  74. Example:
  75. ```python
  76. # Create a new user
  77. create_table_records(
  78. table_name="users",
  79. records={
  80. "name": "John Doe",
  81. "email": "john@example.com",
  82. "is_active": True
  83. }
  84. )
  85. ```
  86. #### Update Table Records
  87. ```python
  88. update_table_records(
  89. table_name: str,
  90. updates: Dict[str, Any],
  91. filters: Dict[str, Any]
  92. )
  93. ```
  94. Example:
  95. ```python
  96. # Update user status
  97. update_table_records(
  98. table_name="users",
  99. updates={"status": "premium"},
  100. filters={"is_active": True}
  101. )
  102. ```
  103. #### Delete Table Records
  104. ```python
  105. delete_table_records(
  106. table_name: str,
  107. filters: Dict[str, Any]
  108. )
  109. ```
  110. Example:
  111. ```python
  112. # Delete inactive users
  113. delete_table_records(
  114. table_name="users",
  115. filters={"is_active": False}
  116. )
  117. ```
  118. ## Development
  119. ### Project Structure
  120. ```
  121. supabase-mcp/
  122. ├── supabase_mcp/
  123. │ ├── __init__.py
  124. │ ├── server.py # Main MCP server implementation
  125. │ └── tests/ # Unit tests
  126. ├── Dockerfile # Docker configuration for MCP server
  127. ├── example_mcp_config.json # Example MCP configuration
  128. ├── requirements.txt # Python dependencies
  129. ├── .env.example # Example environment variables
  130. ├── README.md # Project documentation
  131. ├── PLANNING.md # Project planning
  132. └── TASKS.md # Task tracking
  133. ```
  134. ### Running Tests
  135. ```bash
  136. pytest supabase_mcp/tests/
  137. ```
  138. ## Model Context Protocol Integration
  139. The Supabase MCP server implements the [Model Context Protocol](https://modelcontextprotocol.io), which allows AI assistants to interact with Supabase databases in a standardized way.
  140. ### How It Works
  141. 1. The MCP server exposes tools for database operations (read, create, update, delete)
  142. 2. AI assistants connect to the MCP server using the stdio transport
  143. 3. The AI assistant can invoke the tools to perform database operations
  144. 4. The MCP server handles the communication with Supabase and returns the results
  145. ### MCP Configuration
  146. The `example_mcp_config.json` file shows how to configure an AI assistant to use the Supabase MCP server:
  147. ```json
  148. {
  149. "mcpServers": {
  150. "supabase": {
  151. "command": "docker",
  152. "args": ["run", "--rm", "-i", "-e", "SUPABASE_URL", "-e", "SUPABASE_SERVICE_KEY", "mcp/supabase"],
  153. "env": {
  154. "SUPABASE_URL": "YOUR-SUPABASE-URL",
  155. "SUPABASE_SERVICE_KEY": "YOUR-SUPABASE-SERVICE-ROLE-KEY"
  156. }
  157. }
  158. }
  159. }
  160. ```
  161. This configuration tells the AI assistant:
  162. - To use Docker to run the MCP server
  163. - To pass the Supabase credentials as environment variables
  164. - To use the `mcp/supabase` Docker image
  165. ### Using with AI Assistants
  166. AI assistants that support the Model Context Protocol can use this server to:
  167. 1. Query data from Supabase tables
  168. 2. Insert new records into tables
  169. 3. Update existing records
  170. 4. Delete records
  171. The assistant will have access to the tools documented in the "Available Tools" section above.
  172. ## Environment Variables
  173. | Variable | Description |
  174. |----------|-------------|
  175. | `SUPABASE_URL` | URL of your Supabase project |
  176. | `SUPABASE_SERVICE_KEY` | Service role key for Supabase authentication |
  177. ## License
  178. This project is licensed under the MIT License - see the LICENSE file for details.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.