Rename MCP_PROXY_TOKEN to MCP_PROXY_AUTH_TOKEN (#1)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
Kent C. Dodds 2025-07-07 15:21:27 -06:00 • committed by GitHub
commit 7d5f7968d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 7 deletions

View file

@ -166,10 +166,10 @@ If you need to disable authentication (NOT RECOMMENDED), you can set the `DANGER
DANGEROUSLY_OMIT_AUTH=true npm start
```
You can also set the token via the `MCP_PROXY_TOKEN` environment variable when starting the server:
You can also set the token via the `MCP_PROXY_AUTH_TOKEN` environment variable when starting the server:
```bash
MCP_PROXY_TOKEN=$(openssl rand -hex 32) npm start
MCP_PROXY_AUTH_TOKEN=$(openssl rand -hex 32) npm start
```
#### Local-only Binding

View file

@ -40,7 +40,7 @@ async function startDevServer(serverOptions) {
...process.env,
SERVER_PORT,
CLIENT_PORT,
MCP_PROXY_TOKEN: sessionToken,
MCP_PROXY_AUTH_TOKEN: sessionToken,
MCP_ENV_VARS: JSON.stringify(envVars),
},
signal: abort.signal,
@ -99,7 +99,7 @@ async function startProdServer(serverOptions) {
...process.env,
SERVER_PORT,
CLIENT_PORT,
MCP_PROXY_TOKEN: sessionToken,
MCP_PROXY_AUTH_TOKEN: sessionToken,
MCP_ENV_VARS: JSON.stringify(envVars),
},
signal: abort.signal,
@ -247,8 +247,8 @@ async function main() {
: "Starting MCP inspector...",
);
// Generate session token for authentication
const sessionToken = randomBytes(32).toString("hex");
// Use provided token from environment or generate a new one
const sessionToken = process.env.MCP_PROXY_AUTH_TOKEN || randomBytes(32).toString("hex");
const authDisabled = !!process.env.DANGEROUSLY_OMIT_AUTH;
const abort = new AbortController();

View file

@ -92,7 +92,7 @@ const serverTransports: Map<string, Transport> = new Map<string, Transport>(); /
// Use provided token from environment or generate a new one
const sessionToken =
process.env.MCP_PROXY_TOKEN || randomBytes(32).toString("hex");
process.env.MCP_PROXY_AUTH_TOKEN || randomBytes(32).toString("hex");
const authDisabled = !!process.env.DANGEROUSLY_OMIT_AUTH;
// Origin validation middleware to prevent DNS rebinding attacks