You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Following the example in the README section on proxy authorization leads to a ERR_MODULE_NOT_FOUND error when importing from @modelcontextprotocol/sdk/server/auth/providers/proxyProvider.
To Reproduce
Steps to reproduce the behavior:
Follow the example import:
import { ProxyOAuthServerProvider, mcpAuthRouter } from '@modelcontextprotocol/sdk/server/auth/providers/proxyProvider';
Run the Node.js project (using ESM).
Expected behavior
The import should resolve correctly and not throw a ERR_MODULE_NOT_FOUND error.
Logs
node:internal/modules/esm/resolve:265
throw new ERR_MODULE_NOT_FOUND(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/kumuditha/Documents/mcpHackerthon/my/untitled folder/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider' imported from /Users/kumuditha/Documents/mcpHackerthon/my/untitled folder/client.js
at finalizeResolution (node:internal/modules/esm/resolve:265:11)
at moduleResolve (node:internal/modules/esm/resolve:933:10)
at defaultResolve (node:internal/modules/esm/resolve:1169:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
at link (node:internal/modules/esm/module_job:86:36) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///Users/kumuditha/Documents/mcpHackerthon/my/untitled%20folder/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider'
}
Additional context
Modifying the import to include the .js extension resolved the issue:
import { mcpAuthRouter } from '@modelcontextprotocol/sdk/server/auth/router.js';
import { ProxyOAuthServerProvider } from '@modelcontextprotocol/sdk/server/auth/providers/proxyProvider.js';
This may require either fixing the documentation example or updating the SDK’s exports field in package.json to support extensionless ESM imports.
The text was updated successfully, but these errors were encountered:
Describe the bug
Following the example in the README section on proxy authorization leads to a
ERR_MODULE_NOT_FOUND
error when importing from@modelcontextprotocol/sdk/server/auth/providers/proxyProvider.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The import should resolve correctly and not throw a
ERR_MODULE_NOT_FOUND
error.Logs
Additional context
Modifying the import to include the .js extension resolved the issue:
This may require either fixing the documentation example or updating the SDK’s exports field in package.json to support extensionless ESM imports.
The text was updated successfully, but these errors were encountered: