chore: switch to module ESNext + moduleResolution bundler (#2095)

This commit is contained in:
Matt 2026-06-25 12:49:17 +02:00 • committed by GitHub
commit ee732d64b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 668 additions and 863 deletions

View file

@ -1,7 +1,7 @@
import { OAuthError, OAuthErrorCode } from '@modelcontextprotocol/server';
import type { RequestHandler } from 'express';
import type { OAuthTokenVerifier } from './types.js';
import type { OAuthTokenVerifier } from './types';
/**
* Options for {@link requireBearerAuth}.

View file

@ -7,7 +7,7 @@
* @module
*/
import { createMcpExpressApp } from './express.js';
import { createMcpExpressApp } from './express';
/**
* Example: Basic usage with default DNS rebinding protection.

View file

@ -1,7 +1,7 @@
import type { Express } from 'express';
import express from 'express';
import { hostHeaderValidation, localhostHostValidation } from './middleware/hostHeaderValidation.js';
import { hostHeaderValidation, localhostHostValidation } from './middleware/hostHeaderValidation';
/**
* Options for creating an MCP Express application.

View file

@ -1,9 +1,9 @@
export * from './express.js';
export * from './middleware/hostHeaderValidation.js';
export * from './express';
export * from './middleware/hostHeaderValidation';
// OAuth Resource-Server glue: bearer-token middleware + PRM/AS metadata router.
export type { BearerAuthMiddlewareOptions } from './auth/bearerAuth.js';
export { requireBearerAuth } from './auth/bearerAuth.js';
export type { AuthMetadataOptions } from './auth/metadataRouter.js';
export { getOAuthProtectedResourceMetadataUrl, mcpAuthMetadataRouter } from './auth/metadataRouter.js';
export type { OAuthTokenVerifier } from './auth/types.js';
export type { BearerAuthMiddlewareOptions } from './auth/bearerAuth';
export { requireBearerAuth } from './auth/bearerAuth';
export type { AuthMetadataOptions } from './auth/metadataRouter';
export { getOAuthProtectedResourceMetadataUrl, mcpAuthMetadataRouter } from './auth/metadataRouter';
export type { OAuthTokenVerifier } from './auth/types';

View file

@ -9,7 +9,7 @@
import type { Express } from 'express';
import { hostHeaderValidation, localhostHostValidation } from './hostHeaderValidation.js';
import { hostHeaderValidation, localhostHostValidation } from './hostHeaderValidation';
/**
* Example: Using hostHeaderValidation middleware with custom allowed hosts.

View file

@ -6,9 +6,9 @@ import supertest from 'supertest';
import type { Mock } from 'vitest';
import { vi } from 'vitest';
import type { OAuthTokenVerifier } from '../../src/auth/types.js';
import { requireBearerAuth } from '../../src/auth/bearerAuth.js';
import { getOAuthProtectedResourceMetadataUrl, mcpAuthMetadataRouter } from '../../src/auth/metadataRouter.js';
import type { OAuthTokenVerifier } from '../../src/auth/types';
import { requireBearerAuth } from '../../src/auth/bearerAuth';
import { getOAuthProtectedResourceMetadataUrl, mcpAuthMetadataRouter } from '../../src/auth/metadataRouter';
// ---------------------------------------------------------------------------
// requireBearerAuth

View file

@ -1,8 +1,8 @@
import type { NextFunction, Request, Response } from 'express';
import { vi } from 'vitest';
import { createMcpExpressApp } from '../src/express.js';
import { hostHeaderValidation, localhostHostValidation } from '../src/middleware/hostHeaderValidation.js';
import { createMcpExpressApp } from '../src/express';
import { hostHeaderValidation, localhostHostValidation } from '../src/middleware/hostHeaderValidation';
// Helper to create mock Express request/response/next
function createMockReqResNext(host?: string) {