Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"open": "^10.1.0"
},
"devDependencies": {
"@modelcontextprotocol/sdk": "^1.11.2",
"@modelcontextprotocol/sdk": "^1.12.0",
"@types/express": "^5.0.0",
"@types/node": "^22.13.10",
"prettier": "^3.5.3",
Expand Down
43 changes: 38 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/lib/node-oauth-client-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { OAuthProviderOptions, StaticOAuthClientMetadata } from './types'
import { readJsonFile, writeJsonFile, readTextFile, writeTextFile } from './mcp-auth-config'
import { StaticOAuthClientInformationFull } from './types'
import { getServerUrlHash, log, debugLog, DEBUG, MCP_REMOTE_VERSION } from './utils'
import { randomUUID } from "node:crypto";

/**
* Implements the OAuthClientProvider interface for Node.js environments.
Expand All @@ -24,6 +25,7 @@ export class NodeOAuthClientProvider implements OAuthClientProvider {
private softwareVersion: string
private staticOAuthClientMetadata: StaticOAuthClientMetadata
private staticOAuthClientInfo: StaticOAuthClientInformationFull
private _state: string

/**
* Creates a new NodeOAuthClientProvider
Expand All @@ -38,6 +40,7 @@ export class NodeOAuthClientProvider implements OAuthClientProvider {
this.softwareVersion = options.softwareVersion || MCP_REMOTE_VERSION
this.staticOAuthClientMetadata = options.staticOAuthClientMetadata
this.staticOAuthClientInfo = options.staticOAuthClientInfo
this._state = randomUUID()
}

get redirectUrl(): string {
Expand All @@ -58,6 +61,10 @@ export class NodeOAuthClientProvider implements OAuthClientProvider {
}
}

state(): string {
return this._state;
}

/**
* Gets the client information if it exists
* @returns The client information or undefined
Expand Down
Loading