Skip to content

Commit c6f53ad

Browse files
hyperpolymathclaude
andcommitted
feat(cartridges): wire Zig FFI dispatch for 94 cartridges (batches 2–20)
All 94 cartridges now have ffi section in cartridge.json pointing at their compiled .so, switching them from JsWorkerPool to boj-invoke dlopen dispatch on next server boot. All 100 cartridges with build.zig compiled clean (zig build -Doptimize=ReleaseFast, 0 failures). 4 had .linkage = .static which produced .a archives instead of .so — build.zig rewritten to use .dynamic + linkLibC() matching the canonical aerie-mcp pattern: - burble-admin-mcp - game-admin-mcp - idaptik-admin-mcp - model-router-mcp (build.zig fixed; ffi NOT wired — stays on JS path) cloudflare-mcp: so_path uses _ffi suffix (libcloudflare_mcp_ffi.so) as produced by its build.zig; probed and verified ok. model-router-mcp: intentionally NOT wired to Zig path — canonical JS cartridge whose logic lives in mod.js. Zig build.zig fixed but ffi key absent from cartridge.json. Tests assert this. Remaining: 12 cartridges need build.zig scaffolding before wiring. All 165 ExUnit tests pass, 0 failures. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 16156d8 commit c6f53ad

98 files changed

Lines changed: 6411 additions & 1473 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cartridges/aws-mcp/cartridge.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,5 +176,16 @@
176176
]
177177
}
178178
}
179-
]
179+
],
180+
"ffi": {
181+
"so_path": "ffi/zig-out/lib/libaws_mcp.so",
182+
"abi_version": "ADR-0006",
183+
"symbols": [
184+
"boj_cartridge_init",
185+
"boj_cartridge_deinit",
186+
"boj_cartridge_name",
187+
"boj_cartridge_version",
188+
"boj_cartridge_invoke"
189+
]
190+
}
180191
}

cartridges/browser-mcp/cartridge.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,16 @@
177177
]
178178
}
179179
}
180-
]
180+
],
181+
"ffi": {
182+
"so_path": "ffi/zig-out/lib/libbrowser_mcp.so",
183+
"abi_version": "ADR-0006",
184+
"symbols": [
185+
"boj_cartridge_init",
186+
"boj_cartridge_deinit",
187+
"boj_cartridge_name",
188+
"boj_cartridge_version",
189+
"boj_cartridge_invoke"
190+
]
191+
}
181192
}

cartridges/bsp-mcp/cartridge.json

Lines changed: 167 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,45 @@
77
"description": "Generic Build Server Protocol (BSP 2.x) gateway. Spawns any BSP server as a persistent subprocess and exposes build lifecycle operations (initialize, targets, compile, test, run, clean, diagnostics) as MCP tools.",
88
"domain": "Language Tools",
99
"tier": "Ayo",
10-
"protocols": ["MCP", "REST"],
11-
"auth": { "method": "none", "env_var": null, "credential_source": null },
12-
"api": { "base_url": "local://bsp-mcp", "content_type": "application/json" },
10+
"protocols": [
11+
"MCP",
12+
"REST"
13+
],
14+
"auth": {
15+
"method": "none",
16+
"env_var": null,
17+
"credential_source": null
18+
},
19+
"api": {
20+
"base_url": "local://bsp-mcp",
21+
"content_type": "application/json"
22+
},
1323
"tools": [
1424
{
1525
"name": "bsp_start",
1626
"description": "Start a BSP server subprocess and return a session ID. The server stays alive until bsp_stop is called.",
1727
"inputSchema": {
1828
"type": "object",
1929
"properties": {
20-
"command": { "type": "string", "description": "BSP server executable (e.g. 'sbt bspConfig', 'mill mill.bsp.BSP/install', 'cargo-bsp')" },
21-
"args": { "type": "array", "items": { "type": "string" }, "description": "Additional command arguments" },
22-
"workspace_root": { "type": "string", "description": "Workspace root directory path" }
30+
"command": {
31+
"type": "string",
32+
"description": "BSP server executable (e.g. 'sbt bspConfig', 'mill mill.bsp.BSP/install', 'cargo-bsp')"
33+
},
34+
"args": {
35+
"type": "array",
36+
"items": {
37+
"type": "string"
38+
},
39+
"description": "Additional command arguments"
40+
},
41+
"workspace_root": {
42+
"type": "string",
43+
"description": "Workspace root directory path"
44+
}
2345
},
24-
"required": ["command"]
46+
"required": [
47+
"command"
48+
]
2549
}
2650
},
2751
{
@@ -30,12 +54,26 @@
3054
"inputSchema": {
3155
"type": "object",
3256
"properties": {
33-
"session_id": { "type": "string", "description": "Session ID from bsp_start" },
34-
"display_name": { "type": "string", "description": "Client display name (default: boj-bsp-mcp)" },
35-
"version": { "type": "string", "description": "Client version (default: 0.1.0)" },
36-
"bsp_version": { "type": "string", "description": "BSP protocol version (default: 2.2.0)" }
57+
"session_id": {
58+
"type": "string",
59+
"description": "Session ID from bsp_start"
60+
},
61+
"display_name": {
62+
"type": "string",
63+
"description": "Client display name (default: boj-bsp-mcp)"
64+
},
65+
"version": {
66+
"type": "string",
67+
"description": "Client version (default: 0.1.0)"
68+
},
69+
"bsp_version": {
70+
"type": "string",
71+
"description": "BSP protocol version (default: 2.2.0)"
72+
}
3773
},
38-
"required": ["session_id"]
74+
"required": [
75+
"session_id"
76+
]
3977
}
4078
},
4179
{
@@ -44,9 +82,14 @@
4482
"inputSchema": {
4583
"type": "object",
4684
"properties": {
47-
"session_id": { "type": "string", "description": "Session ID" }
85+
"session_id": {
86+
"type": "string",
87+
"description": "Session ID"
88+
}
4889
},
49-
"required": ["session_id"]
90+
"required": [
91+
"session_id"
92+
]
5093
}
5194
},
5295
{
@@ -55,11 +98,25 @@
5598
"inputSchema": {
5699
"type": "object",
57100
"properties": {
58-
"session_id": { "type": "string", "description": "Session ID" },
59-
"targets": { "type": "array", "items": { "type": "string" }, "description": "Build target URIs to compile (omit to compile all)" },
60-
"origin_id": { "type": "string", "description": "Optional request origin ID for tracking" }
101+
"session_id": {
102+
"type": "string",
103+
"description": "Session ID"
104+
},
105+
"targets": {
106+
"type": "array",
107+
"items": {
108+
"type": "string"
109+
},
110+
"description": "Build target URIs to compile (omit to compile all)"
111+
},
112+
"origin_id": {
113+
"type": "string",
114+
"description": "Optional request origin ID for tracking"
115+
}
61116
},
62-
"required": ["session_id"]
117+
"required": [
118+
"session_id"
119+
]
63120
}
64121
},
65122
{
@@ -68,12 +125,32 @@
68125
"inputSchema": {
69126
"type": "object",
70127
"properties": {
71-
"session_id": { "type": "string", "description": "Session ID" },
72-
"targets": { "type": "array", "items": { "type": "string" }, "description": "Build target URIs to test" },
73-
"arguments": { "type": "array", "items": { "type": "string" }, "description": "Arguments passed to the test runner" },
74-
"origin_id": { "type": "string", "description": "Optional request origin ID for tracking" }
128+
"session_id": {
129+
"type": "string",
130+
"description": "Session ID"
131+
},
132+
"targets": {
133+
"type": "array",
134+
"items": {
135+
"type": "string"
136+
},
137+
"description": "Build target URIs to test"
138+
},
139+
"arguments": {
140+
"type": "array",
141+
"items": {
142+
"type": "string"
143+
},
144+
"description": "Arguments passed to the test runner"
145+
},
146+
"origin_id": {
147+
"type": "string",
148+
"description": "Optional request origin ID for tracking"
149+
}
75150
},
76-
"required": ["session_id"]
151+
"required": [
152+
"session_id"
153+
]
77154
}
78155
},
79156
{
@@ -82,12 +159,30 @@
82159
"inputSchema": {
83160
"type": "object",
84161
"properties": {
85-
"session_id": { "type": "string", "description": "Session ID" },
86-
"target": { "type": "string", "description": "Build target URI to run" },
87-
"arguments": { "type": "array", "items": { "type": "string" }, "description": "Arguments for the program" },
88-
"environment_variables": { "type": "object", "description": "Environment variables (key-value)" }
162+
"session_id": {
163+
"type": "string",
164+
"description": "Session ID"
165+
},
166+
"target": {
167+
"type": "string",
168+
"description": "Build target URI to run"
169+
},
170+
"arguments": {
171+
"type": "array",
172+
"items": {
173+
"type": "string"
174+
},
175+
"description": "Arguments for the program"
176+
},
177+
"environment_variables": {
178+
"type": "object",
179+
"description": "Environment variables (key-value)"
180+
}
89181
},
90-
"required": ["session_id", "target"]
182+
"required": [
183+
"session_id",
184+
"target"
185+
]
91186
}
92187
},
93188
{
@@ -96,10 +191,21 @@
96191
"inputSchema": {
97192
"type": "object",
98193
"properties": {
99-
"session_id": { "type": "string", "description": "Session ID" },
100-
"targets": { "type": "array", "items": { "type": "string" }, "description": "Build target URIs to clean (omit for full workspace clean)" }
194+
"session_id": {
195+
"type": "string",
196+
"description": "Session ID"
197+
},
198+
"targets": {
199+
"type": "array",
200+
"items": {
201+
"type": "string"
202+
},
203+
"description": "Build target URIs to clean (omit for full workspace clean)"
204+
}
101205
},
102-
"required": ["session_id"]
206+
"required": [
207+
"session_id"
208+
]
103209
}
104210
},
105211
{
@@ -108,10 +214,18 @@
108214
"inputSchema": {
109215
"type": "object",
110216
"properties": {
111-
"session_id": { "type": "string", "description": "Session ID" },
112-
"target": { "type": "string", "description": "Filter by build target URI (optional)" }
217+
"session_id": {
218+
"type": "string",
219+
"description": "Session ID"
220+
},
221+
"target": {
222+
"type": "string",
223+
"description": "Filter by build target URI (optional)"
224+
}
113225
},
114-
"required": ["session_id"]
226+
"required": [
227+
"session_id"
228+
]
115229
}
116230
},
117231
{
@@ -120,10 +234,26 @@
120234
"inputSchema": {
121235
"type": "object",
122236
"properties": {
123-
"session_id": { "type": "string", "description": "Session ID to stop" }
237+
"session_id": {
238+
"type": "string",
239+
"description": "Session ID to stop"
240+
}
124241
},
125-
"required": ["session_id"]
242+
"required": [
243+
"session_id"
244+
]
126245
}
127246
}
128-
]
247+
],
248+
"ffi": {
249+
"so_path": "ffi/zig-out/lib/libbsp_mcp.so",
250+
"abi_version": "ADR-0006",
251+
"symbols": [
252+
"boj_cartridge_init",
253+
"boj_cartridge_deinit",
254+
"boj_cartridge_name",
255+
"boj_cartridge_version",
256+
"boj_cartridge_invoke"
257+
]
258+
}
129259
}

0 commit comments

Comments
 (0)