MCP SDK for TypeScript 2

Last reviewed Oct 11, 2026

Export as PDF

Prompt Details

Prompt Composition

4prompts
  1. JavaScript ES2026102 lines · 3.1K tokens
  2. Node.js 24101 lines · 5.3K tokens
  3. TypeScript 746 lines · 1.5K tokens
  4. MCP SDK for TypeScript 2139 lines · 6.5K tokens
Total388 lines · 16.4K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 88
  • 89
  • 95
  • 113
  • 117
  • 200
  • 201
  • 208
  • 209
  • 214
  • 250
  • 287
  • 295
  • 297
  • 306
  • 319
  • 323
  • 330
  • 338
  • 346
  • 347
  • 352
  • 354
  • 362
  • 367
  • 377
  • 426
  • 444
  • 459
  • 471
  • 488
  • 494
  • 502
  • 522
  • 524
  • 532
  • 602
  • 639
  • 653
  • 732
  • 754
  • 770
  • 807
  • 829
  • 838
  • 841
  • 862
  • 863
  • 908
  • 915
  • 916
  • 918
  • 922
  • 942
  • 943
  • 1004
  • 1321
  • 1333
  • 1427

Prompt Preview

Apply the Node.js 24 and TypeScript 7 prompts first. These rules cover the MCP SDK for TypeScript 2 package family — @modelcontextprotocol/server, @modelcontextprotocol/client, @modelcontextprotocol/core, and the node, express, fastify, and hono middleware adapters — and were checked against 2.0.0, which released them all together for protocol revision 2026-07-28. Where a later 2.x release changed a default or closed a hole, the rule names that release.

Package selection and version scope

  • On @modelcontextprotocol/client 2.0.0 and 2.1.0, which predate the 2.2.0 issuer-binding fix, an OAuth client over HTTP can send a stored refresh_token or client_secret, or a bundled provider's secret or signed client assertion, to an authorization server that a hostile MCP server names. Until every such client is upgraded, connect it only to MCP servers you trust and pass expectedIssuer to every bundled provider; both releases already accept it.
  • On @modelcontextprotocol/client 2.0.0 through 2.2.0, which predate the 2.3.0 redirect fix, the HTTP client transports, auth(), and the OAuth and cross-app access helpers follow redirects to any origin, and requestInit.redirect misses some requests, such as the GET opening an SSEClientTransport stream. On those releases pass a redirect-refusing fetch, such as (url, init) => fetch(url, { ...init, redirect: 'error' }), as each transport's fetch, any eventSourceInit.fetch, the fetch withOAuth() wraps, each OAuth function's fetchFn, and a CrossAppAccessProvider's fetchFn, whose assertion callback