solidworks-mcp 0.1.1-beta.0
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/README.md +34 -0
- package/bin/solidworks-mcp-server.js +2 -0
- package/dist/bootstrap/bridge-bootstrap.d.ts +25 -0
- package/dist/bootstrap/bridge-bootstrap.d.ts.map +1 -0
- package/dist/bootstrap/bridge-bootstrap.js +175 -0
- package/dist/bootstrap/bridge-bootstrap.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +277 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/assembly-tools.d.ts +73 -0
- package/dist/tools/assembly-tools.d.ts.map +1 -0
- package/dist/tools/assembly-tools.js +92 -0
- package/dist/tools/assembly-tools.js.map +1 -0
- package/dist/tools/document-tools.d.ts +59 -0
- package/dist/tools/document-tools.d.ts.map +1 -0
- package/dist/tools/document-tools.js +82 -0
- package/dist/tools/document-tools.js.map +1 -0
- package/dist/tools/feature-tools.d.ts +83 -0
- package/dist/tools/feature-tools.d.ts.map +1 -0
- package/dist/tools/feature-tools.js +106 -0
- package/dist/tools/feature-tools.js.map +1 -0
- package/dist/tools/selection-tools.d.ts +58 -0
- package/dist/tools/selection-tools.d.ts.map +1 -0
- package/dist/tools/selection-tools.js +69 -0
- package/dist/tools/selection-tools.js.map +1 -0
- package/dist/tools/sketch-tools.d.ts +156 -0
- package/dist/tools/sketch-tools.d.ts.map +1 -0
- package/dist/tools/sketch-tools.js +123 -0
- package/dist/tools/sketch-tools.js.map +1 -0
- package/dist/transport/named-pipe-client.d.ts +53 -0
- package/dist/transport/named-pipe-client.d.ts.map +1 -0
- package/dist/transport/named-pipe-client.js +189 -0
- package/dist/transport/named-pipe-client.js.map +1 -0
- package/dist/types/solidworks.d.ts +60 -0
- package/dist/types/solidworks.d.ts.map +1 -0
- package/dist/types/solidworks.js +79 -0
- package/dist/types/solidworks.js.map +1 -0
- package/package.json +56 -0
- package/vendor/bridge/SolidWorks.Interop.sldworks.dll +0 -0
- package/vendor/bridge/SolidWorks.Interop.swconst.dll +0 -0
- package/vendor/bridge/SolidWorksBridge.deps.json +63 -0
- package/vendor/bridge/SolidWorksBridge.dll +0 -0
- package/vendor/bridge/SolidWorksBridge.exe +0 -0
- package/vendor/bridge/SolidWorksBridge.pdb +0 -0
- package/vendor/bridge/SolidWorksBridge.runtimeconfig.json +13 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IPC message types matching C# PipeMessage models.
|
|
3
|
+
* Protocol: [4-byte LE length][UTF-8 JSON body]
|
|
4
|
+
*/
|
|
5
|
+
// --- Error Codes (matching C# PipeErrorCodes) ---
|
|
6
|
+
export const PipeErrorCodes = {
|
|
7
|
+
MethodNotFound: -32601,
|
|
8
|
+
InvalidParams: -32602,
|
|
9
|
+
InternalError: -32603,
|
|
10
|
+
SolidWorksNotConnected: -32000,
|
|
11
|
+
SolidWorksOperationFailed: -32001,
|
|
12
|
+
};
|
|
13
|
+
// --- SolidWorks Document Types ---
|
|
14
|
+
export var SwDocumentType;
|
|
15
|
+
(function (SwDocumentType) {
|
|
16
|
+
SwDocumentType[SwDocumentType["Part"] = 1] = "Part";
|
|
17
|
+
SwDocumentType[SwDocumentType["Assembly"] = 2] = "Assembly";
|
|
18
|
+
SwDocumentType[SwDocumentType["Drawing"] = 3] = "Drawing";
|
|
19
|
+
})(SwDocumentType || (SwDocumentType = {}));
|
|
20
|
+
export function swDocTypeFromExtension(ext) {
|
|
21
|
+
switch (ext.toLowerCase().replace('.', '')) {
|
|
22
|
+
case 'sldprt':
|
|
23
|
+
return SwDocumentType.Part;
|
|
24
|
+
case 'sldasm':
|
|
25
|
+
return SwDocumentType.Assembly;
|
|
26
|
+
case 'slddrw':
|
|
27
|
+
return SwDocumentType.Drawing;
|
|
28
|
+
default:
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// --- Export Formats ---
|
|
33
|
+
export var SwExportFormat;
|
|
34
|
+
(function (SwExportFormat) {
|
|
35
|
+
SwExportFormat["STEP"] = "step";
|
|
36
|
+
SwExportFormat["IGES"] = "iges";
|
|
37
|
+
SwExportFormat["STL"] = "stl";
|
|
38
|
+
SwExportFormat["ThreeMF"] = "3mf";
|
|
39
|
+
SwExportFormat["Parasolid"] = "x_t";
|
|
40
|
+
SwExportFormat["PDF"] = "pdf";
|
|
41
|
+
SwExportFormat["DWG"] = "dwg";
|
|
42
|
+
SwExportFormat["DXF"] = "dxf";
|
|
43
|
+
SwExportFormat["PNG"] = "png";
|
|
44
|
+
SwExportFormat["BMP"] = "bmp";
|
|
45
|
+
})(SwExportFormat || (SwExportFormat = {}));
|
|
46
|
+
// --- Type Guards ---
|
|
47
|
+
export function isPipeResponse(obj) {
|
|
48
|
+
return (typeof obj === 'object' &&
|
|
49
|
+
obj !== null &&
|
|
50
|
+
'id' in obj &&
|
|
51
|
+
typeof obj.id === 'string');
|
|
52
|
+
}
|
|
53
|
+
export function isPipeError(error) {
|
|
54
|
+
return (typeof error === 'object' &&
|
|
55
|
+
error !== null &&
|
|
56
|
+
'code' in error &&
|
|
57
|
+
'message' in error &&
|
|
58
|
+
typeof error.code === 'number' &&
|
|
59
|
+
typeof error.message === 'string');
|
|
60
|
+
}
|
|
61
|
+
// --- Sketch Plane References ---
|
|
62
|
+
export var SwReferencePlane;
|
|
63
|
+
(function (SwReferencePlane) {
|
|
64
|
+
SwReferencePlane["Front"] = "Front";
|
|
65
|
+
SwReferencePlane["Top"] = "Top";
|
|
66
|
+
SwReferencePlane["Right"] = "Right";
|
|
67
|
+
})(SwReferencePlane || (SwReferencePlane = {}));
|
|
68
|
+
// --- Mate Types ---
|
|
69
|
+
export var SwMateType;
|
|
70
|
+
(function (SwMateType) {
|
|
71
|
+
SwMateType[SwMateType["Coincident"] = 0] = "Coincident";
|
|
72
|
+
SwMateType[SwMateType["Concentric"] = 1] = "Concentric";
|
|
73
|
+
SwMateType[SwMateType["Perpendicular"] = 2] = "Perpendicular";
|
|
74
|
+
SwMateType[SwMateType["Parallel"] = 3] = "Parallel";
|
|
75
|
+
SwMateType[SwMateType["Tangent"] = 4] = "Tangent";
|
|
76
|
+
SwMateType[SwMateType["Distance"] = 5] = "Distance";
|
|
77
|
+
SwMateType[SwMateType["Angle"] = 6] = "Angle";
|
|
78
|
+
})(SwMateType || (SwMateType = {}));
|
|
79
|
+
//# sourceMappingURL=solidworks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solidworks.js","sourceRoot":"","sources":["../../src/types/solidworks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,mDAAmD;AAEnD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,cAAc,EAAE,CAAC,KAAK;IACtB,aAAa,EAAE,CAAC,KAAK;IACrB,aAAa,EAAE,CAAC,KAAK;IACrB,sBAAsB,EAAE,CAAC,KAAK;IAC9B,yBAAyB,EAAE,CAAC,KAAK;CACzB,CAAC;AAEX,oCAAoC;AAEpC,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mDAAQ,CAAA;IACR,2DAAY,CAAA;IACZ,yDAAW,CAAA;AACb,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAED,MAAM,UAAU,sBAAsB,CAAC,GAAW;IAChD,QAAQ,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC;QAC3C,KAAK,QAAQ;YACX,OAAO,cAAc,CAAC,IAAI,CAAC;QAC7B,KAAK,QAAQ;YACX,OAAO,cAAc,CAAC,QAAQ,CAAC;QACjC,KAAK,QAAQ;YACX,OAAO,cAAc,CAAC,OAAO,CAAC;QAChC;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAED,yBAAyB;AAEzB,MAAM,CAAN,IAAY,cAWX;AAXD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,6BAAW,CAAA;IACX,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,6BAAW,CAAA;IACX,6BAAW,CAAA;IACX,6BAAW,CAAA;IACX,6BAAW,CAAA;IACX,6BAAW,CAAA;AACb,CAAC,EAXW,cAAc,KAAd,cAAc,QAWzB;AAED,sBAAsB;AAEtB,MAAM,UAAU,cAAc,CAAC,GAAY;IACzC,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,IAAI,IAAI,GAAG;QACX,OAAQ,GAAoB,CAAC,EAAE,KAAK,QAAQ,CAC7C,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,IAAI,KAAK;QACf,SAAS,IAAI,KAAK;QAClB,OAAQ,KAAmB,CAAC,IAAI,KAAK,QAAQ;QAC7C,OAAQ,KAAmB,CAAC,OAAO,KAAK,QAAQ,CACjD,CAAC;AACJ,CAAC;AAED,kCAAkC;AAElC,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,+BAAW,CAAA;IACX,mCAAe,CAAA;AACjB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAED,qBAAqB;AAErB,MAAM,CAAN,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,uDAAc,CAAA;IACd,uDAAc,CAAA;IACd,6DAAiB,CAAA;IACjB,mDAAY,CAAA;IACZ,iDAAW,CAAA;IACX,mDAAY,CAAA;IACZ,6CAAS,CAAA;AACX,CAAC,EARW,UAAU,KAAV,UAAU,QAQrB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "solidworks-mcp",
|
|
3
|
+
"version": "0.1.1-beta.0",
|
|
4
|
+
"description": "Windows-only MCP server for SolidWorks automation via a bundled C# bridge",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"solidworks-mcp-server": "./bin/solidworks-mcp-server.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin",
|
|
12
|
+
"dist",
|
|
13
|
+
"vendor",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "ssh://git@192.168.100.191:10022/Just1Step/solidworks-mcp-server.git"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"os": [
|
|
24
|
+
"win32"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": ".\\scripts\\run-node.cmd .\\node_modules\\typescript\\bin\\tsc",
|
|
28
|
+
"bundle:bridge": ".\\scripts\\run-node.cmd .\\scripts\\bundle-bridge.mjs",
|
|
29
|
+
"pack:local": "npm pack",
|
|
30
|
+
"prepack": ".\\scripts\\run-node.cmd .\\scripts\\prepack.mjs",
|
|
31
|
+
"start": ".\\scripts\\run-node.cmd .\\dist\\index.js",
|
|
32
|
+
"dev": ".\\scripts\\run-node.cmd .\\node_modules\\typescript\\bin\\tsc --watch",
|
|
33
|
+
"test": ".\\scripts\\run-node.cmd .\\node_modules\\vitest\\vitest.mjs run",
|
|
34
|
+
"test:acceptance": ".\\scripts\\run-node.cmd .\\node_modules\\vitest\\vitest.mjs run --testTimeout 240000 --hookTimeout 240000 tests/acceptance/mcp-tools.acceptance.test.ts",
|
|
35
|
+
"test:watch": ".\\scripts\\run-node.cmd .\\node_modules\\vitest\\vitest.mjs"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"mcp",
|
|
39
|
+
"solidworks",
|
|
40
|
+
"cad",
|
|
41
|
+
"automation"
|
|
42
|
+
],
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
49
|
+
"zod": "^3.25.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "^22.0.0",
|
|
53
|
+
"typescript": "^5.8.0",
|
|
54
|
+
"vitest": "^3.1.0"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"runtimeTarget": {
|
|
3
|
+
"name": ".NETCoreApp,Version=v8.0/win-x64",
|
|
4
|
+
"signature": ""
|
|
5
|
+
},
|
|
6
|
+
"compilationOptions": {},
|
|
7
|
+
"targets": {
|
|
8
|
+
".NETCoreApp,Version=v8.0": {},
|
|
9
|
+
".NETCoreApp,Version=v8.0/win-x64": {
|
|
10
|
+
"SolidWorksBridge/1.0.0": {
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"System.Text.Json": "8.0.6",
|
|
13
|
+
"SolidWorks.Interop.sldworks": "32.5.0.48",
|
|
14
|
+
"SolidWorks.Interop.swconst": "32.5.0.48"
|
|
15
|
+
},
|
|
16
|
+
"runtime": {
|
|
17
|
+
"SolidWorksBridge.dll": {}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"System.Text.Json/8.0.6": {},
|
|
21
|
+
"SolidWorks.Interop.sldworks/32.5.0.48": {
|
|
22
|
+
"runtime": {
|
|
23
|
+
"SolidWorks.Interop.sldworks.dll": {
|
|
24
|
+
"assemblyVersion": "32.5.0.48",
|
|
25
|
+
"fileVersion": "32.5.0.48"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"SolidWorks.Interop.swconst/32.5.0.48": {
|
|
30
|
+
"runtime": {
|
|
31
|
+
"SolidWorks.Interop.swconst.dll": {
|
|
32
|
+
"assemblyVersion": "32.5.0.48",
|
|
33
|
+
"fileVersion": "32.5.0.48"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"libraries": {
|
|
40
|
+
"SolidWorksBridge/1.0.0": {
|
|
41
|
+
"type": "project",
|
|
42
|
+
"serviceable": false,
|
|
43
|
+
"sha512": ""
|
|
44
|
+
},
|
|
45
|
+
"System.Text.Json/8.0.6": {
|
|
46
|
+
"type": "package",
|
|
47
|
+
"serviceable": true,
|
|
48
|
+
"sha512": "sha512-BvSpVBsVN9b+Y+wONbvJOHd1HjXQf33+XiC28ZMOwRsYb42mz3Q8YHnpTSwpwJLqYCMqM+0UUVC3V+pi25XfkQ==",
|
|
49
|
+
"path": "system.text.json/8.0.6",
|
|
50
|
+
"hashPath": "system.text.json.8.0.6.nupkg.sha512"
|
|
51
|
+
},
|
|
52
|
+
"SolidWorks.Interop.sldworks/32.5.0.48": {
|
|
53
|
+
"type": "reference",
|
|
54
|
+
"serviceable": false,
|
|
55
|
+
"sha512": ""
|
|
56
|
+
},
|
|
57
|
+
"SolidWorks.Interop.swconst/32.5.0.48": {
|
|
58
|
+
"type": "reference",
|
|
59
|
+
"serviceable": false,
|
|
60
|
+
"sha512": ""
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"runtimeOptions": {
|
|
3
|
+
"tfm": "net8.0",
|
|
4
|
+
"framework": {
|
|
5
|
+
"name": "Microsoft.NETCore.App",
|
|
6
|
+
"version": "8.0.0"
|
|
7
|
+
},
|
|
8
|
+
"configProperties": {
|
|
9
|
+
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
|
10
|
+
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|