Skip to content

Commit 3d27788

Browse files
committed
feat: allow access token to be set via environment variable
1 parent d5507a8 commit 3d27788

File tree

1 file changed

+5
-2
lines changed
  • packages/mcp-server-supabase/src

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { createSupabaseMcpServer } from './server.js';
88
async function main() {
99
const {
1010
values: {
11-
['access-token']: accessToken,
11+
['access-token']: cliAccessToken,
1212
['api-url']: apiUrl,
1313
['version']: showVersion,
1414
},
@@ -31,9 +31,12 @@ async function main() {
3131
process.exit(0);
3232
}
3333

34+
// Use access token from CLI argument or environment variable
35+
const accessToken = cliAccessToken || process.env.SUPABASE_ACCESS_TOKEN;
36+
3437
if (!accessToken) {
3538
console.error(
36-
'Please provide a personal access token (PAT) with the --access-token flag'
39+
'Please provide a personal access token (PAT) with the --access-token flag or set the SUPABASE_ACCESS_TOKEN environment variable'
3740
);
3841
process.exit(1);
3942
}

0 commit comments

Comments
 (0)