Skip to content

Commit c4f4252

Browse files
authored
Merge pull request #137 from supabase-community/feat/export-version
feat: export package `version`
2 parents 41431fd + 5f44664 commit c4f4252

File tree

3 files changed

+41
-7
lines changed

3 files changed

+41
-7
lines changed

README.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ The [Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP)
88

99
## Prerequisites
1010

11-
You will need Node.js installed on your machine. You can check this by running:
11+
You will need Node.js ([active LTS](https://nodejs.org/en/about/previous-releases) or newer) installed on your machine. You can check this by running:
1212

1313
```shell
1414
node -v
1515
```
1616

17-
If you don't have Node.js installed, you can download it from [nodejs.org](https://nodejs.org/).
17+
If you don't have Node.js 22+ installed, you can download it from [nodejs.org](https://nodejs.org/).
1818

1919
## Setup
2020

@@ -289,16 +289,43 @@ The PostgREST MCP server allows you to connect your own users to your app via RE
289289

290290
## For developers
291291

292-
This repo uses npm for package management, and the latest LTS version of Node.js.
292+
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`).
293293

294294
Clone the repo and run:
295295

296+
```bash
297+
pnpm install
296298
```
297-
npm install --ignore-scripts
299+
300+
To build the MCP server and watch for file changes:
301+
302+
```bash
303+
cd packages/mcp-server-supabase
304+
pnpm dev
305+
```
306+
307+
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.
308+
309+
```json
310+
{
311+
"mcpServers": {
312+
"supabase": {
313+
"command": "npx",
314+
"args": [
315+
"-y",
316+
"@supabase/mcp-server-supabase@file:/path/to/mcp-server-supabase/packages/mcp-server-supabase",
317+
"--project-ref",
318+
"<your project ref>"
319+
],
320+
"env": {
321+
"SUPABASE_ACCESS_TOKEN": "<your pat>"
322+
}
323+
}
324+
}
325+
}
298326
```
299327

300-
> [!NOTE]
301-
> On recent versions of MacOS, you may have trouble installing the `libpg-query` transient dependency without the `--ignore-scripts` flag.
328+
Optionally, configure `--api-url` to point at a different Supabase instance (defaults to `https://api.supabase.com`)
302329

303330
## License
304331

packages/mcp-server-supabase/src/index.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
MCP_CLIENT_NAME,
88
MCP_CLIENT_VERSION,
99
} from '../test/mocks.js';
10-
import { createSupabaseMcpServer } from './index.js';
10+
import { createSupabaseMcpServer, version } from './index.js';
1111
import { createSupabaseApiPlatform } from './platform/api-platform.js';
1212

1313
type SetupOptions = {
@@ -61,4 +61,8 @@ describe('index', () => {
6161

6262
expect(tools.length).toBeGreaterThan(0);
6363
});
64+
65+
test('index.ts exports a version', () => {
66+
expect(version).toStrictEqual(expect.any(String));
67+
});
6468
});

packages/mcp-server-supabase/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import packageJson from '../package.json' with { type: 'json' };
2+
13
export type { SupabasePlatform } from './platform/index.js';
24
export {
35
createSupabaseMcpServer,
@@ -8,3 +10,4 @@ export {
810
currentFeatureGroupSchema,
911
type FeatureGroup,
1012
} from './types.js';
13+
export const version = packageJson.version;

0 commit comments

Comments
 (0)