Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
5 changes: 4 additions & 1 deletion src/services/mcp-compatibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export function classifyMcpClientVersion(version: string | null | undefined): Mc
const minimumComparison = compareMcpSemver(version, MINIMUM_SUPPORTED_MCP_VERSION);
if (minimumComparison === null) return "unknown";
if (minimumComparison < 0) return "incompatible";
return "current";
// A version at/above the minimum but below the latest recommended is supported-but-behind → "stale".
// (The flat "current" was correct only while MINIMUM === LATEST_RECOMMENDED; #745 reopened the gap.)
const latestComparison = compareMcpSemver(version, LATEST_RECOMMENDED_MCP_VERSION)!;
return latestComparison < 0 ? "stale" : "current";
}

function parseSemver(version: string) {
Expand Down
9 changes: 7 additions & 2 deletions test/unit/mcp-compatibility.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ describe("MCP compatibility telemetry", () => {
expect(classifyMcpClientVersion("0.2.1")).toBe("incompatible");
expect(classifyMcpClientVersion("0.3.0")).toBe("incompatible");
expect(classifyMcpClientVersion("0.4.0")).toBe("incompatible");
expect(classifyMcpClientVersion("0.5.0")).toBe("current");
// >= minimum (0.5.0) but < latest recommended (0.6.0) → supported-but-behind → "stale".
expect(classifyMcpClientVersion("0.5.0")).toBe("stale");
expect(classifyMcpClientVersion("0.5.9")).toBe("stale");
// At/above the latest recommended → "current".
expect(classifyMcpClientVersion("0.6.0")).toBe("current");
expect(classifyMcpClientVersion("0.7.1")).toBe("current");
expect(classifyMcpClientVersion("not-a-version")).toBe("unknown");
expect(classifyMcpClientVersion(undefined)).toBe("unknown");
});
Expand Down Expand Up @@ -50,7 +55,7 @@ describe("MCP compatibility telemetry", () => {
clientVersion: "0.5.0",
metadata: {
packageName: "@example/custom-mcp",
compatibilityStatus: "current",
compatibilityStatus: "stale",
},
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/unit/mcp-server-telemetry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe("MCP server telemetry", () => {
clientVersion: "0.5.0",
metadata: expect.objectContaining({
toolName: "gittensory_local_status",
compatibilityStatus: "current",
compatibilityStatus: "stale",
}),
}),
]);
Expand Down