Skip to content

Commit f1784d8

Browse files
committed
upgrade mcp client to latest, add state to oauth provider
1 parent 4e16843 commit f1784d8

File tree

3 files changed

+46
-6
lines changed

3 files changed

+46
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"open": "^10.1.0"
3434
},
3535
"devDependencies": {
36-
"@modelcontextprotocol/sdk": "^1.11.2",
36+
"@modelcontextprotocol/sdk": "^1.12.0",
3737
"@types/express": "^5.0.0",
3838
"@types/node": "^22.13.10",
3939
"prettier": "^3.5.3",

pnpm-lock.yaml

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

src/lib/node-oauth-client-provider.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type { OAuthProviderOptions, StaticOAuthClientMetadata } from './types'
1010
import { readJsonFile, writeJsonFile, readTextFile, writeTextFile } from './mcp-auth-config'
1111
import { StaticOAuthClientInformationFull } from './types'
1212
import { getServerUrlHash, log, debugLog, DEBUG, MCP_REMOTE_VERSION } from './utils'
13+
import { randomUUID } from "node:crypto";
1314

1415
/**
1516
* Implements the OAuthClientProvider interface for Node.js environments.
@@ -24,6 +25,7 @@ export class NodeOAuthClientProvider implements OAuthClientProvider {
2425
private softwareVersion: string
2526
private staticOAuthClientMetadata: StaticOAuthClientMetadata
2627
private staticOAuthClientInfo: StaticOAuthClientInformationFull
28+
private _state: string
2729

2830
/**
2931
* Creates a new NodeOAuthClientProvider
@@ -38,6 +40,7 @@ export class NodeOAuthClientProvider implements OAuthClientProvider {
3840
this.softwareVersion = options.softwareVersion || MCP_REMOTE_VERSION
3941
this.staticOAuthClientMetadata = options.staticOAuthClientMetadata
4042
this.staticOAuthClientInfo = options.staticOAuthClientInfo
43+
this._state = randomUUID()
4144
}
4245

4346
get redirectUrl(): string {
@@ -58,6 +61,10 @@ export class NodeOAuthClientProvider implements OAuthClientProvider {
5861
}
5962
}
6063

64+
state(): string {
65+
return this._state;
66+
}
67+
6168
/**
6269
* Gets the client information if it exists
6370
* @returns The client information or undefined

0 commit comments

Comments
 (0)