Skip to content

Commit ea36d69

Browse files
docs: v2 follow-up improvements
- Add v2 development notice at top of README - Fix npm badge URLs (add missing %2F encoding) - Update CONTRIBUTING.md for pnpm/corepack workflow - Document branch strategy (main vs v1.x) - Remove InMemoryEventStore from server exports (inline in test instead)
1 parent 81a8288 commit ea36d69

File tree

4 files changed

+40
-81
lines changed

4 files changed

+40
-81
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# MCP TypeScript SDK
22

33
> [!IMPORTANT]
4-
> **This is the `main` branch which contains v2 of the SDK (currently in development).**
4+
> **This is the `main` branch which contains v2 of the SDK (currently in development, pre-alpha).**
55
>
6-
> For the stable v1 release, see the [`v1.x` branch](https://github.com/modelcontextprotocol/typescript-sdk/tree/v1.x) and its documentation.
6+
> We anticipate a stable v2 release in Q1 2026. Until then, **v1.x remains the recommended version** for production use. v1.x will continue to receive bug fixes and security updates for at least 6 months after v2 ships to give people time to upgrade.
7+
>
8+
> For v1 documentation and code, see the [`v1.x` branch](https://github.com/modelcontextprotocol/typescript-sdk/tree/v1.x).
79
810
![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%2Fserver) ![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%2Fclient) ![MIT licensed](https://img.shields.io/npm/l/%40modelcontextprotocol%2Fserver)
911

test/helpers/src/helpers/inMemoryEventStore.ts

Lines changed: 0 additions & 77 deletions
This file was deleted.

test/helpers/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export * from './fixtures/zodTestMatrix.js';
22
export * from './helpers/http.js';
3-
export * from './helpers/inMemoryEventStore.js';
43
export * from './helpers/oauth.js';
54
export * from './helpers/tasks.js';

test/integration/test/taskResumability.test.ts

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,43 @@ import {
88
McpServer,
99
StreamableHTTPServerTransport
1010
} from '@modelcontextprotocol/server';
11+
import type { EventStore, JSONRPCMessage } from '@modelcontextprotocol/server';
1112
import type { ZodMatrixEntry } from '@modelcontextprotocol/test-helpers';
12-
import { InMemoryEventStore, listenOnRandomPort, zodTestMatrix } from '@modelcontextprotocol/test-helpers';
13+
import { listenOnRandomPort, zodTestMatrix } from '@modelcontextprotocol/test-helpers';
14+
15+
/**
16+
* Simple in-memory EventStore for testing resumability.
17+
*/
18+
class InMemoryEventStore implements EventStore {
19+
private events = new Map<string, { streamId: string; message: JSONRPCMessage }>();
20+
21+
async storeEvent(streamId: string, message: JSONRPCMessage): Promise<string> {
22+
const eventId = `${streamId}_${Date.now()}_${Math.random().toString(36).slice(2, 10)}`;
23+
this.events.set(eventId, { streamId, message });
24+
return eventId;
25+
}
26+
27+
async replayEventsAfter(
28+
lastEventId: string,
29+
{ send }: { send: (eventId: string, message: JSONRPCMessage) => Promise<void> }
30+
): Promise<string> {
31+
if (!lastEventId || !this.events.has(lastEventId)) return '';
32+
const streamId = lastEventId.split('_')[0] ?? '';
33+
if (!streamId) return '';
34+
35+
let found = false;
36+
const sorted = [...this.events.entries()].sort((a, b) => a[0].localeCompare(b[0]));
37+
for (const [eventId, { streamId: sid, message }] of sorted) {
38+
if (sid !== streamId) continue;
39+
if (eventId === lastEventId) {
40+
found = true;
41+
continue;
42+
}
43+
if (found) await send(eventId, message);
44+
}
45+
return streamId;
46+
}
47+
}
1348

1449
describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
1550
const { z } = entry;

0 commit comments

Comments
 (0)