mcacp 0.1.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.
Files changed (49) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +195 -0
  3. package/dist/acp/agent-requests.d.ts +19 -0
  4. package/dist/acp/agent-requests.js +166 -0
  5. package/dist/acp/agent-requests.js.map +1 -0
  6. package/dist/acp/lifecycle.d.ts +50 -0
  7. package/dist/acp/lifecycle.js +127 -0
  8. package/dist/acp/lifecycle.js.map +1 -0
  9. package/dist/acp/status.d.ts +31 -0
  10. package/dist/acp/status.js +72 -0
  11. package/dist/acp/status.js.map +1 -0
  12. package/dist/acp/transport.d.ts +34 -0
  13. package/dist/acp/transport.js +175 -0
  14. package/dist/acp/transport.js.map +1 -0
  15. package/dist/config/index.d.ts +27 -0
  16. package/dist/config/index.js +162 -0
  17. package/dist/config/index.js.map +1 -0
  18. package/dist/index.d.ts +2 -0
  19. package/dist/index.js +11 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/permissions/index.d.ts +16 -0
  22. package/dist/permissions/index.js +70 -0
  23. package/dist/permissions/index.js.map +1 -0
  24. package/dist/registry/index.d.ts +52 -0
  25. package/dist/registry/index.js +240 -0
  26. package/dist/registry/index.js.map +1 -0
  27. package/dist/server/index.d.ts +5 -0
  28. package/dist/server/index.js +271 -0
  29. package/dist/server/index.js.map +1 -0
  30. package/dist/sessions/index.d.ts +91 -0
  31. package/dist/sessions/index.js +151 -0
  32. package/dist/sessions/index.js.map +1 -0
  33. package/dist/sessions/prompt.d.ts +78 -0
  34. package/dist/sessions/prompt.js +361 -0
  35. package/dist/sessions/prompt.js.map +1 -0
  36. package/dist/types/acp.d.ts +343 -0
  37. package/dist/types/acp.js +17 -0
  38. package/dist/types/acp.js.map +1 -0
  39. package/dist/types/config.d.ts +135 -0
  40. package/dist/types/config.js +43 -0
  41. package/dist/types/config.js.map +1 -0
  42. package/dist/types/index.d.ts +3 -0
  43. package/dist/types/index.js +4 -0
  44. package/dist/types/index.js.map +1 -0
  45. package/dist/types/tools.d.ts +619 -0
  46. package/dist/types/tools.js +441 -0
  47. package/dist/types/tools.js.map +1 -0
  48. package/docs/configuration.md +164 -0
  49. package/package.json +58 -0
@@ -0,0 +1,441 @@
1
+ import { z } from 'zod';
2
+ // ---------------------------------------------------------------------------
3
+ // Shared / helper schemas
4
+ // ---------------------------------------------------------------------------
5
+ /**
6
+ * Configuration for an MCP server that can be forwarded to a sub-agent.
7
+ *
8
+ * Two variants:
9
+ * - stdio: launch a local process (command + optional args / env)
10
+ * - http: connect to a remote server over HTTP/SSE (url + optional headers)
11
+ */
12
+ export const McpServerConfigSchema = z.union([
13
+ z.object({
14
+ name: z.string().describe('Unique display name for this MCP server.'),
15
+ command: z.string().describe('Executable to launch (stdio transport).'),
16
+ args: z.array(z.string()).optional().describe('Command-line arguments.'),
17
+ env: z
18
+ .array(z.object({ name: z.string(), value: z.string() }))
19
+ .optional()
20
+ .describe('Extra environment variables passed to the process.'),
21
+ }),
22
+ z.object({
23
+ type: z.literal('http'),
24
+ name: z.string().describe('Unique display name for this MCP server.'),
25
+ url: z.string().url().describe('Base URL of the HTTP/SSE MCP server.'),
26
+ headers: z
27
+ .array(z.object({ name: z.string(), value: z.string() }))
28
+ .optional()
29
+ .describe('Extra HTTP headers sent with every request.'),
30
+ }),
31
+ ]);
32
+ /**
33
+ * A single content block inside a structured prompt.
34
+ *
35
+ * - text: plain or markdown text
36
+ * - resource_link: reference to an external resource by URI
37
+ */
38
+ export const ContentBlockInputSchema = z.union([
39
+ z.object({
40
+ type: z.literal('text'),
41
+ text: z.string().describe('The text content of this block.'),
42
+ }),
43
+ z.object({
44
+ type: z.literal('resource_link'),
45
+ uri: z.string().describe('URI pointing to the linked resource.'),
46
+ mimeType: z.string().optional().describe('MIME type of the resource (e.g. "text/plain").'),
47
+ }),
48
+ ]);
49
+ /**
50
+ * Client capability flags passed during initialize.
51
+ */
52
+ export const ClientCapabilitiesSchema = z
53
+ .object({
54
+ fs: z
55
+ .object({
56
+ readTextFile: z
57
+ .boolean()
58
+ .optional()
59
+ .describe('Client can read text files on behalf of the agent.'),
60
+ writeTextFile: z
61
+ .boolean()
62
+ .optional()
63
+ .describe('Client can write text files on behalf of the agent.'),
64
+ })
65
+ .optional()
66
+ .describe('Filesystem capabilities offered by the client.'),
67
+ terminal: z
68
+ .boolean()
69
+ .optional()
70
+ .describe('Client can execute terminal commands on behalf of the agent.'),
71
+ })
72
+ .optional();
73
+ /**
74
+ * Client identification passed during initialize.
75
+ */
76
+ export const ClientInfoSchema = z.object({
77
+ name: z.string().describe('Machine-readable name of the client application.'),
78
+ version: z.string().describe('Semantic version of the client application.'),
79
+ title: z
80
+ .string()
81
+ .optional()
82
+ .describe('Human-readable display title of the client.'),
83
+ });
84
+ // ---------------------------------------------------------------------------
85
+ // Input schemas - one per tool
86
+ // ---------------------------------------------------------------------------
87
+ // ---- Registry tools -------------------------------------------------------
88
+ export const ListInstalledAgentsInputSchema = z
89
+ .object({})
90
+ .describe('No parameters required.');
91
+ export const RegistrySearchInputSchema = z.object({
92
+ query: z
93
+ .string()
94
+ .optional()
95
+ .describe('Free-text search query. When omitted all available agents are returned.'),
96
+ showIncompatible: z
97
+ .boolean()
98
+ .default(false)
99
+ .describe('When true, results include agents that are not compatible with the current MCACP version. Defaults to false.'),
100
+ });
101
+ export const AgentInstallInputSchema = z.object({
102
+ agentId: z
103
+ .string()
104
+ .describe('Fully-qualified agent identifier (e.g. "vendor/agent-name").'),
105
+ version: z
106
+ .string()
107
+ .optional()
108
+ .describe('Specific version to install. When omitted the latest compatible version is used.'),
109
+ });
110
+ export const AgentUninstallInputSchema = z.object({
111
+ agentId: z
112
+ .string()
113
+ .describe('Identifier of the installed agent to remove.'),
114
+ });
115
+ export const AgentCheckUpgradesInputSchema = z
116
+ .object({})
117
+ .describe('No parameters required.');
118
+ // ---- Lifecycle tools ------------------------------------------------------
119
+ export const InitializeInputSchema = z.object({
120
+ agentId: z
121
+ .string()
122
+ .describe('Identifier of the installed agent to initialize.'),
123
+ protocolVersion: z
124
+ .number()
125
+ .int()
126
+ .optional()
127
+ .describe('ACP protocol version to negotiate. When omitted the latest supported version is used.'),
128
+ clientInfo: ClientInfoSchema.optional().describe('Information about the calling client. Forwarded to the agent during the ACP handshake.'),
129
+ clientCapabilities: ClientCapabilitiesSchema.describe('Capability flags describing what the client environment can do on behalf of the agent.'),
130
+ });
131
+ export const ShutdownInputSchema = z.object({
132
+ agentId: z
133
+ .string()
134
+ .describe('Identifier of the running agent to shut down.'),
135
+ });
136
+ // ---- Session tools --------------------------------------------------------
137
+ export const NewSessionInputSchema = z.object({
138
+ agentId: z
139
+ .string()
140
+ .describe('Identifier of the running agent that will own this session.'),
141
+ cwd: z
142
+ .string()
143
+ .describe('Absolute path to the working directory for the session.'),
144
+ mcpServers: z
145
+ .array(McpServerConfigSchema)
146
+ .optional()
147
+ .describe('MCP servers to make available inside this session.'),
148
+ permissionPolicy: z
149
+ .enum(['elicit', 'allow_all', 'deny_all', 'operator'])
150
+ .optional()
151
+ .describe('How permission requests from the agent are handled. ' +
152
+ '"elicit" prompts the user interactively; ' +
153
+ '"allow_all" auto-approves every request; ' +
154
+ '"deny_all" auto-denies every request; ' +
155
+ '"operator" returns permission requests as updates for programmatic handling via grant_permission.'),
156
+ });
157
+ export const LoadSessionInputSchema = z.object({
158
+ agentId: z
159
+ .string()
160
+ .describe('Identifier of the running agent that owns the session.'),
161
+ sessionId: z
162
+ .string()
163
+ .describe('Unique identifier of the previously-created session to reload.'),
164
+ cwd: z
165
+ .string()
166
+ .describe('Absolute path to the working directory for the resumed session.'),
167
+ mcpServers: z
168
+ .array(McpServerConfigSchema)
169
+ .optional()
170
+ .describe('MCP servers to make available inside the reloaded session.'),
171
+ });
172
+ export const ListSessionsInputSchema = z.object({
173
+ agentId: z
174
+ .string()
175
+ .describe('Agent ID to list sessions for.'),
176
+ });
177
+ export const CloseSessionInputSchema = z.object({
178
+ sessionId: z
179
+ .string()
180
+ .describe('Identifier of the active session to close. The session file is preserved for later reloading.'),
181
+ });
182
+ // ---- Interaction tools ----------------------------------------------------
183
+ export const PromptInputSchema = z.object({
184
+ sessionId: z
185
+ .string()
186
+ .describe('Identifier of the active session to send the prompt to.'),
187
+ prompt: z
188
+ .union([z.string(), z.array(ContentBlockInputSchema)])
189
+ .describe('The user prompt. Supply a plain string for simple text (it will be wrapped in a text content block automatically), ' +
190
+ 'or an array of ContentBlockInput objects for structured multi-block prompts.'),
191
+ });
192
+ export const GrantPermissionInputSchema = z.object({
193
+ sessionId: z
194
+ .string()
195
+ .describe('Identifier of the session that raised the permission request.'),
196
+ toolCallId: z
197
+ .string()
198
+ .describe('The tool_call_id from the permission-request update that this response addresses.'),
199
+ optionId: z
200
+ .string()
201
+ .describe('The chosen option identifier (e.g. "allow", "deny", "allow_always") as listed in the permission request.'),
202
+ });
203
+ export const CancelInputSchema = z.object({
204
+ sessionId: z
205
+ .string()
206
+ .describe('Identifier of the session whose in-progress prompt should be cancelled.'),
207
+ });
208
+ export const SetModeInputSchema = z.object({
209
+ sessionId: z
210
+ .string()
211
+ .describe('Identifier of the active session.'),
212
+ modeId: z
213
+ .string()
214
+ .describe('Identifier of the operating mode to switch to (agent-defined).'),
215
+ });
216
+ export const EventsInputSchema = z.object({
217
+ timeoutMs: z
218
+ .number()
219
+ .optional()
220
+ .describe('Maximum time in milliseconds to wait for events. When omitted the call blocks indefinitely ' +
221
+ 'until at least one event arrives. If the timeout expires before any events arrive, an empty ' +
222
+ 'array is returned.'),
223
+ nagleMs: z
224
+ .number()
225
+ .optional()
226
+ .describe('Coalescing window in milliseconds. When set, incoming events are batched: the call waits until ' +
227
+ 'no new events arrive for this duration before returning the batch. Default: 0 (return immediately ' +
228
+ 'on first event).'),
229
+ });
230
+ // ---- Status / monitoring tools --------------------------------------------
231
+ export const ListRunningAgentsInputSchema = z
232
+ .object({})
233
+ .describe('No parameters required.');
234
+ export const GetAgentStatusInputSchema = z.object({
235
+ agentId: z
236
+ .string()
237
+ .describe('Identifier of the running agent to query.'),
238
+ });
239
+ export const SetAgentStatusInputSchema = z.object({
240
+ agentId: z
241
+ .string()
242
+ .describe('Identifier of the running agent whose status should be updated.'),
243
+ status: z
244
+ .string()
245
+ .describe('Operator-defined status text to display for this agent (e.g. "idle", "working on X").'),
246
+ });
247
+ // ---------------------------------------------------------------------------
248
+ // Tool definitions
249
+ // ---------------------------------------------------------------------------
250
+ // ---- Registry tools -------------------------------------------------------
251
+ export const listInstalledAgents = {
252
+ name: 'list_installed_agents',
253
+ description: 'List all locally installed ACP agents. Returns an array of objects, each containing the agent id, ' +
254
+ "human-readable name, installed version, and a short description of the agent's capabilities.",
255
+ inputSchema: ListInstalledAgentsInputSchema,
256
+ };
257
+ export const registrySearch = {
258
+ name: 'registry_search',
259
+ description: 'Search all configured registries for available ACP agents. Provide an optional free-text query to ' +
260
+ 'filter results. By default only agents compatible with this MCACP version are shown; set ' +
261
+ 'showIncompatible to true to include all.',
262
+ inputSchema: RegistrySearchInputSchema,
263
+ };
264
+ export const agentInstall = {
265
+ name: 'agent_install',
266
+ description: 'Download and install an ACP agent from a configured registry. Specify the agent identifier and ' +
267
+ 'optionally pin a version. The agent is installed locally and becomes available for initialization.',
268
+ inputSchema: AgentInstallInputSchema,
269
+ };
270
+ export const agentUninstall = {
271
+ name: 'agent_uninstall',
272
+ description: 'Remove a locally installed ACP agent and all of its associated data. The agent must not be ' +
273
+ 'currently running; shut it down first if necessary.',
274
+ inputSchema: AgentUninstallInputSchema,
275
+ };
276
+ export const agentCheckUpgrades = {
277
+ name: 'agent_check_upgrades',
278
+ description: 'Check every installed agent against its source registry and report any available version upgrades. ' +
279
+ 'Returns a list of agents that have newer versions available along with current and latest version numbers.',
280
+ inputSchema: AgentCheckUpgradesInputSchema,
281
+ };
282
+ // ---- Lifecycle tools ------------------------------------------------------
283
+ export const initialize = {
284
+ name: 'initialize',
285
+ description: 'Spawn the agent process and perform the ACP initialize handshake. This must be called before ' +
286
+ 'creating sessions or sending prompts. Optionally pass client information and capability flags so ' +
287
+ 'the agent knows what the host environment supports.',
288
+ inputSchema: InitializeInputSchema,
289
+ };
290
+ export const shutdown = {
291
+ name: 'shutdown',
292
+ description: 'Gracefully shut down a running agent process. All active sessions owned by the agent are closed ' +
293
+ 'first. After shutdown the agent must be re-initialized before it can be used again.',
294
+ inputSchema: ShutdownInputSchema,
295
+ };
296
+ // ---- Session tools --------------------------------------------------------
297
+ export const newSession = {
298
+ name: 'new_session',
299
+ description: 'Create a new ACP session on a running agent. A session provides an isolated conversation context ' +
300
+ 'with its own working directory, MCP server set, and permission policy. Returns the new session identifier.',
301
+ inputSchema: NewSessionInputSchema,
302
+ };
303
+ export const loadSession = {
304
+ name: 'load_session',
305
+ description: 'Reload a previously created session from its persisted session file. The session resumes with its ' +
306
+ 'prior conversation history. You may supply a different working directory or MCP server set for the ' +
307
+ 'reloaded session.',
308
+ inputSchema: LoadSessionInputSchema,
309
+ };
310
+ export const listSessions = {
311
+ name: 'list_sessions',
312
+ description: 'List stored ACP sessions for a given agent. Returns session metadata ' +
313
+ 'including session id, owning agent, creation time, and current status.',
314
+ inputSchema: ListSessionsInputSchema,
315
+ };
316
+ export const closeSession = {
317
+ name: 'close_session',
318
+ description: 'Close an active session. The session file is preserved on disk so the session can be reloaded later ' +
319
+ 'with load_session. Any in-progress prompt is cancelled before closing.',
320
+ inputSchema: CloseSessionInputSchema,
321
+ };
322
+ // ---- Interaction tools ----------------------------------------------------
323
+ export const prompt = {
324
+ name: 'prompt',
325
+ description: 'Send a user prompt to an active session and wait for the agent to finish responding. The prompt can ' +
326
+ 'be a plain string (automatically wrapped in a text content block) or a structured array of content ' +
327
+ 'blocks for multi-modal input. Returns an object with a stopReason string and an updates array ' +
328
+ 'containing all agent output events produced during this turn.',
329
+ inputSchema: PromptInputSchema,
330
+ };
331
+ export const grantPermission = {
332
+ name: 'grant_permission',
333
+ description: 'Respond to a pending permission request from an agent session that uses the "operator" permission ' +
334
+ 'policy. Supply the toolCallId from the permission-request update and the chosen optionId (e.g. ' +
335
+ '"allow", "deny", "allow_always"). The agent resumes execution with the granted (or denied) permission.',
336
+ inputSchema: GrantPermissionInputSchema,
337
+ };
338
+ export const cancel = {
339
+ name: 'cancel',
340
+ description: 'Cancel an in-progress prompt on an active session. The agent is sent a cancellation signal and any ' +
341
+ 'partial results are discarded. The session remains open and ready for new prompts.',
342
+ inputSchema: CancelInputSchema,
343
+ };
344
+ export const setMode = {
345
+ name: 'set_mode',
346
+ description: "Switch the operating mode of an active session. Modes are agent-defined and control the agent's " +
347
+ 'behavior profile (e.g. "plan" vs "execute", "code" vs "review"). The available mode identifiers ' +
348
+ 'depend on the specific agent.',
349
+ inputSchema: SetModeInputSchema,
350
+ };
351
+ export const events = {
352
+ name: 'events',
353
+ description: 'Block until any prompted session produces events. Returns an array of events, each stamped with ' +
354
+ 'the sessionId and agentId of the session that produced it. Supports optional Nagle-style ' +
355
+ 'coalescing to batch events arriving across multiple sessions within a configurable time window.',
356
+ inputSchema: EventsInputSchema,
357
+ };
358
+ // ---- Status / monitoring tools --------------------------------------------
359
+ export const listRunningAgents = {
360
+ name: 'list_running_agents',
361
+ description: "List all currently spawned (running) agent processes. Returns an array with each agent's " +
362
+ 'identifier, process status, last heartbeat timestamp, and the identifiers of its active sessions.',
363
+ inputSchema: ListRunningAgentsInputSchema,
364
+ };
365
+ export const getAgentStatus = {
366
+ name: 'get_agent_status',
367
+ description: 'Retrieve detailed runtime status for a single running agent. Includes process health, uptime, ' +
368
+ 'memory usage, and per-session activity information such as the current prompt state and turn count.',
369
+ inputSchema: GetAgentStatusInputSchema,
370
+ };
371
+ export const setAgentStatus = {
372
+ name: 'set_agent_status',
373
+ description: 'Set an operator-defined status string on a running agent. This status is surfaced in monitoring ' +
374
+ 'views and can be used by the orchestrating agent to communicate high-level intent (e.g. "working ' +
375
+ 'on task X", "waiting for review").',
376
+ inputSchema: SetAgentStatusInputSchema,
377
+ };
378
+ // ---------------------------------------------------------------------------
379
+ // Aggregate exports
380
+ // ---------------------------------------------------------------------------
381
+ /**
382
+ * All MCACP tool definitions in a single array.
383
+ * Useful for bulk registration with an MCP server.
384
+ */
385
+ export const ALL_TOOLS = [
386
+ // Registry
387
+ listInstalledAgents,
388
+ registrySearch,
389
+ agentInstall,
390
+ agentUninstall,
391
+ agentCheckUpgrades,
392
+ // Lifecycle
393
+ initialize,
394
+ shutdown,
395
+ // Session
396
+ newSession,
397
+ loadSession,
398
+ listSessions,
399
+ closeSession,
400
+ // Interaction
401
+ prompt,
402
+ events,
403
+ grantPermission,
404
+ cancel,
405
+ setMode,
406
+ // Status / monitoring
407
+ listRunningAgents,
408
+ getAgentStatus,
409
+ setAgentStatus,
410
+ ];
411
+ /**
412
+ * Record mapping every tool name to its Zod input schema.
413
+ * Useful for runtime validation of incoming tool-call arguments.
414
+ */
415
+ export const TOOL_SCHEMAS = {
416
+ // Registry
417
+ list_installed_agents: ListInstalledAgentsInputSchema,
418
+ registry_search: RegistrySearchInputSchema,
419
+ agent_install: AgentInstallInputSchema,
420
+ agent_uninstall: AgentUninstallInputSchema,
421
+ agent_check_upgrades: AgentCheckUpgradesInputSchema,
422
+ // Lifecycle
423
+ initialize: InitializeInputSchema,
424
+ shutdown: ShutdownInputSchema,
425
+ // Session
426
+ new_session: NewSessionInputSchema,
427
+ load_session: LoadSessionInputSchema,
428
+ list_sessions: ListSessionsInputSchema,
429
+ close_session: CloseSessionInputSchema,
430
+ // Interaction
431
+ prompt: PromptInputSchema,
432
+ events: EventsInputSchema,
433
+ grant_permission: GrantPermissionInputSchema,
434
+ cancel: CancelInputSchema,
435
+ set_mode: SetModeInputSchema,
436
+ // Status / monitoring
437
+ list_running_agents: ListRunningAgentsInputSchema,
438
+ get_agent_status: GetAgentStatusInputSchema,
439
+ set_agent_status: SetAgentStatusInputSchema,
440
+ };
441
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/types/tools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gBAAgB,EAAE,0BAA0B;IAC5C,MAAM,EAAE,iBAAiB;IACzB,QAAQ,EAAE,kBAAkB;IAC5B,sBAAsB;IACtB,mBAAmB,EAAE,4BAA4B;IACjD,gBAAgB,EAAE,yBAAyB;IAC3C,gBAAgB,EAAE,yBAAyB;CAC5C,CAAC"}
@@ -0,0 +1,164 @@
1
+ # MCACP Configuration Guide
2
+
3
+ ## Config File Locations
4
+
5
+ MCACP loads config from multiple scopes, merged in priority order (highest wins):
6
+
7
+ | Scope | Locations | Use for |
8
+ |-------|-----------|---------|
9
+ | **Host** | `/etc/mcacp/config.json` (Linux/Mac), `%PROGRAMDATA%/mcacp/config.json` (Windows) | System-wide defaults |
10
+ | **Project** | `./mcacp.json`, `./.mcacprc.json` | Project-specific agent settings |
11
+ | **User** | `~/.config/mcacp/config.json` (Linux/Mac), `%APPDATA%/mcacp/config.json` (Windows), `~/mcacp.json` | Personal agent configs |
12
+ | **Explicit** | `--config /path/to/file` | Override everything |
13
+
14
+ All scopes accept `mcacp.json`, `.mcacprc.json`, or `config.json`. Config files merge:
15
+ `agent_servers` entries combine across scopes (user overrides project overrides host).
16
+ All other fields use the highest-priority value.
17
+
18
+ ## Config Schema
19
+
20
+ ```json
21
+ {
22
+ "agent_servers": {
23
+ "my-agent": {
24
+ "command": "/path/to/agent",
25
+ "args": ["acp"],
26
+ "env": { "API_KEY": "sk-..." },
27
+ "autoReapMs": 300000,
28
+ "permissionPolicy": "operator"
29
+ }
30
+ },
31
+ "registries": [
32
+ "https://cdn.agentclientprotocol.com/registry/v1/latest/registry.json"
33
+ ],
34
+ "defaultAutoReapMs": 300000,
35
+ "defaultPermissionPolicy": "elicit",
36
+ "sessionDir": "./.mcacp",
37
+ "installDir": "./.mcacp/agents",
38
+ "promptConsolidateMs": 5000,
39
+ "heartbeatTimeoutMs": 60000,
40
+ "clientInfo": {
41
+ "name": "mcacp",
42
+ "version": "0.1.0",
43
+ "title": "MCACP Bridge"
44
+ }
45
+ }
46
+ ```
47
+
48
+ **Note:** `cwd` is not a config-level field — it's set per-session via `new_session` / `load_session`.
49
+ Tool-call events (`tool_call`, `tool_call_update`) are surfaced in the event stream when the agent emits them.
50
+
51
+ ## agent_servers
52
+
53
+ The `agent_servers` key matches the Zed and JetBrains ACP config format:
54
+
55
+ ```json
56
+ {
57
+ "agent_servers": {
58
+ "Display Name": {
59
+ "command": "executable",
60
+ "args": ["arg1", "arg2"],
61
+ "env": { "KEY": "value" }
62
+ }
63
+ }
64
+ }
65
+ ```
66
+
67
+ **Core fields** (same as Zed/JetBrains):
68
+ - `command` (string) — executable to launch
69
+ - `args` (string[]) — command-line arguments
70
+ - `env` (object) — environment variables
71
+
72
+ **MCACP extensions** (optional):
73
+ - `autoReapMs` (number) — auto-shutdown after inactivity (ms). 0 = disabled.
74
+ - `permissionPolicy` (`elicit` | `allow_all` | `deny_all` | `operator`) — per-agent default
75
+ - `installPath` (string) — custom binary install location
76
+
77
+ ## Registering Local Agents
78
+
79
+ To add a local or custom ACP agent, add it to `agent_servers` in your config:
80
+
81
+ ```json
82
+ {
83
+ "agent_servers": {
84
+ "my-private-agent": {
85
+ "command": "npx",
86
+ "args": ["-y", "@myorg/agent@latest"],
87
+ "env": { "AGENT_TOKEN": "..." }
88
+ },
89
+ "goose": {
90
+ "command": "goose",
91
+ "args": ["acp"]
92
+ }
93
+ }
94
+ }
95
+ ```
96
+
97
+ Then call `reload_config` to pick up changes without restarting.
98
+
99
+ ## Importing from Editors
100
+
101
+ Use the `discover_agents` tool to scan for agents configured in:
102
+
103
+ - **Zed**: `~/.config/zed/settings.json` → `agent_servers`
104
+ - **JetBrains**: `~/.jetbrains/acp.json` → `agent_servers`
105
+
106
+ The tool returns discovered agents with `command`, `args`, `env`, and `source`.
107
+ Copy the entries you want into your `mcacp.json` `agent_servers` and call `reload_config`.
108
+
109
+ ### Zed config location
110
+ - Linux/Mac: `~/.config/zed/settings.json`
111
+ - Windows: `%APPDATA%/Zed/settings.json`
112
+
113
+ ### JetBrains config location
114
+ - All platforms: `~/.jetbrains/acp.json`
115
+
116
+ ## Registry
117
+
118
+ Configured via `registries` array. Default:
119
+ ```
120
+ https://cdn.agentclientprotocol.com/registry/v1/latest/registry.json
121
+ ```
122
+
123
+ Use `registry_search` to browse, `agent_install` to install from registry.
124
+ Registry-installed agents are stored in `installDir` (default: `./.mcacp/agents/`).
125
+
126
+ ## Permission Policies
127
+
128
+ | Policy | Behavior |
129
+ |--------|----------|
130
+ | `elicit` | Translates to MCP elicitation — asks the MCP client interactively |
131
+ | `allow_all` | Auto-approves all permission requests |
132
+ | `deny_all` | Auto-denies all permission requests |
133
+ | `operator` | Surfaces as `permission_request` events — the calling agent decides |
134
+
135
+ Set per-agent via `agent_servers[id].permissionPolicy` or globally via `defaultPermissionPolicy`.
136
+
137
+ ## Event Consolidation
138
+
139
+ MCACP uses Nagle-style batching for text chunk events (`agent_message_chunk`, `agent_thought_chunk`).
140
+ Instead of forwarding every individual chunk, text is accumulated and flushed as consolidated batches.
141
+
142
+ Flush triggers:
143
+ - The accumulated text contains a newline
144
+ - The consolidation timeout expires
145
+ - A non-chunk event arrives (tool_call, complete, error, permission_request)
146
+
147
+ Configure via `promptConsolidateMs` (default: `5000`ms). Set to `0` to disable consolidation and push every chunk immediately.
148
+
149
+ ## Session Storage
150
+
151
+ Sessions are persisted as JSON files under `sessionDir` (default: `./.mcacp`).
152
+ Each agent gets its own subdirectory with a `sessions` folder:
153
+
154
+ ```
155
+ .mcacp/<agent-name>/sessions/<sessionId>.json
156
+ ```
157
+
158
+ For example, an agent named `my-agent` with session `abc123` would be stored at:
159
+ ```
160
+ .mcacp/my-agent/sessions/abc123.json
161
+ ```
162
+
163
+ Installed agent binaries live in `.mcacp/agents/`.
164
+ Sessions survive restarts and can be resumed with `load_session`.
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "mcacp",
3
+ "version": "0.1.0",
4
+ "description": "MCP-to-ACP bridge — let any MCP client drive ACP coding agents",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "mcacp": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "docs",
13
+ "LICENSE",
14
+ "README.md"
15
+ ],
16
+ "scripts": {
17
+ "build": "tsc",
18
+ "dev": "tsx src/index.ts",
19
+ "test": "vitest",
20
+ "lint": "eslint src/",
21
+ "prepublishOnly": "npm run build"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/Oortonaut/mcacp.git"
26
+ },
27
+ "homepage": "https://github.com/Oortonaut/mcacp",
28
+ "bugs": {
29
+ "url": "https://github.com/Oortonaut/mcacp/issues"
30
+ },
31
+ "keywords": [
32
+ "mcp",
33
+ "acp",
34
+ "agent-control-protocol",
35
+ "model-context-protocol",
36
+ "coding-agent",
37
+ "multi-agent",
38
+ "claude",
39
+ "gemini",
40
+ "codex"
41
+ ],
42
+ "author": "Oortonaut",
43
+ "license": "Apache-2.0",
44
+ "dependencies": {
45
+ "@modelcontextprotocol/sdk": "^1.12.1",
46
+ "zod": "^3.24.2"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^22.12.0",
50
+ "eslint": "^9.19.0",
51
+ "tsx": "^4.19.2",
52
+ "typescript": "^5.7.3",
53
+ "vitest": "^3.0.4"
54
+ },
55
+ "engines": {
56
+ "node": ">=20"
57
+ }
58
+ }