Skip to content

Commit f82460e

Browse files
authored
Merge branch 'main' into fix-630
2 parents ea9ab9f + 7fc3de7 commit f82460e

File tree

10 files changed

+667
-38
lines changed

10 files changed

+667
-38
lines changed

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
npx lint-staged
2+
git update-index --again

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ If you need to disable authentication (NOT RECOMMENDED), you can set the `DANGER
166166
DANGEROUSLY_OMIT_AUTH=true npm start
167167
```
168168

169+
---
170+
171+
**🚨 WARNING 🚨**
172+
173+
Disabling authentication with `DANGEROUSLY_OMIT_AUTH` is incredibly dangerous! Disabling auth leaves your machine open to attack not just when exposed to the public internet, but also **via your web browser**. Meaning, visiting a malicious website OR viewing a malicious advertizement could allow an attacker to remotely compromise your computer. Do not disable this feature unless you truly understand the risks.
174+
175+
Read more about the risks of this vulnerability on Oligo's blog: [Critical RCE Vulnerability in Anthropic MCP Inspector - CVE-2025-49596](https://www.oligo.security/blog/critical-rce-vulnerability-in-anthropic-mcp-inspector-cve-2025-49596)
176+
177+
---
178+
169179
You can also set the token via the `MCP_PROXY_AUTH_TOKEN` environment variable when starting the server:
170180

171181
```bash

cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/inspector-cli",
3-
"version": "0.16.4",
3+
"version": "0.16.5",
44
"description": "CLI for the Model Context Protocol inspector",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",
@@ -21,7 +21,7 @@
2121
},
2222
"devDependencies": {},
2323
"dependencies": {
24-
"@modelcontextprotocol/sdk": "^1.17.2",
24+
"@modelcontextprotocol/sdk": "^1.17.3",
2525
"commander": "^13.1.0",
2626
"spawn-rx": "^5.1.2"
2727
}

client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/inspector-client",
3-
"version": "0.16.4",
3+
"version": "0.16.5",
44
"description": "Client-side application for the Model Context Protocol inspector",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",
@@ -25,7 +25,7 @@
2525
"cleanup:e2e": "node e2e/global-teardown.js"
2626
},
2727
"dependencies": {
28-
"@modelcontextprotocol/sdk": "^1.17.2",
28+
"@modelcontextprotocol/sdk": "^1.17.3",
2929
"@radix-ui/react-checkbox": "^1.1.4",
3030
"@radix-ui/react-dialog": "^1.1.3",
3131
"@radix-ui/react-icons": "^1.3.0",

client/src/lib/auth.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,15 @@ export const clearClientInformationFromSessionStorage = ({
102102
};
103103

104104
export class InspectorOAuthClientProvider implements OAuthClientProvider {
105-
constructor(protected serverUrl: string) {
105+
constructor(
106+
protected serverUrl: string,
107+
scope?: string,
108+
) {
109+
this.scope = scope;
106110
// Save the server URL to session storage
107111
sessionStorage.setItem(SESSION_KEYS.SERVER_URL, serverUrl);
108112
}
113+
scope: string | undefined;
109114

110115
get redirectUrl() {
111116
return window.location.origin + "/oauth/callback";
@@ -119,6 +124,7 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
119124
response_types: ["code"],
120125
client_name: "MCP Inspector",
121126
client_uri: "https://github.com/modelcontextprotocol/inspector",
127+
scope: this.scope ?? "",
122128
};
123129
}
124130

client/src/lib/hooks/useConnection.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@ export function useConnection({
319319

320320
const handleAuthError = async (error: unknown) => {
321321
if (is401Error(error)) {
322-
const serverAuthProvider = new InspectorOAuthClientProvider(sseUrl);
323-
324322
let scope = oauthScope?.trim();
325323
if (!scope) {
326324
// Only discover resource metadata when we need to discover scopes
@@ -334,6 +332,10 @@ export function useConnection({
334332
}
335333
scope = await discoverScopes(sseUrl, resourceMetadata);
336334
}
335+
const serverAuthProvider = new InspectorOAuthClientProvider(
336+
sseUrl,
337+
scope,
338+
);
337339

338340
const result = await auth(serverAuthProvider, {
339341
serverUrl: sseUrl,

client/src/lib/oauth-state-machine.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ export const oauthTransitions: Record<OAuthStep, StateTransition> = {
177177
authorizationCode: context.state.authorizationCode,
178178
codeVerifier,
179179
redirectUri: context.provider.redirectUrl,
180-
resource: context.state.resource ?? undefined,
180+
resource: context.state.resource
181+
? context.state.resource instanceof URL
182+
? context.state.resource
183+
: new URL(context.state.resource)
184+
: undefined,
181185
});
182186

183187
context.provider.saveTokens(tokens);

0 commit comments

Comments
 (0)