
Supabase-MCPServer
3 years
Works with Finder
0
Github Watches
0
Github Forks
0
Github Stars
Supabase MCP Server
This project implements a Model Context Protocol (MCP) server that provides tools for interacting with a Supabase database. The server enables AI assistants to perform database operations through a standardized interface.
Setup
-
Clone the repository:
git clone <repository_url> cd <repository_name>
-
Install the dependencies:
pip install -r requirements.txt
-
The server now accepts Supabase credentials from client requests instead of requiring environment variables. Clients should provide these in their request:
{
"supabase_url": "your_supabase_url",
"supabase_key": "your_supabase_service_role_key",
"tool": "create_table",
"arguments": {
"table_name": "users",
"schema": [
{"name": "id", "type": "SERIAL PRIMARY KEY"},
{"name": "name", "type": "TEXT"}
]
}
}
Docker
-
Build the Docker container:
docker build -t mcp-server .
-
Run the container:
docker run -p 8000:8000 mcp-server
This will build an image named
mcp-server
and then run it, mapping port 8000 on your host to port 8000 in the container.
GitHub Repository
To push the files to a GitHub repository, follow these steps:
-
Initialize a Git repository in the current directory:
git init
-
Add all the files to the staging area:
git add .
-
Commit the changes:
git commit -m "Initial commit"
-
Rename the branch to main:
git branch -M main
-
Add the remote repository:
git remote add origin https://github.com/amraly83/supabase-mcp-server.git
-
Push the files to the repository:
git push -u origin main
You may be prompted for your GitHub username and password. If you have 2FA enabled, you'll need to use a personal access token instead of your password.
Usage
The server provides the following tools:
-
read_rows(table_name: str = None, limit: int = 10)
: Reads rows from a Supabase table.-
table_name
: The name of the table to read from. This is an optional parameter. If no table name is provided, it will return rows from all tables. -
limit
: The maximum number of rows to return. Defaults to 10. This is an optional parameter.
-
-
create_record(table_name: str, record: dict)
: Creates a new record in a Supabase table.-
table_name
: The name of the table to create the record in. -
record
: A dictionary containing the data for the new record.
-
-
update_record(table_name: str, record_id: int, updates: dict)
: Updates an existing record in a Supabase table.-
table_name
: The name of the table to update the record in. -
record_id
: The ID of the record to update. -
updates
: A dictionary containing the updates to apply to the record.
-
-
delete_record(table_name: str, record_id: int)
: Deletes a record from a Supabase table.-
table_name
: The name of the table to delete the record from. -
record_id
: The ID of the record to delete.
-
-
list_tables()
: Lists all tables in the Supabase database. -
create_table(table_name: str, schema: list)
: Creates a new table in the Supabase database.-
table_name
: The name of the table to create. -
schema
: A list of dictionaries, where each dictionary represents a column in the table. Each dictionary must have the keys "name" and "type".
-
Example
To use the server, you can send JSON requests to the server's standard input. For example, to read the first 5 rows from a table named "products", you would send the following JSON:
{
"supabase_url": "your_supabase_url",
"supabase_key": "your_supabase_service_role_key",
"tool": "read_rows",
"arguments": {
"table_name": "products",
"limit": 5
}
}
To list all tables in the Supabase database, you would send the following JSON:
{
"supabase_url": "your_supabase_url",
"supabase_key": "your_supabase_service_role_key",
"tool": "list_tables",
"arguments": {}
}
To create a new table named "users" with columns "id" (SERIAL PRIMARY KEY) and "name" (TEXT), you would send the following JSON:
{
"supabase_url": "your_supabase_url",
"supabase_key": "your_supabase_service_role_key",
"tool": "create_table",
"arguments": {
"table_name": "users",
"schema": [
{"name": "id", "type": "SERIAL PRIMARY KEY"},
{"name": "name", "type": "TEXT"}
]
}
}
相关推荐
🔥 1Panel bietet eine intuitive Weboberfläche und einen MCP -Server, um Websites, Dateien, Container, Datenbanken und LLMs auf einem Linux -Server zu verwalten.
🧑🚀 全世界最好的 llm 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Zusammenfassung der weltbesten LLM -Ressourcen.
PDF wissenschaftliche Papierübersetzung mit erhaltenen Formaten - 基于 ai 完整保留排版的 pdf 文档全文双语翻译 , 支持 支持 支持 支持 google/deeptl/ollama/openai 等服务 提供 cli/gui/mcp/docker/zotero
⛓️Rugele ist ein leichter, leistungsstarker, leistungsstarker, eingebetteter Komponenten-Orchestrierungsregel-Motor-Rahmen für GO.
Erstellen Sie einfach LLM -Tools und -Argarten mit einfachen Bash/JavaScript/Python -Funktionen.
😎简单易用、🧩丰富生态 - 大模型原生即时通信机器人平台 | 适配 qq / 微信(企业微信、个人微信) / 飞书 / 钉钉 / diskord / telegram / slack 等平台 | 支持 Chatgpt 、 Deepseek 、 Diffy 、 Claude 、 Gemini 、 xai 、 ppio 、 、 ulama 、 lm Studio 、阿里云百炼、火山方舟、 siliconflow 、 qwen 、 mondshot 、 chatglm 、 sillytraven 、 mcp 等 llm 的机器人 / agent | LLM-basierte Instant Messaging Bots-Plattform, unterstützt Zwietracht, Telegramm, Wechat, Lark, Dingtalk, QQ, Slack
Reviews

user_ygLckTOf
I've been using Supabase-MCPServer from amraly83 and it's been a game-changer for my applications. The setup was straightforward and the performance has been impressive. Highly recommend for anyone needing a reliable and efficient MCP solution!

user_x8BgddA9
As a dedicated MCP application user, I can confidently say that the Supabase-MCPserver by amraly83 is a game-changer. It integrates seamlessly and offers exceptional performance. The user-friendly interface and robust features make it an indispensable tool for any project. Highly recommend!

user_PvaFjbYt
As a devoted user of MCP applications, I find supabase-mcpserver by amraly83 indispensable. Its robust functionality and seamless integration make data management a breeze. Highly recommend this efficient tool for anyone looking to streamline their workflow and enhance productivity.