Add typings exports (#1623)

This commit is contained in:
Thomas Draier 2026-03-26 21:36:24 +01:00 • committed by GitHub
commit c95cc0943b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'@modelcontextprotocol/sdk': patch
---
Add `"types"` condition to `exports` map for subpath imports (`.`, `./client`, `./server`, `./*`), enabling TypeScript to resolve type declarations with `moduleResolution: "bundler"` or `"node16"` without requiring manual `tsconfig.json` `paths` workarounds.

View file

@ -20,14 +20,17 @@
],
"exports": {
".": {
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"./client": {
"types": "./dist/esm/client/index.d.ts",
"import": "./dist/esm/client/index.js",
"require": "./dist/cjs/client/index.js"
},
"./server": {
"types": "./dist/esm/server/index.d.ts",
"import": "./dist/esm/server/index.js",
"require": "./dist/cjs/server/index.js"
},
@ -52,6 +55,7 @@
"require": "./dist/cjs/experimental/tasks/index.js"
},
"./*": {
"types": "./dist/esm/*.d.ts",
"import": "./dist/esm/*",
"require": "./dist/cjs/*"
}