Merge pull request #272 from modelcontextprotocol/revert-249-main

Revert "feat: support extending McpServer with authorization"
This commit is contained in:
Justin Spahr-Summers 2025-04-07 11:17:03 +01:00 • committed by GitHub
commit 44839ee01d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 42 additions and 419 deletions

View file

@ -93,11 +93,6 @@ export type RequestHandlerExtra = {
* The session ID from the transport, if available.
*/
sessionId?: string;
/**
* The authenticated user, if available.
*/
user?: unknown;
};
/**
@ -324,7 +319,6 @@ export abstract class Protocol<
const extra: RequestHandlerExtra = {
signal: abortController.signal,
sessionId: this._transport?.sessionId,
user: this._transport?.user,
};
// Starting with Promise.resolve() puts any synchronous errors into the monad as well.
@ -370,7 +364,7 @@ export abstract class Protocol<
private _onprogress(notification: ProgressNotification): void {
const { progressToken, ...params } = notification.params;
const messageId = Number(progressToken);
const handler = this._progressHandlers.get(messageId);
if (!handler) {
this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`));

View file

@ -46,9 +46,4 @@ export interface Transport {
* The session ID generated for this connection.
*/
sessionId?: string;
/**
* The authenticated user for this transport session.
*/
user?: unknown;
}