@modelcontextprotocol/server 2.0.0-alpha.2 → 2.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +10 -3
  2. package/dist/{src-IKPjmxu7.mjs → ajvProvider-BQMcjynJ.mjs} +4147 -6749
  3. package/dist/ajvProvider-BQMcjynJ.mjs.map +1 -0
  4. package/dist/ajvProvider-Dzgk80kq.d.mts +1030 -0
  5. package/dist/ajvProvider-Dzgk80kq.d.mts.map +1 -0
  6. package/dist/cfWorkerProvider-BDC2rVl3.mjs +970 -0
  7. package/dist/cfWorkerProvider-BDC2rVl3.mjs.map +1 -0
  8. package/dist/cfWorkerProvider-DmvjVsvQ.d.mts +59 -0
  9. package/dist/cfWorkerProvider-DmvjVsvQ.d.mts.map +1 -0
  10. package/dist/chunk-BRhqBsOc.mjs +42 -0
  11. package/dist/{index-Bhfkexnj.d.mts → createMcpHandler-Du3hjXvf.d.mts} +4702 -2249
  12. package/dist/createMcpHandler-Du3hjXvf.d.mts.map +1 -0
  13. package/dist/index.d.mts +177 -833
  14. package/dist/index.d.mts.map +1 -1
  15. package/dist/index.mjs +1349 -2067
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/mcp-JttQJlI9.mjs +9998 -0
  18. package/dist/mcp-JttQJlI9.mjs.map +1 -0
  19. package/dist/shimsNode.d.mts +1 -1
  20. package/dist/shimsNode.mjs +1 -1
  21. package/dist/shimsWorkerd.d.mts +1 -1
  22. package/dist/shimsWorkerd.mjs +1 -1
  23. package/dist/shimsWorkerd.mjs.map +1 -1
  24. package/dist/stdio.d.mts +107 -0
  25. package/dist/stdio.d.mts.map +1 -0
  26. package/dist/stdio.mjs +561 -0
  27. package/dist/stdio.mjs.map +1 -0
  28. package/dist/types-DBYdVs-n.d.mts +1099 -0
  29. package/dist/types-DBYdVs-n.d.mts.map +1 -0
  30. package/dist/validators/ajv.d.mts +2 -0
  31. package/dist/validators/ajv.mjs +4 -0
  32. package/dist/validators/cfWorker.d.mts +2 -0
  33. package/dist/validators/cfWorker.mjs +3 -0
  34. package/package.json +33 -17
  35. package/dist/index-Bhfkexnj.d.mts.map +0 -1
  36. package/dist/src-IKPjmxu7.mjs.map +0 -1
package/README.md CHANGED
@@ -2,9 +2,13 @@
2
2
 
3
3
  The MCP (Model Context Protocol) TypeScript server SDK. Build MCP servers that expose tools, resources, and prompts.
4
4
 
5
- > [!WARNING] **This is an alpha release.** Expect breaking changes until v2 stabilizes. We're publishing early to gather feedback — please try it and open issues — but we can't guarantee API stability yet. We'll aim to minimize disruption between alphas.
5
+ <!-- prettier-ignore -->
6
+ > [!WARNING]
7
+ > **This is an alpha release.** Expect breaking changes until v2 stabilizes. We're publishing early to gather feedback — please try it and open issues — but we can't guarantee API stability yet. We'll aim to minimize disruption between alphas.
6
8
 
7
- > [!NOTE] This is **v2** of the MCP TypeScript SDK. It replaces the monolithic `@modelcontextprotocol/sdk` package from v1. See the **[migration guide](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/docs/migration.md)** if you're coming from v1.
9
+ <!-- prettier-ignore -->
10
+ > [!NOTE]
11
+ > This is **v2** of the MCP TypeScript SDK. It replaces the monolithic `@modelcontextprotocol/sdk` package from v1. See the **[migration guide](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/docs/migration/upgrade-to-v2.md)** if you're coming from v1.
8
12
 
9
13
  ## Install
10
14
 
@@ -12,12 +16,15 @@ The MCP (Model Context Protocol) TypeScript server SDK. Build MCP servers that e
12
16
  npm install @modelcontextprotocol/server@alpha
13
17
  ```
14
18
 
19
+ TypeScript ≥6.0 no longer auto-includes `@types/*` — add `"types": ["node"]` to your `tsconfig.json` `compilerOptions` (the published `.d.mts` references `Buffer`).
20
+
15
21
  Optional framework adapters: [`@modelcontextprotocol/express`](https://www.npmjs.com/package/@modelcontextprotocol/express), [`@modelcontextprotocol/hono`](https://www.npmjs.com/package/@modelcontextprotocol/hono),
16
22
  [`@modelcontextprotocol/node`](https://www.npmjs.com/package/@modelcontextprotocol/node).
17
23
 
18
24
  ## Documentation
19
25
 
20
26
  - **[Repository README](https://github.com/modelcontextprotocol/typescript-sdk#readme)** — overview, package layout, examples
21
- - **[Server guide](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/docs/server.md)**
27
+ - **[Server guide](https://ts.sdk.modelcontextprotocol.io/v2/servers/tools)** — tools, resources, prompts, and the rest of the server surface
28
+ - **[Serving guide](https://ts.sdk.modelcontextprotocol.io/v2/serving/http)** — stdio, HTTP, the framework adapters, sessions, and authorization
22
29
  - **[API reference](https://ts.sdk.modelcontextprotocol.io/v2/)**
23
30
  - **[MCP specification](https://modelcontextprotocol.io)**