-
Notifications
You must be signed in to change notification settings - Fork 780
CommonJS Support #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This can be worked around by using dynamic |
Dynamic import does not work when the tsconfig.module is set to commonjs in TypeScript, since "await import" is compiled into "require". It would be highly beneficial to have the build file support both "CJS" and "ESM," similar to packages like anthropic-sdk-typescript. |
You should be able to use |
Yeah, |
@wu-joyous Can you try out the CJS version on |
@jspahrsummers I tried it out and it works! Would be cool if we get a release |
Done! Released as 1.2.0. |
Is your feature request related to a problem? Please describe.
The current SDK is incompatible with "commonjs" packages, such as using @modelcontextprotocol/sdk in Nest.js.
Describe the solution you'd like
@modelcontextprotocol/sdk should be compatible with both ESModules and CommonJS.
Describe alternatives you've considered
n/a
Additional context
n/a
The text was updated successfully, but these errors were encountered: