{"_id":"@supabase/mcp-server-postgrest","_rev":"11-1fdaf1b5734afa4ed60f1dc36d4cb078","name":"@supabase/mcp-server-postgrest","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@supabase/mcp-server-postgrest","version":"0.1.0","license":"MIT","_id":"@supabase/mcp-server-postgrest@0.1.0","maintainers":[{"name":"etienne_supa","email":"etienne@supabase.io"},{"name":"kiwicopple","email":"pcopplestone@gmail.com"},{"name":"ange1ico","email":"angelico.delosreyes@gmail.com"},{"name":"awalias","email":"antwilson@hotmail.co.uk"},{"name":"gregnr","email":"greg.nmr@gmail.com"},{"name":"phamhieu1998","email":"phamhieu1998@gmail.com"},{"name":"inian","email":"inian1234@gmail.com"},{"name":"stdim","email":"sdimitrovski@gmail.com"},{"name":"ziinc_supabase","email":"tzeyiing@supabase.com"},{"name":"kamilogorek","email":"kamil.ogorek@gmail.com"},{"name":"lakshan-supabase","email":"lakshan@supabase.io"},{"name":"soedirgo","email":"bobbie@soedirgo.dev"},{"name":"ceeteelam","email":"charisxl@gmail.com"}],"bin":{"mcp-server-postgrest":"dist/stdio.js"},"dist":{"shasum":"d763221ace180f71aca61d88a395382c70b6c974","tarball":"https://registry.npmjs.org/@supabase/mcp-server-postgrest/-/mcp-server-postgrest-0.1.0.tgz","fileCount":18,"integrity":"sha512-tHhFQj0ICr2rpp2jvcjAoyvSxksIcHYec0RMOEtW07qXGWlxLiRatTwRIn4A0t9OtKegRD9GIM7+dInhMUfuxw==","signatures":[{"sig":"MEUCICyNyemeqvOcyTtALHC0EtCShzcTGn4zVkNqXwkKSsqIAiEA9OdT1eZdAaRarSKRnCNxPilhJ0ZV6WG6hNiGi400bn4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":36862},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.cjs"}},"gitHead":"d7c6539b8c2b47fbfdee1e90fb3ed1a09c532cfd","scripts":{"test":"vitest","build":"tsup --clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"gregnr","email":"greg.nmr@gmail.com"},"_npmVersion":"10.8.3","description":"MCP server for PostgREST","directories":{},"sideEffects":false,"_nodeVersion":"22.9.0","dependencies":{"zod":"^3.24.1","zod-to-json-schema":"^3.24.1","@supabase/sql-to-rest":"^0.1.6","@modelcontextprotocol/sdk":"^1.0.4"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","vitest":"^2.1.4","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^22.8.6","@supabase/mcp-utils":"*","@total-typescript/tsconfig":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/mcp-server-postgrest_0.1.0_1735936960373_0.26873000596032126","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@supabase/mcp-server-postgrest","version":"0.1.1","license":"Apache-2.0","_id":"@supabase/mcp-server-postgrest@0.1.1","maintainers":[{"name":"gregnr","email":"greg.nmr@gmail.com"},{"name":"mattrossman","email":"matthewjonrossman@gmail.com"}],"homepage":"https://github.com/supabase/mcp#readme","bugs":{"url":"https://github.com/supabase/mcp/issues"},"bin":{"mcp-server-postgrest":"dist/stdio.js"},"dist":{"shasum":"9c69e7a7f1aa8508dfca6490b797425047153a16","tarball":"https://registry.npmjs.org/@supabase/mcp-server-postgrest/-/mcp-server-postgrest-0.1.1.tgz","fileCount":19,"integrity":"sha512-VbhbcGBamJitmwFvd3jEw68e8NnlxN5f/GwqAjghJozymEeja/Nm+eWK+0NkuhmHTLw5Niw+NMyVcZ7fP/fu2Q==","signatures":[{"sig":"MEUCIGDl5oIFD9gFL8vX0Grqr03rlV9KuB6xO6pLajvJamogAiEAuclwKExYZ215S46Oaswc+CmOMN/qI3NinrNs/D+Mcrg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43219},"main":"dist/index.cjs","type":"module","_from":"file:supabase-mcp-server-postgrest-0.1.1.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup --clean","prebuild":"pnpm typecheck","typecheck":"tsc --noEmit"},"_npmUser":{"name":"mattrossman","email":"matthewjonrossman@gmail.com"},"_resolved":"/private/var/folders/t2/943pbf6n4hv1143kv7h7_rbr0000gn/T/98b144fe6b02f638b64b72f9f2d758e1/supabase-mcp-server-postgrest-0.1.1.tgz","_integrity":"sha512-VbhbcGBamJitmwFvd3jEw68e8NnlxN5f/GwqAjghJozymEeja/Nm+eWK+0NkuhmHTLw5Niw+NMyVcZ7fP/fu2Q==","repository":{"url":"git+https://github.com/supabase/mcp.git","type":"git"},"_npmVersion":"11.12.1","description":"MCP server for PostgREST","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","dependencies":{"@supabase/mcp-utils":"^0.5.1","@supabase/sql-to-rest":"^0.1.8"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","zod":"^3.25.0 || ^4.0.0","tsup":"^8.3.5","vitest":"^2.1.9","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^22.8.6","@supabase/auth-js":"^2.67.3","@modelcontextprotocol/sdk":"^1.25.2","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"zod":"^3.25.0 || ^4.0.0","@modelcontextprotocol/sdk":"^1.25.2"},"_npmOperationalInternal":{"tmp":"tmp/mcp-server-postgrest_0.1.1_1780937888729_0.9267448071255773","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@supabase/mcp-server-postgrest","version":"0.2.0","description":"MCP server for PostgREST","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/supabase/mcp.git"},"type":"module","main":"dist/index.cjs","types":"dist/index.d.ts","sideEffects":false,"bin":{"mcp-server-postgrest":"dist/stdio.js"},"exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"dependencies":{"@supabase/sql-to-rest":"^0.1.8","@supabase/mcp-utils":"^0.7.0"},"peerDependencies":{"@modelcontextprotocol/server":"^2.0.0","zod":"^3.25.0 || ^4.0.0"},"devDependencies":{"@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/server":"^2.0.0","@supabase/auth-js":"^2.67.3","@total-typescript/tsconfig":"^1.0.4","@types/node":"^22.8.6","prettier":"^3.3.3","tsup":"^8.3.5","tsx":"^4.19.2","typescript":"^5.6.3","vitest":"^2.1.9","zod":"^3.25.0 || ^4.0.0"},"scripts":{"build":"tsup --clean","dev":"tsup --watch","typecheck":"tsc --noEmit","prebuild":"pnpm typecheck","test":"vitest"},"_id":"@supabase/mcp-server-postgrest@0.2.0","bugs":{"url":"https://github.com/supabase/mcp/issues"},"homepage":"https://github.com/supabase/mcp#readme","_integrity":"sha512-zAP1pxVQe6Byzw1V3ZoKgNaHY1t5SNbTGkSJ0nRM+V+QV42V9jDOBtQ037wfyViSa1plLdaVwMy213dy1NXPhA==","_resolved":"/tmp/9df47462eec880ad1df64f2870af5b6e/supabase-mcp-server-postgrest-0.2.0.tgz","_from":"file:supabase-mcp-server-postgrest-0.2.0.tgz","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-zAP1pxVQe6Byzw1V3ZoKgNaHY1t5SNbTGkSJ0nRM+V+QV42V9jDOBtQ037wfyViSa1plLdaVwMy213dy1NXPhA==","shasum":"b351b3c7174ec43c3587f2b86a78270b92cbfbde","tarball":"https://registry.npmjs.org/@supabase/mcp-server-postgrest/-/mcp-server-postgrest-0.2.0.tgz","fileCount":19,"unpackedSize":41578,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@supabase%2fmcp-server-postgrest@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCeVaZHNJZ6UHjA1kNbfw40xM7xbwpPpTQLNXhtyfr2kwIhAKf7iKIoxxciKpO8CKs4D3CLd3A3xSyff9Kwlv1RQcmX"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fda333b2-720b-4a94-a670-df236c5b3a5c"}},"directories":{},"maintainers":[{"name":"gregnr","email":"greg.nmr@gmail.com"},{"name":"mattrossman","email":"matthewjonrossman@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-server-postgrest_0.2.0_1787232310640_0.8316882855190686"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-03T20:42:40.272Z","modified":"2026-08-20T13:25:11.388Z","0.1.0":"2025-01-03T20:42:40.556Z","0.1.1":"2026-06-08T16:58:08.882Z","0.2.0":"2026-08-20T13:25:10.799Z"},"bugs":{"url":"https://github.com/supabase/mcp/issues"},"license":"Apache-2.0","homepage":"https://github.com/supabase/mcp#readme","repository":{"type":"git","url":"git+https://github.com/supabase/mcp.git"},"description":"MCP server for PostgREST","maintainers":[{"name":"gregnr","email":"greg.nmr@gmail.com"},{"name":"mattrossman","email":"matthewjonrossman@gmail.com"}],"readme":"# @supabase/mcp-server-postgrest\n\nThis is an MCP server for [PostgREST](https://postgrest.org). It allows LLMs to perform CRUD operations on your app via REST API.\n\nThis server works with Supabase projects (which run PostgREST) and any standalone PostgREST server.\n\n## Tools\n\nThe following tools are available:\n\n### `postgrestRequest`\n\nPerforms an HTTP request to a [configured](#usage) PostgREST server. It accepts the following arguments:\n\n- `method`: The HTTP method to use (eg. `GET`, `POST`, `PATCH`, `DELETE`)\n- `path`: The path to query (eg. `/todos?id=eq.1`)\n- `body`: The request body (for `POST` and `PATCH` requests)\n\nIt returns the JSON response from the PostgREST server, including selected rows for `GET` requests and updated rows for `POST` and `PATCH` requests.\n\n### `sqlToRest`\n\nConverts a SQL query to the equivalent PostgREST syntax (as method and path). Useful for complex queries that LLMs would otherwise struggle to convert to valid PostgREST syntax.\n\nNote that PostgREST only supports a subset of SQL, so not all queries will convert. See [`sql-to-rest`](https://github.com/supabase-community/sql-to-rest) for more details.\n\nIt accepts the following arguments:\n\n- `sql`: The SQL query to convert.\n\nIt returns an object containing `method` and `path` properties for the request. LLMs can then use the `postgrestRequest` tool to execute the request.\n\n## Usage\n\n### With Claude Desktop\n\n[Claude Desktop](https://claude.ai/download) is a popular LLM client that supports the Model Context Protocol. You can connect your PostgREST server to Claude Desktop to query your database via natural language commands.\n\nYou can add MCP servers to Claude Desktop via its config file at:\n\n- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`\n\n- Windows:`%APPDATA%\\Claude\\claude_desktop_config.json`\n\nTo add your Supabase project _(or any PostgREST server)_ to Claude Desktop, add the following configuration to the `mcpServers` object in the config file:\n\n```json\n{\n  \"mcpServers\": {\n    \"todos\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"@supabase/mcp-server-postgrest@latest\",\n        \"--apiUrl\",\n        \"https://your-project-ref.supabase.co/rest/v1\",\n        \"--apiKey\",\n        \"your-anon-key\",\n        \"--schema\",\n        \"public\"\n      ]\n    }\n  }\n}\n```\n\n#### Configuration\n\n- `apiUrl`: The base URL of your PostgREST endpoint\n\n- `apiKey`: Your API key for authentication _(optional)_\n\n- `schema`: The Postgres schema to serve the API from (eg. `public`). Note any non-public schemas must be manually exposed from PostgREST.\n\n### Programmatically (custom MCP client)\n\nIf you're building your own MCP client, you can connect to a PostgREST server programmatically using your preferred transport. The [MCP SDK](https://github.com/modelcontextprotocol/typescript-sdk) offers built-in [stdio](https://modelcontextprotocol.io/docs/concepts/transports#standard-input-output-stdio) and [SSE](https://modelcontextprotocol.io/docs/concepts/transports#server-sent-events-sse) transports. We also offer a [`StreamTransport`](../mcp-utils#streamtransport) if you wish to directly connect to MCP servers in-memory or by piping over your own stream-based transport.\n\n#### Installation\n\n```bash\nnpm i @supabase/mcp-server-postgrest\n```\n\n```bash\nyarn add @supabase/mcp-server-postgrest\n```\n\n```bash\npnpm add @supabase/mcp-server-postgrest\n```\n\n#### Example\n\nThe following example uses the [`StreamTransport`](../mcp-utils#streamtransport) to connect directly between an MCP client and server. It also needs `@modelcontextprotocol/client`, which is a separate package from the `@modelcontextprotocol/server` peer dependency and is not installed for you:\n\n```bash\nnpm i @modelcontextprotocol/client\n```\n\n```ts\nimport { Client } from '@modelcontextprotocol/client';\nimport { StreamTransport } from '@supabase/mcp-utils';\nimport { createPostgrestMcpServer } from '@supabase/mcp-server-postgrest';\n\n// Create a stream transport for both client and server\nconst clientTransport = new StreamTransport();\nconst serverTransport = new StreamTransport();\n\n// Connect the streams together\nclientTransport.readable.pipeTo(serverTransport.writable);\nserverTransport.readable.pipeTo(clientTransport.writable);\n\nconst client = new Client(\n  {\n    name: 'MyClient',\n    version: '0.1.0',\n  },\n  {\n    capabilities: {},\n  }\n);\n\nconst supabaseUrl = 'https://your-project-ref.supabase.co'; // http://127.0.0.1:54321 for local\nconst apiKey = 'your-anon-key'; // or service role, or user JWT\nconst schema = 'public'; // or any other exposed schema\n\nconst server = createPostgrestMcpServer({\n  apiUrl: `${supabaseUrl}/rest/v1`,\n  apiKey,\n  schema,\n});\n\n// Connect the client and server to their respective transports\nawait server.connect(serverTransport);\nawait client.connect(clientTransport);\n\n// Call tools, etc\nconst output = await client.callTool({\n  name: 'postgrestRequest',\n  arguments: {\n    method: 'GET',\n    path: '/todos',\n  },\n});\n```\n","readmeFilename":"README.md"}