@douyinfe/semi-mcp 1.0.19 → 1.0.21
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.d.ts +5 -8
- package/dist/index.js +5 -17
- package/dist/stdio.d.ts +8 -0
- package/dist/stdio.js +1454 -0
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
/**
|
|
3
|
-
* Semi MCP Server
|
|
2
|
+
* Semi MCP Server 导出入口
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
* 通过标准输入输出与客户端通信
|
|
4
|
+
* 导出所有工具、处理器和辅助函数
|
|
7
5
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { tools, toolHandlers, createMCPServer, getPackageVersion, getComponentList };
|
|
6
|
+
export { tools, toolHandlers } from './tools/index.js';
|
|
7
|
+
export { createMCPServer, getPackageVersion } from './server.js';
|
|
8
|
+
export { getComponentList } from './utils/get-component-list.js';
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
4
|
-
import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
-
import { existsSync as external_fs_existsSync, readFileSync } from "fs";
|
|
6
|
-
import { fileURLToPath } from "url";
|
|
7
|
-
import { dirname, join as external_path_join } from "path";
|
|
8
1
|
import { homedir } from "os";
|
|
2
|
+
import { dirname, join as external_path_join } from "path";
|
|
9
3
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
4
|
+
import { existsSync as external_fs_existsSync, readFileSync } from "fs";
|
|
10
5
|
import { lt } from "semver";
|
|
11
6
|
import { parseSync } from "oxc-parser";
|
|
7
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
8
|
+
import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
9
|
+
import { fileURLToPath } from "url";
|
|
12
10
|
function getCacheDir() {
|
|
13
11
|
return external_path_join(homedir(), '.semi-mcp', 'cache');
|
|
14
12
|
}
|
|
@@ -1435,14 +1433,4 @@ function createMCPServer() {
|
|
|
1435
1433
|
});
|
|
1436
1434
|
return server;
|
|
1437
1435
|
}
|
|
1438
|
-
async function main() {
|
|
1439
|
-
const server = createMCPServer();
|
|
1440
|
-
const transport = new StdioServerTransport();
|
|
1441
|
-
await server.connect(transport);
|
|
1442
|
-
}
|
|
1443
|
-
main().catch((error)=>{
|
|
1444
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1445
|
-
process.stderr.write(`Semi MCP Server (stdio) 启动失败: ${errorMessage}\n`);
|
|
1446
|
-
process.exit(1);
|
|
1447
|
-
});
|
|
1448
1436
|
export { createMCPServer, getComponentList, getPackageVersion, toolHandlers, tools };
|