Skip to content

Commit 7e80880

Browse files
Merge branch 'main' into fweinberger/v2-bc-register-rawshape
2 parents 0febd83 + 42cb6b2 commit 7e80880

4 files changed

Lines changed: 16 additions & 8 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@modelcontextprotocol/server': patch
3+
'@modelcontextprotocol/client': patch
4+
---
5+
6+
Export `InMemoryTransport` for in-process testing.

docs/migration.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -469,22 +469,20 @@ const client = new Client(
469469
);
470470
```
471471

472-
### `InMemoryTransport` removed from public API
472+
### `InMemoryTransport` moved
473473

474-
`InMemoryTransport` has been removed from the public API surface. It was previously used for in-process client-server connections and testing.
475-
476-
For **testing**, import it directly from the internal core package:
474+
`InMemoryTransport` is now exported from `@modelcontextprotocol/client` and `@modelcontextprotocol/server` (both re-export it). It is still intended for in-process client-server connections and testing.
477475

478476
```typescript
479477
// v1
480478
import { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';
481479

482-
// v2 (testing only — @modelcontextprotocol/core is internal, not for production use)
483-
import { InMemoryTransport } from '@modelcontextprotocol/core';
480+
// v2
481+
import { InMemoryTransport } from '@modelcontextprotocol/server';
482+
// or
483+
import { InMemoryTransport } from '@modelcontextprotocol/client';
484484
```
485485

486-
For **production in-process connections**, use `StreamableHTTPClientTransport` with a local server URL, or connect client and server via paired streams.
487-
488486
### Removed type aliases and deprecated exports
489487

490488
The following deprecated type aliases have been removed from `@modelcontextprotocol/core`:

packages/core/src/exports/public/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export { deserializeMessage, ReadBuffer, serializeMessage } from '../../shared/s
7070
// Transport types (NOT normalizeHeaders)
7171
export type { FetchLike, Transport, TransportSendOptions } from '../../shared/transport.js';
7272
export { createFetchWithInit } from '../../shared/transport.js';
73+
export { InMemoryTransport } from '../../util/inMemory.js';
7374

7475
// URI Template
7576
export type { Variables } from '../../shared/uriTemplate.js';

packages/core/src/util/inMemory.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ interface QueuedMessage {
99

1010
/**
1111
* In-memory transport for creating clients and servers that talk to each other within the same process.
12+
*
13+
* Intended for testing and development. For production in-process connections, use
14+
* `StreamableHTTPClientTransport` against a local server URL.
1215
*/
1316
export class InMemoryTransport implements Transport {
1417
private _otherTransport?: InMemoryTransport;

0 commit comments

Comments
 (0)