Skip to content

Commit 6f398c0

Browse files
chore(sdk): lint:fix import-type-specifier + sort after rebase
1 parent fbfdda6 commit 6f398c0

3 files changed

Lines changed: 14 additions & 21 deletions

File tree

packages/sdk/src/compatWrappers.ts

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,10 @@
55
// Only the meta-package provides this overload, by design — the underlying
66
// `@modelcontextprotocol/{server,client}` packages stay on the v2 API.
77

8-
import {
9-
Client as BaseClient,
10-
type ClientContext,
11-
type NotificationMethod,
12-
type RequestMethod,
13-
type Result,
14-
type StandardSchemaV1
15-
} from '@modelcontextprotocol/client';
16-
import {
17-
McpServer as BaseMcpServer,
18-
type RequestHandlerSchemas,
19-
type ResultTypeMap,
20-
Server as BaseServer,
21-
type ServerContext,
22-
type ServerOptions
23-
} from '@modelcontextprotocol/server';
8+
import type { ClientContext, NotificationMethod, RequestMethod, Result, StandardSchemaV1 } from '@modelcontextprotocol/client';
9+
import { Client as BaseClient } from '@modelcontextprotocol/client';
10+
import type { RequestHandlerSchemas, ResultTypeMap, ServerContext, ServerOptions } from '@modelcontextprotocol/server';
11+
import { McpServer as BaseMcpServer, Server as BaseServer } from '@modelcontextprotocol/server';
2412
import type * as z from 'zod';
2513

2614
type ZodRequestSchema<M extends string = string> = z.ZodObject<{ method: z.ZodLiteral<M> } & z.ZodRawShape>;
@@ -70,7 +58,9 @@ function withV1SchemaOverloads<
7058
handler: (
7159
params: StandardSchemaV1.InferOutput<P>,
7260
ctx: Ctx
73-
) => R extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<R> | Promise<StandardSchemaV1.InferOutput<R>> : Result | Promise<Result>
61+
) => R extends StandardSchemaV1
62+
? StandardSchemaV1.InferOutput<R> | Promise<StandardSchemaV1.InferOutput<R>>
63+
: Result | Promise<Result>
7464
): void;
7565
override setRequestHandler(arg1: string | ZodRequestSchema, arg2: unknown, arg3?: unknown): void {
7666
if (typeof arg1 === 'string') {
@@ -82,7 +72,10 @@ function withV1SchemaOverloads<
8272

8373
/** v1 compat: accepts a Zod notification schema with a `method` literal as the first arg. */
8474
override setNotificationHandler<S extends ZodNotificationSchema>(schema: S, handler: LegacyNotificationHandler<S>): void;
85-
override setNotificationHandler<M extends NotificationMethod>(method: M, handler: (notification: unknown) => void | Promise<void>): void;
75+
override setNotificationHandler<M extends NotificationMethod>(
76+
method: M,
77+
handler: (notification: unknown) => void | Promise<void>
78+
): void;
8679
override setNotificationHandler<P extends StandardSchemaV1>(
8780
method: string,
8881
schemas: { params: P },

packages/sdk/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export { NodeStreamableHTTPServerTransport as StreamableHTTPServerTransport } fr
2323
// Client-specific exports only — NOT `export *`, because client also re-exports
2424
// core/public and the duplicate runtime-value identities (each package bundles
2525
// core separately) trigger TS2308. core/public is already covered by server above.
26+
export { Client } from './compatWrappers.js';
2627
export type {
2728
AddClientAuthentication,
2829
AssertionCallback,
@@ -89,4 +90,3 @@ export {
8990
withLogging,
9091
withOAuth
9192
} from '@modelcontextprotocol/client';
92-
export { Client } from './compatWrappers.js';

packages/sdk/src/server/mcp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export { McpServer } from '../compatWrappers.js';
12
export {
23
type AnyToolHandler,
34
type BaseToolCallback,
@@ -6,9 +7,9 @@ export {
67
type CompleteCallback,
78
type CompleteResourceTemplateCallback,
89
isCompletable,
9-
type ListResourcesCallback,
1010
type PromptCallback as LegacyPromptCallback,
1111
type ToolCallback as LegacyToolCallback,
12+
type ListResourcesCallback,
1213
type PromptCallback,
1314
type ReadResourceCallback,
1415
type ReadResourceTemplateCallback,
@@ -20,4 +21,3 @@ export {
2021
ResourceTemplate,
2122
type ToolCallback
2223
} from '@modelcontextprotocol/server';
23-
export { McpServer } from '../compatWrappers.js';

0 commit comments

Comments
 (0)