Skip to content

Commit 7d5f796

Browse files
Rename MCP_PROXY_TOKEN to MCP_PROXY_AUTH_TOKEN (#1)
Co-authored-by: Cursor Agent <[email protected]>
1 parent 15b9b67 commit 7d5f796

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ If you need to disable authentication (NOT RECOMMENDED), you can set the `DANGER
166166
DANGEROUSLY_OMIT_AUTH=true npm start
167167
```
168168

169-
You can also set the token via the `MCP_PROXY_TOKEN` environment variable when starting the server:
169+
You can also set the token via the `MCP_PROXY_AUTH_TOKEN` environment variable when starting the server:
170170

171171
```bash
172-
MCP_PROXY_TOKEN=$(openssl rand -hex 32) npm start
172+
MCP_PROXY_AUTH_TOKEN=$(openssl rand -hex 32) npm start
173173
```
174174

175175
#### Local-only Binding

client/bin/start.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function startDevServer(serverOptions) {
4040
...process.env,
4141
SERVER_PORT,
4242
CLIENT_PORT,
43-
MCP_PROXY_TOKEN: sessionToken,
43+
MCP_PROXY_AUTH_TOKEN: sessionToken,
4444
MCP_ENV_VARS: JSON.stringify(envVars),
4545
},
4646
signal: abort.signal,
@@ -99,7 +99,7 @@ async function startProdServer(serverOptions) {
9999
...process.env,
100100
SERVER_PORT,
101101
CLIENT_PORT,
102-
MCP_PROXY_TOKEN: sessionToken,
102+
MCP_PROXY_AUTH_TOKEN: sessionToken,
103103
MCP_ENV_VARS: JSON.stringify(envVars),
104104
},
105105
signal: abort.signal,
@@ -247,8 +247,8 @@ async function main() {
247247
: "Starting MCP inspector...",
248248
);
249249

250-
// Generate session token for authentication
251-
const sessionToken = randomBytes(32).toString("hex");
250+
// Use provided token from environment or generate a new one
251+
const sessionToken = process.env.MCP_PROXY_AUTH_TOKEN || randomBytes(32).toString("hex");
252252
const authDisabled = !!process.env.DANGEROUSLY_OMIT_AUTH;
253253

254254
const abort = new AbortController();

server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const serverTransports: Map<string, Transport> = new Map<string, Transport>(); /
9292

9393
// Use provided token from environment or generate a new one
9494
const sessionToken =
95-
process.env.MCP_PROXY_TOKEN || randomBytes(32).toString("hex");
95+
process.env.MCP_PROXY_AUTH_TOKEN || randomBytes(32).toString("hex");
9696
const authDisabled = !!process.env.DANGEROUSLY_OMIT_AUTH;
9797

9898
// Origin validation middleware to prevent DNS rebinding attacks

0 commit comments

Comments
 (0)