PostgREST
@supabase/mcp-server-postgrest
これはPostgREST用のMCPサーバーです。LLMがREST API経由でアプリのCRUD操作を実行できるようになります。
このサーバーは、Supabase プロジェクト (PostgREST を実行) および任意のスタンドアロン PostgREST サーバーで動作します。
ツール
利用可能なツールは次のとおりです。
postgrestRequest
設定されたPostgRESTサーバーへのHTTPリクエストを実行します。以下の引数を受け入れます。
method: 使用するHTTPメソッド(例:GET、POST、PATCH、DELETE)path: クエリするパス (例:/todos?id=eq.1)body: リクエスト本体(POSTおよびPATCHリクエストの場合)
GETリクエストの選択された行と、 POSTおよびPATCHリクエストの更新された行を含む、PostgREST サーバーからの JSON 応答を返します。
sqlToRest
SQLクエリを、メソッドとパスとして同等のPostgREST構文に変換します。LLMでは有効なPostgREST構文への変換が困難な複雑なクエリに役立ちます。
PostgRESTはSQLのサブセットのみをサポートしているため、すべてのクエリが変換されるわけではないことに注意してください。詳細についてはsql-to-restをご覧ください。
次の引数を受け入れます:
sql: 変換する SQL クエリ。
リクエストのmethodとpathプロパティを含むオブジェクトを返します。LLMはpostgrestRequestツールを使用してリクエストを実行できます。
Related MCP server: postgresql-mcp
使用法
クロード・デスクトップ
Claude Desktopは、モデルコンテキストプロトコルをサポートする人気のLLMクライアントです。PostgRESTサーバーをClaude Desktopに接続することで、自然言語コマンドを使ってデータベースにクエリを実行できます。
次の設定ファイルを使用して、Claude Desktop に MCP サーバーを追加できます。
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Supabase プロジェクト*(または任意の PostgREST サーバー)*を Claude Desktop に追加するには、構成ファイルのmcpServersオブジェクトに次の構成を追加します。
{
"mcpServers": {
"todos": {
"command": "npx",
"args": [
"-y",
"@supabase/mcp-server-postgrest@latest",
"--apiUrl",
"https://your-project-ref.supabase.co/rest/v1",
"--apiKey",
"your-anon-key",
"--schema",
"public"
]
}
}
}構成
apiUrl: PostgRESTエンドポイントのベースURLapiKey: 認証用のAPIキー*(オプション)*schema: APIを提供するPostgresスキーマ(例:public)。public以外のスキーマは、PostgRESTから手動で公開する必要があることに注意してください。
プログラムで(カスタム MCP クライアント)
独自のMCPクライアントを構築する場合は、お好みのトランスポートを使用してプログラム的にPostgRESTサーバーに接続できます。MCP SDKには、組み込みのstdioおよびSSEトランスポートが用意されています。また、メモリ内でMCPサーバーに直接接続したり、独自のストリームベースのトランスポートを介して接続したりしたい場合は、 StreamTransportもご利用いただけます。
インストール
npm i @supabase/mcp-server-postgrestyarn add @supabase/mcp-server-postgrestpnpm add @supabase/mcp-server-postgrest例
次の例では、 StreamTransportを使用して MCP クライアントとサーバー間を直接接続します。
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StreamTransport } from '@supabase/mcp-utils';
import { createPostgrestMcpServer } from '@supabase/mcp-server-postgrest';
// Create a stream transport for both client and server
const clientTransport = new StreamTransport();
const serverTransport = new StreamTransport();
// Connect the streams together
clientTransport.readable.pipeTo(serverTransport.writable);
serverTransport.readable.pipeTo(clientTransport.writable);
const client = new Client(
{
name: 'MyClient',
version: '0.1.0',
},
{
capabilities: {},
}
);
const supabaseUrl = 'https://your-project-ref.supabase.co'; // http://127.0.0.1:54321 for local
const apiKey = 'your-anon-key'; // or service role, or user JWT
const schema = 'public'; // or any other exposed schema
const server = createPostgrestMcpServer({
apiUrl: `${supabaseUrl}/rest/v1`,
apiKey,
schema,
});
// Connect the client and server to their respective transports
await server.connect(serverTransport);
await client.connect(clientTransport);
// Call tools, etc
const output = await client.callTool({
name: 'postgrestRequest',
arguments: {
method: 'GET',
path: '/todos',
},
});This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceThis server enables interaction with Supabase PostgreSQL databases through the MCP protocol, allowing seamless integration with Cursor and Windsurf IDEs for secure and validated database management.12830Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA general-purpose PostgreSQL MCP server with full read-write SQL access, atomic multi-statement transactions, and schema inspection. Works with any PostgreSQL instance — local, Supabase, AWS RDS, or self-hosted — and connects to Claude, Cursor, Windsurf, or any MCP-compatible AI client.1042ISC
- AlicenseNot gradedqualityFmaintenanceMCP server for self-hosted Supabase with RLS-aware PostgreSQL and PostgREST layers, enabling safe database introspection, SQL queries, and PostgREST access via natural language.MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Supabase database and storage operations, enabling querying, inserting, updating, deleting rows, schema introspection, and file storage management.16MIT
Related MCP Connectors
MCP server for managing Prisma Postgres.
Butterbase MCP server — manage your backend: schemas, auth, functions, storage, RAG, deploys.
A basic MCP server to operate on the Postman API.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/supabase/mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server