@dmytro-prototypes/cadbridge-mcp 0.1.1

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/LICENSE.txt ADDED
@@ -0,0 +1,64 @@
1
+ CADBRIDGE PRIVATE ALPHA EVALUATION AGREEMENT
2
+ =============================================
3
+
4
+ Draft for private alpha testing. Have a qualified lawyer review this before
5
+ commercial or public distribution.
6
+
7
+ Effective date: 31 July 2026
8
+ Licensor: CADBridge project owner
9
+
10
+ 1. Grant
11
+
12
+ The Licensor grants the named alpha tester a limited, non-exclusive,
13
+ non-transferable, revocable license to install and use CADBridge on the
14
+ tester’s own Windows computer solely to evaluate the software with AutoCAD
15
+ and an MCP client during the private alpha period.
16
+
17
+ 2. Restrictions
18
+
19
+ The tester must keep the installer, binaries, access token, and documentation
20
+ private; must not resell, sublicense, publish, or distribute them; and must
21
+ not use another tester’s token. The token is personal and may be revoked.
22
+ The tester must not attempt to bypass the licensing or access controls,
23
+ except to the extent a restriction is prohibited by applicable law.
24
+
25
+ 3. Feedback and telemetry
26
+
27
+ The tester may report defects, observations, and suggestions to the Licensor.
28
+ The Licensor may use that feedback without restriction. The MCP server may
29
+ contact the CADBridge licensing service to validate the tester’s token and
30
+ obtain a short-lived access lease. The software does not grant the Licensor
31
+ access to the tester’s drawings beyond operations explicitly requested through
32
+ the MCP client.
33
+
34
+ 4. Confidentiality
35
+
36
+ The tester will not disclose non-public CADBridge features, source code,
37
+ credentials, test results, or release materials without the Licensor’s written
38
+ permission.
39
+
40
+ 5. No warranty
41
+
42
+ CADBridge is an alpha evaluation build. It is provided “as is” and may contain
43
+ defects, change without notice, or stop working. The tester is responsible for
44
+ backing up drawings and for reviewing agent-generated or automated CAD changes
45
+ before relying on them.
46
+
47
+ 6. Liability
48
+
49
+ To the maximum extent permitted by law, the Licensor will not be liable for
50
+ indirect, incidental, special, consequential, or lost-profit damages arising
51
+ from the alpha software. Nothing in this agreement excludes liability that
52
+ cannot legally be excluded.
53
+
54
+ 7. Termination
55
+
56
+ This evaluation license ends when the private alpha ends or when the
57
+ Licensor revokes access. On termination, the tester must stop using CADBridge
58
+ and delete the supplied alpha materials, except for records that must be
59
+ retained by law.
60
+
61
+ 8. Acceptance
62
+
63
+ By selecting “I accept” in the CADBridge installer or by using CADBridge after
64
+ installation, the tester agrees to this private alpha evaluation agreement.
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # CADBridge MCP Server
2
+
3
+ Drive a live AutoCAD session from Claude, Codex, Cursor, and other MCP
4
+ clients — create and edit entities, manage layers/blocks/layouts, run
5
+ commands and AutoLISP, and capture the current view.
6
+
7
+ ## Requirements
8
+
9
+ - AutoCAD 2025, 2026, or 2027, with the **CADBridge plugin** installed and
10
+ running. This npm package is the MCP server only; it talks to AutoCAD
11
+ through the plugin over a local connection, and every tool call that
12
+ touches AutoCAD fails with "no instance found" until the plugin is
13
+ installed and AutoCAD is open.
14
+ - A CADBridge account. Signing in takes one browser click and stores no
15
+ secret in your client config — see below.
16
+
17
+ ## Run
18
+
19
+ ```bash
20
+ npx -y @dmytro-prototypes/cadbridge-mcp
21
+ ```
22
+
23
+ This launches the platform binary that npm installed alongside this package
24
+ (picked automatically via `optionalDependencies` — nothing is downloaded at
25
+ run time). `npx` is the only supported way to run it: it fetches over an
26
+ HTTP client rather than a browser, so the binary is never quarantined by
27
+ Gatekeeper or blocked by SmartScreen, and needs no code-signing certificate.
28
+
29
+ Supported platforms are macOS Apple Silicon and Windows x64 — the platforms
30
+ AutoCAD itself runs on.
31
+
32
+ ## Sign in
33
+
34
+ ```bash
35
+ npx -y @dmytro-prototypes/cadbridge-mcp login
36
+ ```
37
+
38
+ Opens your browser to approve the sign-in; the key is then stored in your OS
39
+ credential store, never in a config file. `npx -y @dmytro-prototypes/cadbridge-mcp status`
40
+ shows what's signed in, and `logout` forgets it. The same commands are also
41
+ available as `CADBRIDGELOGIN` / `CADBRIDGE` / `CADBRIDGELOGOUT` typed directly
42
+ in AutoCAD, once the plugin is installed.
43
+
44
+ Client configuration examples for Claude Desktop, Claude Code, Codex, and
45
+ Cursor are at your CADBridge account's setup page.
package/bin/cli.js ADDED
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env node
2
+ // Launcher for the CADBridge MCP server.
3
+ //
4
+ // The server is a Rust binary, shipped as one npm package per platform and
5
+ // pulled in through optionalDependencies — npm installs only the package whose
6
+ // `os`/`cpu` match, so `npx @dmytro-prototypes/cadbridge-mcp` fetches exactly
7
+ // one binary and nothing else.
8
+ //
9
+ // Deliberately NOT the download-on-first-run approach dwg-mcp-server uses: that
10
+ // one pulls its binary from a public GitHub release, and this repository is
11
+ // private, so the URL would 404 for every user. Shipping the binaries inside
12
+ // npm also keeps installs working behind proxies that only allow the registry.
13
+ import { spawn } from "node:child_process"
14
+ import { existsSync, realpathSync } from "node:fs"
15
+ import { createRequire } from "node:module"
16
+ import { fileURLToPath } from "node:url"
17
+
18
+ const require = createRequire(import.meta.url)
19
+
20
+ // Every supported platform, not just the current one, so an unsupported host
21
+ // can be told what does exist rather than just what is missing.
22
+ const PACKAGES = {
23
+ "darwin-arm64": "@dmytro-prototypes/cadbridge-mcp-darwin-arm64",
24
+ "win32-x64": "@dmytro-prototypes/cadbridge-mcp-win32-x64",
25
+ }
26
+
27
+ export function platformKey(platform = process.platform, arch = process.arch) {
28
+ return `${platform}-${arch}`
29
+ }
30
+
31
+ export function resolveBinary(key = platformKey()) {
32
+ const pkg = PACKAGES[key]
33
+ if (!pkg) {
34
+ throw new Error(
35
+ `CADBridge does not ship a server binary for ${key}. ` +
36
+ `AutoCAD itself runs only on ${Object.keys(PACKAGES).join(" and ")}.`,
37
+ )
38
+ }
39
+
40
+ const executable = process.platform === "win32" ? "cadbridge-mcp.exe" : "cadbridge-mcp"
41
+ try {
42
+ return require.resolve(`${pkg}/bin/${executable}`)
43
+ } catch {
44
+ // An optional dependency that failed to install is silent by design, so
45
+ // say plainly which package is missing instead of leaving a bare ENOENT.
46
+ throw new Error(
47
+ `${pkg} is not installed. It is an optional dependency, so npm skips it ` +
48
+ `without failing the install — reinstall with \`npm install ${pkg}\`, ` +
49
+ `or check whether --no-optional or an offline cache suppressed it.`,
50
+ )
51
+ }
52
+ }
53
+
54
+ export function run(argv = process.argv.slice(2)) {
55
+ const binary = resolveBinary()
56
+ // stdio: "inherit" — this process is a stdio MCP server; the client's pipes
57
+ // must reach the real binary untouched. Nothing here may write to stdout.
58
+ const child = spawn(binary, argv, { stdio: "inherit" })
59
+
60
+ // Forward the signals a client uses to stop a server, so the binary gets to
61
+ // shut down its AutoCAD connection instead of being orphaned.
62
+ for (const signal of ["SIGINT", "SIGTERM"]) {
63
+ process.on(signal, () => child.kill(signal))
64
+ }
65
+
66
+ child.on("error", error => {
67
+ console.error(`Failed to start the CADBridge MCP server: ${error.message}`)
68
+ process.exit(1)
69
+ })
70
+ child.on("exit", (code, signal) => {
71
+ // A child killed by a signal has a null exit code; report it the way a
72
+ // shell would rather than collapsing it to 0.
73
+ process.exit(signal ? 128 + (signal === "SIGINT" ? 2 : 15) : (code ?? 1))
74
+ })
75
+ }
76
+
77
+ // Only run when invoked as the CLI, so the exported helpers stay importable
78
+ // from tests. realpath, because npm links bin entries through a symlink.
79
+ export function isMain(entry = process.argv[1]) {
80
+ return (
81
+ Boolean(entry) &&
82
+ existsSync(entry) &&
83
+ realpathSync(entry) === realpathSync(fileURLToPath(import.meta.url))
84
+ )
85
+ }
86
+
87
+ if (isMain()) {
88
+ run()
89
+ }
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@dmytro-prototypes/cadbridge-mcp",
3
+ "version": "0.1.1",
4
+ "mcpName": "io.github.dimitrovakulenko/cadbridge-mcp",
5
+ "description": "Drive a live AutoCAD session from an AI client through MCP",
6
+ "type": "module",
7
+ "engines": {
8
+ "node": ">=18"
9
+ },
10
+ "license": "SEE LICENSE IN LICENSE.txt",
11
+ "homepage": "https://cadbridge.dmytro-prototypes.net",
12
+ "keywords": [
13
+ "mcp",
14
+ "mcp-server",
15
+ "model-context-protocol",
16
+ "autocad",
17
+ "objectarx",
18
+ "cad",
19
+ "dwg",
20
+ "ai-agents",
21
+ "claude",
22
+ "codex",
23
+ "cursor"
24
+ ],
25
+ "bin": {
26
+ "cadbridge-mcp": "./bin/cli.js"
27
+ },
28
+ "files": [
29
+ "bin",
30
+ "LICENSE.txt"
31
+ ],
32
+ "optionalDependencies": {
33
+ "@dmytro-prototypes/cadbridge-mcp-darwin-arm64": "0.1.1",
34
+ "@dmytro-prototypes/cadbridge-mcp-win32-x64": "0.1.1"
35
+ },
36
+ "publishConfig": {
37
+ "access": "public"
38
+ }
39
+ }