Skip to content

Commit df9aac8

Browse files
Allow HTTP issuer URLs when MCP_DEV_MODE is enabled
When MCP_DEV_MODE=true or MCP_DEV_MODE=1, the HTTPS requirement for issuer URLs is relaxed. This is useful for development and testing scenarios where HTTPS is impractical, such as Docker environments with custom hostnames. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b4c6090 commit df9aac8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/server/auth/router.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ export type AuthRouterOptions = {
5555

5656
const checkIssuerUrl = (issuer: URL): void => {
5757
// Technically RFC 8414 does not permit a localhost HTTPS exemption, but this will be necessary for ease of testing
58-
if (issuer.protocol !== 'https:' && issuer.hostname !== 'localhost' && issuer.hostname !== '127.0.0.1') {
58+
// Also allow HTTP in development mode for testing with non-localhost URLs (e.g., Docker environments)
59+
const devMode = process.env.MCP_DEV_MODE === 'true' || process.env.MCP_DEV_MODE === '1';
60+
if (issuer.protocol !== 'https:' && issuer.hostname !== 'localhost' && issuer.hostname !== '127.0.0.1' && !devMode) {
5961
throw new Error('Issuer URL must be HTTPS');
6062
}
6163
if (issuer.hash) {

0 commit comments

Comments
 (0)