MCP SDK for TypeScript 1

Last reviewed Sep 6, 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 173 lines · 2.8K tokens
Total322 lines · 12.7K 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
  • 613
  • 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 MCP SDK for TypeScript 1 transports, authentication, tools, resources, prompts, sampling, elicitation, sessions, and deployment, and were checked against 1.30.0 and 1.30.1.

Transports and authentication

  • Use Streamable HTTP for remote servers and keep stdio inside a trusted local process boundary; do not expose stdio through an unauthenticated bridge.
  • Set enableDnsRebindingProtection: true on WebStandardStreamableHTTPServerTransport; it defaults false, so allowedHosts and allowedOrigins are otherwise not enforced.
  • Populate both host and origin allowlists and bind to loopback for local servers; reject absent or unexpected Origin in middleware on browser-reachable endpoints, since the transport accepts an absent Origin.
  • Enforce request-body limits before handleRequest or supplying parsedBody: 1.30.0's Streamable HTTP has no built-in byte limit, 1.30.1's maxRequestBodySize (4 MiB by default, answered with 413) is skipped when you supply parsedBody, and pre-parsing also bypasses legacy SSEServerTransport's 4mb read limit.
  • Validate OAuth issuer, signature, expiry, scopes, and resource/audience for this MCP server; implement the specification's resource parameter handling.
  • For protected HTTP servers, publish RFC 9728 protected-resource metadata and return a WWW-Authenticate challenge on 401; use 403 plus error="insufficient_scope" and the minimum required scope for step-up rather than silently broadening access.
  • Never forward the MCP client's bearer token to an