Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ The [Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP)

## Prerequisites

You will need Node.js installed on your machine. You can check this by running:
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:

```shell
node -v
```

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

## Setup

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

## For developers

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

Clone the repo and run:

```bash
pnpm install
```
npm install --ignore-scripts

To build the MCP server and watch for file changes:

```bash
cd packages/mcp-server-supabase
pnpm dev
```

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.

```json
{
"mcpServers": {
"supabase": {
"command": "npx",
"args": [
"-y",
"@supabase/mcp-server-supabase@file:/path/to/mcp-server-supabase/packages/mcp-server-supabase",
"--project-ref",
"<your project ref>"
],
"env": {
"SUPABASE_ACCESS_TOKEN": "<your pat>"
}
}
}
}
```

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

## License

Expand Down
6 changes: 5 additions & 1 deletion packages/mcp-server-supabase/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
MCP_CLIENT_NAME,
MCP_CLIENT_VERSION,
} from '../test/mocks.js';
import { createSupabaseMcpServer } from './index.js';
import { createSupabaseMcpServer, version } from './index.js';
import { createSupabaseApiPlatform } from './platform/api-platform.js';

type SetupOptions = {
Expand Down Expand Up @@ -61,4 +61,8 @@ describe('index', () => {

expect(tools.length).toBeGreaterThan(0);
});

test('index.ts exports a version', () => {
expect(version).toStrictEqual(expect.any(String));
});
});
3 changes: 3 additions & 0 deletions packages/mcp-server-supabase/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import packageJson from '../package.json' with { type: 'json' };

export type { SupabasePlatform } from './platform/index.js';
export {
createSupabaseMcpServer,
Expand All @@ -8,3 +10,4 @@ export {
currentFeatureGroupSchema,
type FeatureGroup,
} from './types.js';
export const version = packageJson.version;