Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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: 5 additions & 0 deletions .changeset/node-transport-v1-aliases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modelcontextprotocol/node': patch
---

Add v1-compat re-exports: `StreamableHTTPServerTransport` (alias for `NodeStreamableHTTPServerTransport`) and the `EventStore` / `EventId` / `StreamId` types, so v1 imports from `@modelcontextprotocol/sdk/server/streamableHttp.js` map cleanly onto `@modelcontextprotocol/node`.
7 changes: 7 additions & 0 deletions packages/middleware/node/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
export * from './streamableHttp.js';

// v1-compat re-exports.
export {
/** @deprecated Use {@linkcode NodeStreamableHTTPServerTransport}. */
NodeStreamableHTTPServerTransport as StreamableHTTPServerTransport
} from './streamableHttp.js';

Check failure on line 7 in packages/middleware/node/src/index.ts

View check run for this annotation

Claude / Claude Code Review

@deprecated still stripped from published .d.mts — 'Fixed' resolution incomplete

The "Fixed" resolution restored `@deprecated` only as inline JSDoc on the export *specifier* — tsdown's dts bundler still flattens that into a bare `NodeStreamableHTTPServerTransport as StreamableHTTPServerTransport` with no JSDoc (verified: `dist/index.d.mts:516`, and `grep -in deprecated dist/index.d.mts` finds only the unrelated DNS-rebinding option deprecations at 364/370/376). Consumers of the published package still get no IDE strikethrough / `no-deprecated` lint warning. Switch to the `ex
Comment thread
claude[bot] marked this conversation as resolved.
Outdated
export type { EventId, EventStore, StreamId } from '@modelcontextprotocol/server';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the direction is right - EventStore is already exported from '@modelcontextprotocol/server' and the premise of the node middleware package isn't that users should only work with it.

They should be importing both the node middleware, and the server package. In which case they already have the access readily to them from the server package.

19 changes: 19 additions & 0 deletions packages/middleware/node/test/compat.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { describe, expect, expectTypeOf, it } from 'vitest';

import { NodeStreamableHTTPServerTransport, StreamableHTTPServerTransport } from '../src/index.js';
import type { EventId, EventStore, StreamId } from '../src/index.js';

describe('v1 compat exports from @modelcontextprotocol/node', () => {
it('StreamableHTTPServerTransport aliases NodeStreamableHTTPServerTransport', () => {
expect(StreamableHTTPServerTransport).toBe(NodeStreamableHTTPServerTransport);
expectTypeOf<StreamableHTTPServerTransport>().toEqualTypeOf<NodeStreamableHTTPServerTransport>();
});

it('re-exports EventStore / EventId / StreamId types', () => {
// Type-level assertions: these compile only if the types are exported.
expectTypeOf<EventId>().toBeString();
expectTypeOf<StreamId>().toBeString();
expectTypeOf<EventStore>().toHaveProperty('storeEvent');
expectTypeOf<EventStore>().toHaveProperty('replayEventsAfter');
});
});
Loading