@atlisp/mcp 1.1.1 → 1.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlisp/mcp",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "MCP Server for @lisp on CAD",
5
5
  "type": "module",
6
6
  "bin": {
package/src/atlisp-mcp.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import path from 'path';
2
3
  import { fileURLToPath } from 'url';
3
4
  import { createRequire } from 'module';
@@ -111,6 +112,17 @@ const TOOL_HANDLERS = {
111
112
  init_atlisp: () => cadHandlers.initAtlisp(),
112
113
  get_function_usage: (a) => functionHandlers.getFunctionUsage(a.name, a.package),
113
114
  list_functions: (a) => functionHandlers.listFunctions(a.package),
115
+ get_file_extensions: (a) => {
116
+ const exts = FILE_EXTENSIONS[a.platform];
117
+ if (!exts) return { content: [{ type: 'text', text: `平台 ${a.platform} 不支持` }], isError: true };
118
+ return { content: [{ type: 'text', text: `${a.platform} 文件扩展名: ${exts.join(', ')}` }] };
119
+ },
120
+ get_install_code: () => ({
121
+ content: [{
122
+ type: 'text',
123
+ text: `复制以下代码到 CAD 命令行加载:\n(load "atlisp" "atlisp")\n(vlax-create-object "atlisp.atlisp.1")`
124
+ }]
125
+ }),
114
126
  };
115
127
 
116
128
  export const tools = [
@@ -223,6 +235,22 @@ export const tools = [
223
235
  package: { type: 'string', description: '包名,如 string(可选)' }
224
236
  }
225
237
  }
238
+ },
239
+ {
240
+ name: 'get_file_extensions',
241
+ description: '获取 CAD 平台对应的文件扩展名',
242
+ inputSchema: {
243
+ type: 'object',
244
+ properties: {
245
+ platform: { type: 'string', description: 'CAD 平台,如 AutoCAD, ZWCAD, GStarCAD, BricsCAD' }
246
+ },
247
+ required: ['platform']
248
+ }
249
+ },
250
+ {
251
+ name: 'get_install_code',
252
+ description: '获取 @lisp 安装代码',
253
+ inputSchema: { type: 'object', properties: {} }
226
254
  }
227
255
  ];
228
256
 
package/src/constants.js CHANGED
@@ -8,7 +8,7 @@ export const FILE_EXTENSIONS = {
8
8
 
9
9
  export const PROTOCOL_VERSION = '2024-11-05';
10
10
  export const SERVER_NAME = 'atlisp-mcp-server';
11
- export const SERVER_VERSION = '1.0.27';
11
+ export const SERVER_VERSION = '1.1.2';
12
12
 
13
13
  export const MOCK_PACKAGES = [
14
14
  { name: 'base', description: '基础函数库', version: '1.0.0' },