Skip to content

Commit 65d41d5

Browse files
Rename env var to MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL
1 parent 6f73e38 commit 65d41d5

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

package-lock.json

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/server/auth/router.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import { OAuthServerProvider } from './provider.js';
88
import { OAuthMetadata, OAuthProtectedResourceMetadata } from '../../shared/auth.js';
99

1010
// Check for dev mode flag that allows HTTP issuer URLs (for development/testing only)
11-
const allowHttpForDev = process.env.MCP_ALLOW_HTTP_AUTH_FOR_DEV_UNSAFE === 'true' || process.env.MCP_ALLOW_HTTP_AUTH_FOR_DEV_UNSAFE === '1';
12-
if (allowHttpForDev) {
11+
const allowInsecureIssuerUrl = process.env.MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL === 'true' || process.env.MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL === '1';
12+
if (allowInsecureIssuerUrl) {
1313
// eslint-disable-next-line no-console
14-
console.warn('MCP_ALLOW_HTTP_AUTH_FOR_DEV_UNSAFE is enabled - HTTP issuer URLs are allowed. Do not use in production.');
14+
console.warn('MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL is enabled - HTTP issuer URLs are allowed. Do not use in production.');
1515
}
1616

1717
export type AuthRouterOptions = {
@@ -62,7 +62,7 @@ export type AuthRouterOptions = {
6262

6363
const checkIssuerUrl = (issuer: URL): void => {
6464
// Technically RFC 8414 does not permit a localhost HTTPS exemption, but this will be necessary for ease of testing
65-
if (issuer.protocol !== 'https:' && issuer.hostname !== 'localhost' && issuer.hostname !== '127.0.0.1' && !allowHttpForDev) {
65+
if (issuer.protocol !== 'https:' && issuer.hostname !== 'localhost' && issuer.hostname !== '127.0.0.1' && !allowInsecureIssuerUrl) {
6666
throw new Error('Issuer URL must be HTTPS');
6767
}
6868
if (issuer.hash) {

0 commit comments

Comments
 (0)