@tsed/cli-mcp 7.0.0-beta.3 → 7.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,9 +37,7 @@ export declare function definePrompt(options: PromptProps): import("@tsed/cli-co
37
37
  handler(...args: any[]): Promise<any>;
38
38
  title?: string;
39
39
  description?: string;
40
- argsSchema?: {
41
- [k: string]: import("zod").ZodType<string, import("zod").ZodTypeDef, string> | import("zod").ZodOptional<import("zod").ZodType<string, import("zod").ZodTypeDef, string>>;
42
- } | undefined;
40
+ argsSchema?: import("@modelcontextprotocol/sdk/server/zod-compat.js").ZodRawShapeCompat | undefined;
43
41
  token?: TokenProvider;
44
42
  name: string;
45
43
  }>;
@@ -1,16 +1,15 @@
1
- import type { ReadResourceCallback, ResourceMetadata } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import type { ReadResourceCallback, ResourceMetadata, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { type TokenProvider } from "@tsed/di";
3
3
  type ResourceBaseProps = ResourceMetadata & {
4
4
  token?: TokenProvider;
5
5
  name: string;
6
+ handler: ReadResourceCallback;
6
7
  };
7
8
  type ResourceReadProps = ResourceBaseProps & {
8
9
  uri: string;
9
- handler: ReadResourceCallback;
10
10
  };
11
11
  type ResourceTemplateProps = ResourceBaseProps & {
12
- uri: string;
13
- handler: ReadResourceCallback;
12
+ template: ResourceTemplate;
14
13
  };
15
14
  export type ResourceProps = ResourceReadProps | ResourceTemplateProps;
16
15
  /**
@@ -8,7 +8,7 @@ type ToolConfig = Parameters<McpServer["registerTool"]>[1];
8
8
  export type ToolProps<Input, Output> = Omit<ToolConfig, "inputSchema" | "outputSchema"> & {
9
9
  token?: TokenProvider;
10
10
  name: string;
11
- inputSchema?: JsonSchema<Input> | Tool["inputSchema"];
11
+ inputSchema?: JsonSchema<Input> | (() => JsonSchema<Input>) | Tool["inputSchema"];
12
12
  outputSchema?: JsonSchema<Output> | Tool["outputSchema"];
13
13
  handler: ToolCallback<Input>;
14
14
  };
@@ -48,81 +48,109 @@ export declare function defineTool<Input, Output = undefined>(options: ToolProps
48
48
  handler(args: Input, extra: RequestHandlerExtra<ServerRequest, ServerNotification>): Promise<{
49
49
  [x: string]: unknown;
50
50
  content: ({
51
- [x: string]: unknown;
52
51
  type: "text";
53
52
  text: string;
53
+ annotations?: {
54
+ audience?: ("user" | "assistant")[] | undefined;
55
+ priority?: number | undefined;
56
+ lastModified?: string | undefined;
57
+ } | undefined;
54
58
  _meta?: {
55
59
  [x: string]: unknown;
56
60
  } | undefined;
57
61
  } | {
58
- [x: string]: unknown;
59
62
  type: "image";
60
63
  data: string;
61
64
  mimeType: string;
65
+ annotations?: {
66
+ audience?: ("user" | "assistant")[] | undefined;
67
+ priority?: number | undefined;
68
+ lastModified?: string | undefined;
69
+ } | undefined;
62
70
  _meta?: {
63
71
  [x: string]: unknown;
64
72
  } | undefined;
65
73
  } | {
66
- [x: string]: unknown;
67
74
  type: "audio";
68
75
  data: string;
69
76
  mimeType: string;
77
+ annotations?: {
78
+ audience?: ("user" | "assistant")[] | undefined;
79
+ priority?: number | undefined;
80
+ lastModified?: string | undefined;
81
+ } | undefined;
70
82
  _meta?: {
71
83
  [x: string]: unknown;
72
84
  } | undefined;
73
85
  } | {
74
- [x: string]: unknown;
75
- type: "resource_link";
76
- name: string;
77
86
  uri: string;
87
+ name: string;
88
+ type: "resource_link";
89
+ description?: string | undefined;
90
+ mimeType?: string | undefined;
91
+ annotations?: {
92
+ audience?: ("user" | "assistant")[] | undefined;
93
+ priority?: number | undefined;
94
+ lastModified?: string | undefined;
95
+ } | undefined;
78
96
  _meta?: {
79
97
  [x: string]: unknown;
80
98
  } | undefined;
81
- description?: string | undefined;
82
- mimeType?: string | undefined;
83
- title?: string | undefined;
84
99
  icons?: {
85
- [x: string]: unknown;
86
100
  src: string;
87
101
  mimeType?: string | undefined;
88
102
  sizes?: string[] | undefined;
103
+ theme?: "light" | "dark" | undefined;
89
104
  }[] | undefined;
105
+ title?: string | undefined;
90
106
  } | {
91
- [x: string]: unknown;
92
107
  type: "resource";
93
108
  resource: {
94
- [x: string]: unknown;
95
- text: string;
96
109
  uri: string;
110
+ text: string;
111
+ mimeType?: string | undefined;
97
112
  _meta?: {
98
113
  [x: string]: unknown;
99
114
  } | undefined;
100
- mimeType?: string | undefined;
101
115
  } | {
102
- [x: string]: unknown;
103
116
  uri: string;
104
117
  blob: string;
118
+ mimeType?: string | undefined;
105
119
  _meta?: {
106
120
  [x: string]: unknown;
107
121
  } | undefined;
108
- mimeType?: string | undefined;
109
122
  };
123
+ annotations?: {
124
+ audience?: ("user" | "assistant")[] | undefined;
125
+ priority?: number | undefined;
126
+ lastModified?: string | undefined;
127
+ } | undefined;
110
128
  _meta?: {
111
129
  [x: string]: unknown;
112
130
  } | undefined;
113
131
  })[];
114
132
  _meta?: {
115
133
  [x: string]: unknown;
134
+ progressToken?: string | number | undefined;
135
+ "io.modelcontextprotocol/related-task"?: {
136
+ taskId: string;
137
+ } | undefined;
116
138
  } | undefined;
117
139
  structuredContent?: {
118
140
  [x: string]: unknown;
119
141
  } | undefined;
120
142
  isError?: boolean | undefined;
143
+ } | {
144
+ content: never[];
145
+ structuredContent: {
146
+ code: string;
147
+ message: any;
148
+ };
121
149
  }>;
122
150
  _meta?: Record<string, unknown> | undefined;
123
151
  description?: string | undefined;
124
- title?: string | undefined;
125
152
  annotations?: import("@modelcontextprotocol/sdk/types.js").ToolAnnotations | undefined;
153
+ title?: string | undefined;
126
154
  token?: TokenProvider;
127
155
  name: string;
128
156
  }>;
@@ -1,4 +1,4 @@
1
1
  export * from "./fn/definePrompt.js";
2
2
  export * from "./fn/defineResource.js";
3
3
  export * from "./fn/defineTool.js";
4
- export * from "./services/CLIMCPServer.js";
4
+ export * from "./services/McpServerFactory.js";
@@ -1,6 +1,6 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  export declare const MCP_SERVER: import("@tsed/di").FactoryTokenProvider<{
3
3
  server: McpServer;
4
- connect(): Promise<void>;
4
+ connect(mode?: "streamable-http" | "stdio" | undefined): Promise<void>;
5
5
  }>;
6
6
  export type MCP_SERVER = typeof MCP_SERVER;
@@ -1,2 +1,2 @@
1
1
  import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- export declare function mcpStreamableServer(server: McpServer): Promise<void>;
2
+ export declare function mcpStreamableServer(server: McpServer): Promise<unknown>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tsed/cli-mcp",
3
3
  "description": "MCP CLI for Ts.ED.",
4
- "version": "7.0.0-beta.3",
4
+ "version": "7.0.0-beta.5",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "source": "./src/index.ts",
@@ -46,19 +46,19 @@
46
46
  "node": ">=14"
47
47
  },
48
48
  "dependencies": {
49
- "@modelcontextprotocol/sdk": "^1.19.1",
49
+ "@modelcontextprotocol/sdk": "^1.25.1",
50
50
  "@swc-node/register": "^1.10.9",
51
51
  "@swc/core": "1.7.26",
52
52
  "@swc/helpers": "^0.5.13",
53
- "@tsed/cli-core": "7.0.0-beta.3",
54
- "@tsed/core": ">=8.18.0",
55
- "@tsed/di": ">=8.18.0",
56
- "@tsed/hooks": ">=8.18.0",
53
+ "@tsed/cli-core": "7.0.0-beta.5",
54
+ "@tsed/core": ">=8.21.0",
55
+ "@tsed/di": ">=8.21.0",
56
+ "@tsed/hooks": ">=8.21.0",
57
57
  "@tsed/logger": ">=8.0.3",
58
58
  "@tsed/logger-std": ">=8.0.3",
59
- "@tsed/normalize-path": ">=8.18.0",
60
- "@tsed/openspec": ">=8.18.0",
61
- "@tsed/schema": ">=8.18.0",
59
+ "@tsed/normalize-path": ">=8.21.0",
60
+ "@tsed/openspec": ">=8.21.0",
61
+ "@tsed/schema": ">=8.21.0",
62
62
  "chalk": "^5.3.0",
63
63
  "change-case": "^5.4.4",
64
64
  "consolidate": "^1.0.4",
@@ -69,10 +69,11 @@
69
69
  "rxjs": "^7.8.1",
70
70
  "semver": "^7.6.3",
71
71
  "ts-morph": "27.0.0",
72
- "tslib": "^2.7.0"
72
+ "tslib": "^2.7.0",
73
+ "zod": "3.25.76"
73
74
  },
74
75
  "devDependencies": {
75
- "@tsed/typescript": "7.0.0-beta.3",
76
+ "@tsed/typescript": "7.0.0-beta.5",
76
77
  "@types/change-case": "^2.3.1",
77
78
  "@types/consolidate": "0.14.4",
78
79
  "cross-env": "7.0.3",
@@ -1,36 +0,0 @@
1
- import "./McpServerFactory.js";
2
- import { createInjector, loadPlugins } from "@tsed/cli-core";
3
- import { constant, inject, injector } from "@tsed/di";
4
- import { $asyncEmit } from "@tsed/hooks";
5
- import { MCP_SERVER } from "./McpServerFactory.js";
6
- export class CLIMCPServer {
7
- constructor(settings) {
8
- createInjector({
9
- ...settings,
10
- logger: {
11
- level: "info"
12
- }
13
- });
14
- }
15
- static async bootstrap(settings) {
16
- const server = new CLIMCPServer({
17
- ...settings,
18
- name: settings.name || "tsed",
19
- project: {
20
- srcDir: "src",
21
- scriptsDir: "scripts",
22
- ...(settings.project || {})
23
- }
24
- });
25
- return server.bootstrap();
26
- }
27
- async bootstrap() {
28
- constant("plugins") && (await loadPlugins());
29
- await $asyncEmit("$beforeInit");
30
- await injector().load();
31
- await $asyncEmit("$afterInit");
32
- injector().settings.set("loaded", true);
33
- await $asyncEmit("$onReady");
34
- await inject(MCP_SERVER).connect();
35
- }
36
- }
@@ -1,6 +0,0 @@
1
- import "./McpServerFactory.js";
2
- export declare class CLIMCPServer {
3
- protected constructor(settings: Partial<TsED.Configuration>);
4
- static bootstrap(settings: Partial<TsED.Configuration>): Promise<void>;
5
- bootstrap(): Promise<void>;
6
- }