Skip to content
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
6 changes: 6 additions & 0 deletions .changeset/export-inmemory-transport.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modelcontextprotocol/server': patch
'@modelcontextprotocol/client': patch
---

Export `InMemoryTransport` for in-process testing.
1 change: 1 addition & 0 deletions packages/core/src/exports/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
// Transport types (NOT normalizeHeaders)
export type { FetchLike, Transport, TransportSendOptions } from '../../shared/transport.js';
export { createFetchWithInit } from '../../shared/transport.js';
Comment thread
claude[bot] marked this conversation as resolved.
export { InMemoryTransport } from '../../util/inMemory.js';

Check warning on line 73 in packages/core/src/exports/public/index.ts

View check run for this annotation

Claude / Claude Code Review

migration.md InMemoryTransport section now contradicts implementation

nit: Now that the doc edits have been split out to the F1 migration-guide PR, this PR adds `InMemoryTransport` to the public barrel while `docs/migration.md:472-484` still says "`InMemoryTransport` removed from public API" and tells users to import from the internal `@modelcontextprotocol/core` package. Since the description says "Stacks on: none", this can land independently of F1 and leave the migration guide actively contradicting the implementation — worth either including the minimal `migra
Comment thread
claude[bot] marked this conversation as resolved.

// URI Template
export type { Variables } from '../../shared/uriTemplate.js';
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/util/inMemory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ interface QueuedMessage {

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