MCP SDK for TypeScript 1
Last reviewed Sep 6, 2026
Prompt Details
Prompt Composition
4prompts
- JavaScript ES2026102 lines · 3.1K tokens
- Node.js 24101 lines · 5.3K tokens
- TypeScript 746 lines · 1.5K tokens
- 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: trueonWebStandardStreamableHTTPServerTransport; it defaults false, soallowedHostsandallowedOriginsare otherwise not enforced. - Populate both host and origin allowlists and bind to loopback for local servers; reject absent or unexpected
Originin middleware on browser-reachable endpoints, since the transport accepts an absentOrigin. - Enforce request-body limits before
handleRequestor supplyingparsedBody: 1.30.0's Streamable HTTP has no built-in byte limit, 1.30.1'smaxRequestBodySize(4 MiB by default, answered with 413) is skipped when you supplyparsedBody, and pre-parsing also bypasses legacySSEServerTransport's4mbread 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-Authenticatechallenge on 401; use 403 pluserror="insufficient_scope"and the minimum requiredscopefor step-up rather than silently broadening access. - Never forward the MCP client's bearer token to an