Skip to content

Update protocol version #410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/client/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("OAuth Authorization", () => {
const [url, options] = calls[0];
expect(url.toString()).toBe("https://auth.example.com/.well-known/oauth-authorization-server");
expect(options.headers).toEqual({
"MCP-Protocol-Version": "2024-11-05"
"MCP-Protocol-Version": "2025-03-26"
});
});

Expand Down Expand Up @@ -478,4 +478,4 @@ describe("OAuth Authorization", () => {
).rejects.toThrow("Dynamic client registration failed");
});
});
});
});
17 changes: 17 additions & 0 deletions src/types.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { LATEST_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS } from "./types.js";

describe("Types", () => {

test("should have correct latest protocol version", () => {
expect(LATEST_PROTOCOL_VERSION).toBeDefined();
expect(LATEST_PROTOCOL_VERSION).toBe("2025-03-26");
});
test("should have correct supported protocol versions", () => {
expect(SUPPORTED_PROTOCOL_VERSIONS).toBeDefined();
expect(SUPPORTED_PROTOCOL_VERSIONS).toBeInstanceOf(Array);
expect(SUPPORTED_PROTOCOL_VERSIONS).toContain(LATEST_PROTOCOL_VERSION);
expect(SUPPORTED_PROTOCOL_VERSIONS).toContain("2024-11-05");
expect(SUPPORTED_PROTOCOL_VERSIONS).toContain("2024-10-07");
});

});
25 changes: 13 additions & 12 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { z, ZodTypeAny } from "zod";

export const LATEST_PROTOCOL_VERSION = "2024-11-05";
export const LATEST_PROTOCOL_VERSION = "2025-03-26";
export const SUPPORTED_PROTOCOL_VERSIONS = [
LATEST_PROTOCOL_VERSION,
"2024-11-05",
"2024-10-07",
];

Expand Down Expand Up @@ -754,11 +755,11 @@ export const PromptListChangedNotificationSchema = NotificationSchema.extend({
/* Tools */
/**
* Additional properties describing a Tool to clients.
*
* NOTE: all properties in ToolAnnotations are **hints**.
* They are not guaranteed to provide a faithful description of
*
* NOTE: all properties in ToolAnnotations are **hints**.
* They are not guaranteed to provide a faithful description of
* tool behavior (including descriptive properties like `title`).
*
*
* Clients should never make tool use decisions based on ToolAnnotations
* received from untrusted servers.
*/
Expand All @@ -771,27 +772,27 @@ export const ToolAnnotationsSchema = z

/**
* If true, the tool does not modify its environment.
*
*
* Default: false
*/
readOnlyHint: z.optional(z.boolean()),

/**
* If true, the tool may perform destructive updates to its environment.
* If false, the tool performs only additive updates.
*
*
* (This property is meaningful only when `readOnlyHint == false`)
*
*
* Default: true
*/
destructiveHint: z.optional(z.boolean()),

/**
* If true, calling the tool repeatedly with the same arguments
* If true, calling the tool repeatedly with the same arguments
* will have no additional effect on the its environment.
*
*
* (This property is meaningful only when `readOnlyHint == false`)
*
*
* Default: false
*/
idempotentHint: z.optional(z.boolean()),
Expand All @@ -801,7 +802,7 @@ export const ToolAnnotationsSchema = z
* entities. If false, the tool's domain of interaction is closed.
* For example, the world of a web search tool is open, whereas that
* of a memory tool is not.
*
*
* Default: true
*/
openWorldHint: z.optional(z.boolean()),
Expand Down