Commit c5a31dd
committed
Fix proxy token authentication in npx command
The npx entry point (cli/src/cli.ts) was not generating or passing
authentication tokens, causing proxy authentication to fail when using
`npx @modelcontextprotocol/inspector@latest`.
This change aligns the npx behavior with the local development behavior:
- Generate session token using crypto.randomBytes(32)
- Pass MCP_PROXY_TOKEN to server via environment
- Use correct SERVER_PORT instead of PORT
- Build client URL with authentication parameters
- Pass URL to client via INSPECTOR_URL environment variable
Now both `npm run start` and `npx` commands handle authentication
consistently.1 parent 38bead3 commit c5a31dd
1 file changed
+27
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
| |||
93 | 98 | | |
94 | 99 | | |
95 | 100 | | |
96 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
97 | 104 | | |
98 | 105 | | |
99 | 106 | | |
| |||
107 | 114 | | |
108 | 115 | | |
109 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
110 | 131 | | |
111 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
112 | 137 | | |
113 | 138 | | |
114 | 139 | | |
| |||
0 commit comments