Skip to content

Commit 6661467

Browse files
committed
feat(json)!: bump MCP_JSON_FORMAT_VERSION to '2'
All 9 tools now emit structured McpErrorEnvelope for failures instead of ad-hoc {error:string,...} shapes. The format version bump signals the breaking contract change to clients. Envelope shape: { error: { code, message, retryable, suggestedFix? } } Migration path for v1 consumers: before: if (r.error === 'not_found') ... after: if (r.error?.code === 'NOT_FOUND') ... Docs + idempotency follow in the next commit.
1 parent 4489423 commit 6661467

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/server/json.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import {
1414
} from "./json.js";
1515

1616
describe("MCP_JSON_FORMAT_VERSION", () => {
17-
test("is '1'", () => {
18-
expect(MCP_JSON_FORMAT_VERSION).toBe("1");
17+
test("is '2'", () => {
18+
expect(MCP_JSON_FORMAT_VERSION).toBe("2");
1919
});
2020
});
2121

src/server/json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { readFileSync } from "node:fs";
22
import { dirname, join } from "node:path";
33
import { fileURLToPath } from "node:url";
44

5-
export const MCP_JSON_FORMAT_VERSION = "1" as const;
5+
export const MCP_JSON_FORMAT_VERSION = "2" as const;
66

77
export function readPackageVersion(): string {
88
const here = dirname(fileURLToPath(import.meta.url));

0 commit comments

Comments
 (0)