Skip to content

Commit 998fade

Browse files
authored
Merge pull request #141 from supabase-community/feat/mcp-registry
feat: mcp registry
2 parents e312146 + d005bdc commit 998fade

File tree

7 files changed

+207
-37
lines changed

7 files changed

+207
-37
lines changed

CONTRIBUTING.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Contributing
2+
3+
## Development setup
4+
5+
This repo uses pnpm for package management and the active LTS version of Node.js (see versions pinned in `.nvmrc` and `"packageManager"` in `package.json`).
6+
7+
Clone the repo and run:
8+
9+
```bash
10+
pnpm install
11+
```
12+
13+
To build the MCP server and watch for file changes:
14+
15+
```bash
16+
cd packages/mcp-server-supabase
17+
pnpm dev
18+
```
19+
20+
Configure your MCP client with the `file:` protocol to run the local build. You may need to restart the server in your MCP client after each change.
21+
22+
```json
23+
{
24+
"mcpServers": {
25+
"supabase": {
26+
"command": "npx",
27+
"args": [
28+
"-y",
29+
"@supabase/mcp-server-supabase@file:/path/to/mcp-server-supabase/packages/mcp-server-supabase",
30+
"--project-ref",
31+
"<your project ref>"
32+
],
33+
"env": {
34+
"SUPABASE_ACCESS_TOKEN": "<your pat>"
35+
}
36+
}
37+
}
38+
}
39+
```
40+
41+
Optionally, configure `--api-url` to point at a different Supabase instance (defaults to `https://api.supabase.com`)
42+
43+
## Publishing to the MCP registry
44+
45+
We publish the MCP server to the official MCP registry so that it can be discovered and used by MCP clients.
46+
Note the MCP registry does not host the server itself, only metadata about the server. This is defined in the `packages/mcp-server-supabase/server.json` file.
47+
48+
### Dependencies
49+
50+
You will need to install the MCP publisher globally if you haven't already. On macOS, you can do this with Homebrew:
51+
52+
```shell
53+
brew install mcp-publisher
54+
```
55+
56+
See the [MCP publisher documentation](https://github.com/modelcontextprotocol/registry/blob/main/docs/guides/publishing/publish-server.md) for other installation methods.
57+
58+
### Steps
59+
60+
1. Update the package version in `packages/mcp-server-supabase/package.json`. Follow [semver](https://semver.org/) guidelines for versioning.
61+
62+
2. Update `server.json` with the new version by running:
63+
64+
```shell
65+
pnpm registry:update
66+
```
67+
68+
3. Download the `domain-verification-key.pem` from Bitwarden and place it in `packages/mcp-server-supabase/`. This will be used to verify ownership of the `supabase.com` domain during the login process.
69+
70+
> This works because of the [`.well-known/mcp-registry-auth`](https://github.com/supabase/supabase/blob/master/apps/www/public/.well-known/mcp-registry-auth) endpoint served by `supabase.com`.
71+
72+
4. Login to the MCP registry:
73+
74+
```shell
75+
pnpm registry:login
76+
```
77+
78+
5. Publish the new version:
79+
80+
```shell
81+
pnpm registry:publish
82+
```

README.md

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -290,43 +290,7 @@ The PostgREST MCP server allows you to connect your own users to your app via RE
290290

291291
## For developers
292292

293-
This repo uses pnpm for package management and the active LTS version of Node.js (see versions pinned in `.nvmrc` and `"packageManager"` in `package.json`).
294-
295-
Clone the repo and run:
296-
297-
```bash
298-
pnpm install
299-
```
300-
301-
To build the MCP server and watch for file changes:
302-
303-
```bash
304-
cd packages/mcp-server-supabase
305-
pnpm dev
306-
```
307-
308-
Configure your MCP client with the `file:` protocol to run the local build. You may need to restart the server in your MCP client after each change.
309-
310-
```json
311-
{
312-
"mcpServers": {
313-
"supabase": {
314-
"command": "npx",
315-
"args": [
316-
"-y",
317-
"@supabase/mcp-server-supabase@file:/path/to/mcp-server-supabase/packages/mcp-server-supabase",
318-
"--project-ref",
319-
"<your project ref>"
320-
],
321-
"env": {
322-
"SUPABASE_ACCESS_TOKEN": "<your pat>"
323-
}
324-
}
325-
}
326-
}
327-
```
328-
329-
Optionally, configure `--api-url` to point at a different Supabase instance (defaults to `https://api.supabase.com`)
293+
See [CONTRIBUTING](./CONTRIBUTING.md) for details on how to contribute to this project.
330294

331295
## License
332296

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
test/coverage
2+
*.pem

packages/mcp-server-supabase/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "@supabase/mcp-server-supabase",
3+
"mcpName": "com.supabase/mcp",
34
"version": "0.5.3",
45
"description": "MCP server for interacting with Supabase",
56
"license": "Apache-2.0",
@@ -13,6 +14,9 @@
1314
"typecheck": "tsc --noEmit",
1415
"prebuild": "pnpm typecheck",
1516
"prepublishOnly": "pnpm build",
17+
"registry:update": "tsx scripts/registry/update-version.ts",
18+
"registry:login": "scripts/registry/login.sh",
19+
"registry:publish": "mcp-publisher publish",
1620
"test": "vitest",
1721
"test:unit": "vitest --project unit",
1822
"test:e2e": "vitest --project e2e",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# Check for DOMAIN_VERIFICATION_KEY environment variable first
4+
if [ -n "$DOMAIN_VERIFICATION_KEY" ]; then
5+
# Use the PEM content from environment variable
6+
PRIVATE_KEY_HEX=$(echo "$DOMAIN_VERIFICATION_KEY" | openssl pkey -noout -text | grep -A3 "priv:" | tail -n +2 | tr -d ' :\n')
7+
else
8+
# Default to reading from file
9+
PRIVATE_KEY_PATH=domain-verification-key.pem
10+
PRIVATE_KEY_HEX=$(openssl pkey -in $PRIVATE_KEY_PATH -noout -text | grep -A3 "priv:" | tail -n +2 | tr -d ' :\n')
11+
fi
12+
13+
mcp-publisher login http \
14+
--domain supabase.com \
15+
--private-key=$PRIVATE_KEY_HEX
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { readFile, writeFile } from 'node:fs/promises';
2+
import { fileURLToPath } from 'node:url';
3+
4+
const packageJsonPath = fileURLToPath(
5+
import.meta.resolve('../../package.json')
6+
);
7+
const serverJsonPath = fileURLToPath(import.meta.resolve('../../server.json'));
8+
9+
try {
10+
// Read package.json to get the version
11+
const packageJson = JSON.parse(await readFile(packageJsonPath, 'utf-8'));
12+
const { name, version } = packageJson;
13+
14+
if (!version) {
15+
console.error('No version found in package.json');
16+
process.exit(1);
17+
}
18+
19+
// Read server.json
20+
const serverJson = JSON.parse(await readFile(serverJsonPath, 'utf-8'));
21+
22+
// Update version in server.json root
23+
serverJson.version = version;
24+
25+
// Update version in packages array
26+
if (serverJson.packages && Array.isArray(serverJson.packages)) {
27+
for (const pkg of serverJson.packages) {
28+
if (pkg.identifier === name) {
29+
pkg.version = version;
30+
}
31+
}
32+
}
33+
34+
// Write updated server.json
35+
await writeFile(serverJsonPath, JSON.stringify(serverJson, null, 2) + '\n');
36+
37+
console.log(`Updated server.json version to ${version}`);
38+
} catch (error) {
39+
console.error('Failed to update server.json version:', error);
40+
process.exit(1);
41+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
3+
"name": "com.supabase/mcp",
4+
"description": "MCP server for interacting with the Supabase platform",
5+
"status": "active",
6+
"repository": {
7+
"url": "https://github.com/supabase-community/supabase-mcp",
8+
"source": "github",
9+
"subfolder": "packages/mcp-server-supabase"
10+
},
11+
"version": "0.5.3",
12+
"packages": [
13+
{
14+
"registry_type": "npm",
15+
"registry_base_url": "https://registry.npmjs.org",
16+
"identifier": "@supabase/mcp-server-supabase",
17+
"version": "0.5.3",
18+
"transport": {
19+
"type": "stdio"
20+
},
21+
"runtime_hint": "npx",
22+
"runtime_arguments": [
23+
{
24+
"type": "named",
25+
"name": "--project-ref",
26+
"description": "Supabase project reference ID",
27+
"format": "string",
28+
"is_required": false
29+
},
30+
{
31+
"type": "named",
32+
"name": "--read-only",
33+
"description": "Enable read-only mode",
34+
"format": "boolean",
35+
"is_required": false
36+
},
37+
{
38+
"type": "named",
39+
"name": "--features",
40+
"description": "Comma-separated list of features to enable",
41+
"format": "string",
42+
"is_required": false
43+
},
44+
{
45+
"type": "named",
46+
"name": "--api-url",
47+
"description": "Custom API URL",
48+
"format": "string",
49+
"is_required": false
50+
}
51+
],
52+
"environment_variables": [
53+
{
54+
"name": "SUPABASE_ACCESS_TOKEN",
55+
"description": "Personal access token for Supabase API",
56+
"format": "string",
57+
"is_required": true,
58+
"is_secret": true
59+
}
60+
]
61+
}
62+
]
63+
}

0 commit comments

Comments
 (0)