Description
Describe the bug
After installing @modelcontextprotocol/sdk I can't run a typescript build anymore
To Reproduce
Steps to reproduce the behavior:
- add the
@modelcontextprotocol/sdk
with yarn or npm and import it into a typescript file - run
npx tsc --build && npx tsc-alias
- Get a build error
Expected behavior
It should build properly
Logs
Here is the detailed error
../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts:59:15 - error TS2416: Property 'assertNotificationCapability' in type 'Server<RequestT, NotificationT, ResultT>' is not assignable to the same property in base type 'Protocol<ServerRequest | RequestT, ServerNotification | NotificationT, ServerResult | ResultT>'.
Type '(method: (import("/Users/dan/dev/backend-v3/node_modules/@modelcontextprotocol/sdk/dist/esm/types").ServerNotification | NotificationT)["method"]) => void' is not assignable to type '(method: (import("/Users/dan/dev/backend-v3/node_modules/@modelcontextprotocol/sdk/dist/esm/types").ServerNotification | NotificationT)["method"]) => void'. Two different types with this name exist, but they are unrelated.
Types of parameters 'method' and 'method' are incompatible.
Type '"notifications/cancelled" | "notifications/progress" | "notifications/resources/list_changed" | "notifications/resources/updated" | "notifications/prompts/list_changed" | "notifications/tools/list_changed" | "notifications/message" | NotificationT["method"]' is not assignable to type 'never'.
Type 'string' is not assignable to type 'never'.
59 protected assertNotificationCapability(method: (ServerNotification | NotificationT)["method"]): void;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error.