Rename MCP_PROXY_TOKEN to MCP_PROXY_AUTH_TOKEN (#1)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
parent
15b9b6773c
commit
7d5f7968d1
3 changed files with 7 additions and 7 deletions
|
|
@ -166,10 +166,10 @@ If you need to disable authentication (NOT RECOMMENDED), you can set the `DANGER
|
||||||
DANGEROUSLY_OMIT_AUTH=true npm start
|
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
|
```bash
|
||||||
MCP_PROXY_TOKEN=$(openssl rand -hex 32) npm start
|
MCP_PROXY_AUTH_TOKEN=$(openssl rand -hex 32) npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Local-only Binding
|
#### Local-only Binding
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ async function startDevServer(serverOptions) {
|
||||||
...process.env,
|
...process.env,
|
||||||
SERVER_PORT,
|
SERVER_PORT,
|
||||||
CLIENT_PORT,
|
CLIENT_PORT,
|
||||||
MCP_PROXY_TOKEN: sessionToken,
|
MCP_PROXY_AUTH_TOKEN: sessionToken,
|
||||||
MCP_ENV_VARS: JSON.stringify(envVars),
|
MCP_ENV_VARS: JSON.stringify(envVars),
|
||||||
},
|
},
|
||||||
signal: abort.signal,
|
signal: abort.signal,
|
||||||
|
|
@ -99,7 +99,7 @@ async function startProdServer(serverOptions) {
|
||||||
...process.env,
|
...process.env,
|
||||||
SERVER_PORT,
|
SERVER_PORT,
|
||||||
CLIENT_PORT,
|
CLIENT_PORT,
|
||||||
MCP_PROXY_TOKEN: sessionToken,
|
MCP_PROXY_AUTH_TOKEN: sessionToken,
|
||||||
MCP_ENV_VARS: JSON.stringify(envVars),
|
MCP_ENV_VARS: JSON.stringify(envVars),
|
||||||
},
|
},
|
||||||
signal: abort.signal,
|
signal: abort.signal,
|
||||||
|
|
@ -247,8 +247,8 @@ async function main() {
|
||||||
: "Starting MCP inspector...",
|
: "Starting MCP inspector...",
|
||||||
);
|
);
|
||||||
|
|
||||||
// Generate session token for authentication
|
// Use provided token from environment or generate a new one
|
||||||
const sessionToken = randomBytes(32).toString("hex");
|
const sessionToken = process.env.MCP_PROXY_AUTH_TOKEN || randomBytes(32).toString("hex");
|
||||||
const authDisabled = !!process.env.DANGEROUSLY_OMIT_AUTH;
|
const authDisabled = !!process.env.DANGEROUSLY_OMIT_AUTH;
|
||||||
|
|
||||||
const abort = new AbortController();
|
const abort = new AbortController();
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ const serverTransports: Map<string, Transport> = new Map<string, Transport>(); /
|
||||||
|
|
||||||
// Use provided token from environment or generate a new one
|
// Use provided token from environment or generate a new one
|
||||||
const sessionToken =
|
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;
|
const authDisabled = !!process.env.DANGEROUSLY_OMIT_AUTH;
|
||||||
|
|
||||||
// Origin validation middleware to prevent DNS rebinding attacks
|
// Origin validation middleware to prevent DNS rebinding attacks
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue