diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 000000000..fc88e51c1 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,4 @@ +export * from './types.js'; +export * from './client/index.js'; +export * from './server/index.js'; +export * from './inMemory.js'; diff --git a/test/index.test.ts b/test/index.test.ts new file mode 100644 index 000000000..656188a9c --- /dev/null +++ b/test/index.test.ts @@ -0,0 +1,15 @@ +import { describe, expect, it } from 'vitest'; + +import { Client, ErrorCode, InMemoryTransport, LATEST_PROTOCOL_VERSION, McpError, Server } from '../src/index.js'; + +describe('root package exports', () => { + it('re-exports the package root public API', () => { + expect(Client).toBeTypeOf('function'); + expect(Server).toBeTypeOf('function'); + expect(InMemoryTransport.createLinkedPair).toBeTypeOf('function'); + expect(LATEST_PROTOCOL_VERSION).toBeTypeOf('string'); + + const error = new McpError(ErrorCode.InvalidRequest, 'bad request'); + expect(error.code).toBe(ErrorCode.InvalidRequest); + }); +});