@mcp-use/cli 2.13.10-canary.1 → 2.13.10
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.
- package/dist/index.cjs +49 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -5827,5 +5827,54 @@ program.command("deploy").description("Deploy MCP server from GitHub to Manufact
|
|
|
5827
5827
|
});
|
|
5828
5828
|
program.addCommand(createClientCommand());
|
|
5829
5829
|
program.addCommand(createDeploymentsCommand());
|
|
5830
|
+
program.command("generate-types").description(
|
|
5831
|
+
"Generate TypeScript type definitions for tools (writes .mcp-use/tool-registry.d.ts)"
|
|
5832
|
+
).option("-p, --path <path>", "Path to project directory", process.cwd()).option("--server <file>", "Server entry file", "index.ts").action(async (options) => {
|
|
5833
|
+
const projectPath = path6.resolve(options.path);
|
|
5834
|
+
const serverFile = path6.join(projectPath, options.server);
|
|
5835
|
+
try {
|
|
5836
|
+
if (!await access(serverFile).then(() => true).catch(() => false)) {
|
|
5837
|
+
console.error(source_default.red(`Server file not found: ${serverFile}`));
|
|
5838
|
+
process.exit(1);
|
|
5839
|
+
}
|
|
5840
|
+
console.log(source_default.blue("Generating tool registry types..."));
|
|
5841
|
+
globalThis.__mcpUseHmrMode = true;
|
|
5842
|
+
const { tsImport } = await import("tsx/esm/api");
|
|
5843
|
+
await tsImport(serverFile, {
|
|
5844
|
+
parentURL: import.meta.url,
|
|
5845
|
+
tsconfig: path6.join(projectPath, "tsconfig.json")
|
|
5846
|
+
});
|
|
5847
|
+
const server = globalThis.__mcpUseLastServer;
|
|
5848
|
+
if (!server) {
|
|
5849
|
+
console.error(
|
|
5850
|
+
source_default.red(
|
|
5851
|
+
"No MCPServer instance found. Make sure your server file creates an MCPServer instance."
|
|
5852
|
+
)
|
|
5853
|
+
);
|
|
5854
|
+
process.exit(1);
|
|
5855
|
+
}
|
|
5856
|
+
const mcpUsePath = path6.join(projectPath, "node_modules", "mcp-use");
|
|
5857
|
+
const { generateToolRegistryTypes } = await import(path6.join(mcpUsePath, "dist", "src", "server", "index.js")).then((mod) => mod);
|
|
5858
|
+
if (!generateToolRegistryTypes) {
|
|
5859
|
+
throw new Error(
|
|
5860
|
+
"generateToolRegistryTypes not found in mcp-use package"
|
|
5861
|
+
);
|
|
5862
|
+
}
|
|
5863
|
+
await generateToolRegistryTypes(server.registrations.tools, projectPath);
|
|
5864
|
+
console.log(source_default.green("\u2713 Tool registry types generated successfully"));
|
|
5865
|
+
process.exit(0);
|
|
5866
|
+
} catch (error) {
|
|
5867
|
+
console.error(
|
|
5868
|
+
source_default.red("Failed to generate types:"),
|
|
5869
|
+
error instanceof Error ? error.message : String(error)
|
|
5870
|
+
);
|
|
5871
|
+
if (error instanceof Error && error.stack) {
|
|
5872
|
+
console.error(source_default.gray(error.stack));
|
|
5873
|
+
}
|
|
5874
|
+
process.exit(1);
|
|
5875
|
+
} finally {
|
|
5876
|
+
globalThis.__mcpUseHmrMode = false;
|
|
5877
|
+
}
|
|
5878
|
+
});
|
|
5830
5879
|
program.parse();
|
|
5831
5880
|
//# sourceMappingURL=index.js.map
|