Skip to content

Commit df11e5e

Browse files
committed
refactor: simplify server helper imports
1 parent 729caac commit df11e5e

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/server/index.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
*/
66

77
import {
8-
RESOURCE_URI_META_KEY as _RESOURCE_URI_META_KEY,
8+
RESOURCE_URI_META_KEY,
9+
RESOURCE_MIME_TYPE,
910
McpUiResourceMeta,
1011
McpUiToolMeta,
11-
RESOURCE_MIME_TYPE,
1212
} from "../app.js";
1313
import type {
1414
McpServer,
@@ -19,13 +19,10 @@ import type {
1919
import type { ToolAnnotations } from "@modelcontextprotocol/sdk/types.js";
2020
import type { ZodRawShape } from "zod";
2121

22-
// Re-export SDK types for convenience
22+
// Re-exports for convenience
23+
export { RESOURCE_URI_META_KEY, RESOURCE_MIME_TYPE };
2324
export type { ResourceMetadata, ToolCallback, ReadResourceCallback };
2425

25-
// Re-export for convenience
26-
export const RESOURCE_URI_META_KEY = _RESOURCE_URI_META_KEY;
27-
export { RESOURCE_MIME_TYPE };
28-
2926
/**
3027
* Tool configuration (same as McpServer.registerTool).
3128
*/
@@ -43,17 +40,20 @@ export interface ToolConfig {
4340
export interface McpUiAppToolConfig extends ToolConfig {
4441
_meta: {
4542
[key: string]: unknown;
46-
} & ({
47-
ui: McpUiToolMeta;
48-
} | {
49-
/**
50-
* URI of the UI resource to display for this tool.
51-
* This is converted to `_meta["ui/resourceUri"]`.
52-
*
53-
* @example "ui://weather/widget.html"
54-
*/
55-
[RESOURCE_URI_META_KEY]?: string;
56-
});
43+
} & (
44+
| {
45+
ui: McpUiToolMeta;
46+
}
47+
| {
48+
/**
49+
* URI of the UI resource to display for this tool.
50+
* This is converted to `_meta["ui/resourceUri"]`.
51+
*
52+
* @example "ui://weather/widget.html"
53+
*/
54+
[RESOURCE_URI_META_KEY]?: string;
55+
}
56+
);
5757
}
5858

5959
/**

0 commit comments

Comments
 (0)