docs: comprehensive GA pass — stable-release wording, released-spec links, install tags (#2566)
This commit is contained in:
parent
f6fbd48e0c
commit
a9835b4149
8 changed files with 51 additions and 52 deletions
|
|
@ -4,7 +4,7 @@ The MCP (Model Context Protocol) TypeScript client SDK. Build MCP clients that c
|
|||
|
||||
<!-- prettier-ignore -->
|
||||
> [!WARNING]
|
||||
> **This is a beta release.** The API surface is settling but breaking changes remain possible until v2 stabilizes. Please try it and open issues — feedback during the beta directly shapes the stable release.
|
||||
> **v2 is the stable release line**, implementing the [2026-07-28 MCP spec](https://modelcontextprotocol.io/specification/2026-07-28). Migrating from v1? Start with the [migration guide](https://ts.sdk.modelcontextprotocol.io/v2/migration/).
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
|
|
@ -13,7 +13,7 @@ The MCP (Model Context Protocol) TypeScript client SDK. Build MCP clients that c
|
|||
## Install
|
||||
|
||||
```bash
|
||||
npm install @modelcontextprotocol/client@beta
|
||||
npm install @modelcontextprotocol/client
|
||||
```
|
||||
|
||||
TypeScript ≥6.0 no longer auto-includes `@types/*` — add `"types": ["node"]` to your `tsconfig.json` `compilerOptions` (the published `.d.mts` references `Buffer`).
|
||||
|
|
|
|||
|
|
@ -572,7 +572,7 @@ export interface CrossAppAccessProviderOptions {
|
|||
* a callback function that you provide. This allows flexibility in how you obtain and
|
||||
* cache ID Tokens from the IdP.
|
||||
*
|
||||
* @see https://github.com/modelcontextprotocol/ext-auth/blob/main/specification/draft/enterprise-managed-authorization.mdx
|
||||
* @see https://github.com/modelcontextprotocol/ext-auth/blob/main/specification/stable/enterprise-managed-authorization.mdx
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Provides standalone functions for RFC 8693 Token Exchange and RFC 7523 JWT Authorization Grant
|
||||
* flows as specified in the Enterprise Managed Authorization specification (SEP-990).
|
||||
*
|
||||
* @see https://github.com/modelcontextprotocol/ext-auth/blob/main/specification/draft/enterprise-managed-authorization.mdx
|
||||
* @see https://github.com/modelcontextprotocol/ext-auth/blob/main/specification/stable/enterprise-managed-authorization.mdx
|
||||
* @module
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ Codemods for migrating MCP TypeScript SDK code between major versions.
|
|||
## Usage
|
||||
|
||||
```bash
|
||||
npx @modelcontextprotocol/codemod@beta v1-to-v2 .
|
||||
npx @modelcontextprotocol/codemod@latest v1-to-v2 .
|
||||
|
||||
# or a single source file (manifest changes are reported, not applied)
|
||||
npx @modelcontextprotocol/codemod@beta v1-to-v2 src/server.ts
|
||||
npx @modelcontextprotocol/codemod@latest v1-to-v2 src/server.ts
|
||||
```
|
||||
|
||||
The codemod rewrites TypeScript and JavaScript source files
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ export const RequestMetaSchema = z.looseObject({
|
|||
*/
|
||||
export const BaseRequestParamsSchema = z.object({
|
||||
/**
|
||||
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
||||
* See [General fields: `_meta`](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#meta) for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: RequestMetaSchema.optional()
|
||||
});
|
||||
|
|
@ -78,7 +78,7 @@ export const RequestSchema = z.object({
|
|||
|
||||
export const NotificationsParamsSchema = z.object({
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: RequestMetaSchema.optional()
|
||||
|
|
@ -113,7 +113,7 @@ export const ResultMetaObjectSchema = z.looseObject({
|
|||
|
||||
export const ResultSchema = z.looseObject({
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: ResultMetaObjectSchema.optional()
|
||||
|
|
@ -695,7 +695,7 @@ export const ResourceContentsSchema = z.object({
|
|||
*/
|
||||
mimeType: z.optional(z.string()),
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: z.record(z.string(), z.unknown()).optional()
|
||||
|
|
@ -795,7 +795,7 @@ export const ResourceSchema = z.object({
|
|||
annotations: AnnotationsSchema.optional(),
|
||||
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: z.optional(z.looseObject({}))
|
||||
|
|
@ -830,7 +830,7 @@ export const ResourceTemplateSchema = z.object({
|
|||
annotations: AnnotationsSchema.optional(),
|
||||
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: z.optional(z.looseObject({}))
|
||||
|
|
@ -1054,7 +1054,7 @@ export const PromptSchema = z.object({
|
|||
*/
|
||||
arguments: z.optional(z.array(PromptArgumentSchema)),
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: z.optional(z.looseObject({}))
|
||||
|
|
@ -1111,7 +1111,7 @@ export const TextContentSchema = z.object({
|
|||
annotations: AnnotationsSchema.optional(),
|
||||
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: z.record(z.string(), z.unknown()).optional()
|
||||
|
|
@ -1137,7 +1137,7 @@ export const ImageContentSchema = z.object({
|
|||
annotations: AnnotationsSchema.optional(),
|
||||
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: z.record(z.string(), z.unknown()).optional()
|
||||
|
|
@ -1163,7 +1163,7 @@ export const AudioContentSchema = z.object({
|
|||
annotations: AnnotationsSchema.optional(),
|
||||
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: z.record(z.string(), z.unknown()).optional()
|
||||
|
|
@ -1195,7 +1195,7 @@ export const ToolUseContentSchema = z.object({
|
|||
*/
|
||||
input: z.record(z.string(), z.unknown()),
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: z.record(z.string(), z.unknown()).optional()
|
||||
|
|
@ -1212,7 +1212,7 @@ export const EmbeddedResourceSchema = z.object({
|
|||
*/
|
||||
annotations: AnnotationsSchema.optional(),
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: z.record(z.string(), z.unknown()).optional()
|
||||
|
|
@ -1375,7 +1375,7 @@ export const ToolSchema = z.object({
|
|||
execution: ToolExecutionSchema.optional(),
|
||||
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: z.record(z.string(), z.unknown()).optional()
|
||||
|
|
@ -1649,7 +1649,7 @@ export const ToolResultContentSchema = z.object({
|
|||
isError: z.boolean().optional(),
|
||||
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: z.record(z.string(), z.unknown()).optional()
|
||||
|
|
@ -1692,7 +1692,7 @@ export const SamplingMessageSchema = z.object({
|
|||
role: RoleSchema,
|
||||
content: z.union([SamplingMessageContentBlockSchema, z.array(SamplingMessageContentBlockSchema)]),
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: z.record(z.string(), z.unknown()).optional()
|
||||
|
|
@ -2179,7 +2179,7 @@ export const RootSchema = z.object({
|
|||
name: z.string().optional(),
|
||||
|
||||
/**
|
||||
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
||||
* See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
|
||||
* for notes on `_meta` usage.
|
||||
*/
|
||||
_meta: z.record(z.string(), z.unknown()).optional()
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ They intentionally **do not** add new MCP features or “business logic”. MCP
|
|||
## Packages
|
||||
|
||||
- `@modelcontextprotocol/express` — Express helpers (app defaults + Host header validation for DNS rebinding protection).
|
||||
- `@modelcontextprotocol/fastify` — Fastify helpers (app defaults + Host header validation).
|
||||
- `@modelcontextprotocol/hono` — Hono helpers (app defaults + JSON body parsing hook + Host header validation).
|
||||
- `@modelcontextprotocol/node` — Node.js Streamable HTTP transport wrapper for `IncomingMessage`/`ServerResponse`.
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ The MCP (Model Context Protocol) TypeScript server SDK. Build MCP servers that e
|
|||
|
||||
<!-- prettier-ignore -->
|
||||
> [!WARNING]
|
||||
> **This is a beta release.** The API surface is settling but breaking changes remain possible until v2 stabilizes. Please try it and open issues — feedback during the beta directly shapes the stable release.
|
||||
> **v2 is the stable release line**, implementing the [2026-07-28 MCP spec](https://modelcontextprotocol.io/specification/2026-07-28). Migrating from v1? Start with the [migration guide](https://ts.sdk.modelcontextprotocol.io/v2/migration/).
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
|
|
@ -13,12 +13,12 @@ The MCP (Model Context Protocol) TypeScript server SDK. Build MCP servers that e
|
|||
## Install
|
||||
|
||||
```bash
|
||||
npm install @modelcontextprotocol/server@beta
|
||||
npm install @modelcontextprotocol/server
|
||||
```
|
||||
|
||||
TypeScript ≥6.0 no longer auto-includes `@types/*` — add `"types": ["node"]` to your `tsconfig.json` `compilerOptions` (the published `.d.mts` references `Buffer`).
|
||||
|
||||
Optional framework adapters: [`@modelcontextprotocol/express`](https://www.npmjs.com/package/@modelcontextprotocol/express), [`@modelcontextprotocol/hono`](https://www.npmjs.com/package/@modelcontextprotocol/hono),
|
||||
Optional framework adapters: [`@modelcontextprotocol/express`](https://www.npmjs.com/package/@modelcontextprotocol/express), [`@modelcontextprotocol/fastify`](https://www.npmjs.com/package/@modelcontextprotocol/fastify), [`@modelcontextprotocol/hono`](https://www.npmjs.com/package/@modelcontextprotocol/hono),
|
||||
[`@modelcontextprotocol/node`](https://www.npmjs.com/package/@modelcontextprotocol/node).
|
||||
|
||||
## Documentation
|
||||
|
|
|
|||
|
|
@ -1238,7 +1238,7 @@ export class Server extends Protocol<ServerContext> {
|
|||
* notification for the specified elicitation ID.
|
||||
*
|
||||
* The notification (and the `elicitationId` it references) exists only on protocol revision
|
||||
* 2025-11-25 — the 2026-07-28 draft removed both. On a connection negotiated at 2026-07-28 the
|
||||
* 2025-11-25 — the 2026-07-28 revision removed both. On a connection negotiated at 2026-07-28 the
|
||||
* returned callback rejects with a typed local error before anything reaches the transport
|
||||
* (the method is not part of that revision's wire registry).
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue