Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

feat(mcp): harness_start may run any engine, and prefer project folders (#1425)

lingrd74ec2a0c47c0
diff --git a/cli/packages/harness-mcp/README.md b/cli/packages/harness-mcp/README.md
index df9a3d350..ca0f3cf50 100644
--- a/cli/packages/harness-mcp/README.md
+++ b/cli/packages/harness-mcp/README.md
@@ -2,7 +2,7 @@
[Harness](https://harness.autonomous.ai/agents) as an MCP server, for clients that install servers from npm.
-Harness runs coding agents (Claude Code, Codex) in sessions of their own, on this computer or the person's other
+Harness runs coding agents (Claude Code, Codex, and other engines) in sessions of their own, on this computer or the person's other
machines, and the person can watch and join every one in the Harness app. With this server an agent can start
harnesses, wait for them, read their answers and close them:
@@ -12,7 +12,7 @@ harnesses, wait for them, read their answers and close them:
| `harness_list` | the harnesses here: state, who started each, what each is about |
| `harness_search` | search every past and live conversation on this computer for the words that say them |
| `harness_machines` | the machines on this account, for running a harness on another one |
-| `harness_start` | start an agent on a task in a folder or a new project, by name |
+| `harness_start` | start an agent (claude, codex, opencode, pi, …) on a task, in a new project it owns (no trust prompt) or an existing folder (the engine asks the person to trust it) |
| `harness_wait` | wait until harnesses stop working |
| `harness_read` | a harness's last ask and its answer |
| `harness_close` | close a harness you started |
diff --git a/cli/packages/harness-mcp/mcpb/manifest.json b/cli/packages/harness-mcp/mcpb/manifest.json
index 0ebb25831..0e138e320 100644
--- a/cli/packages/harness-mcp/mcpb/manifest.json
+++ b/cli/packages/harness-mcp/mcpb/manifest.json
@@ -3,8 +3,8 @@
"name": "harness",
"display_name": "Harness",
"version": "0.0.0",
- "description": "Start Claude Code and Codex agents the person can watch, wait for them and read their answers.",
- "long_description": "Harness runs coding agents (Claude Code, Codex) in sessions of their own, on this computer or the person's other machines. The person can watch and join every one in the Harness app. With this extension, Claude can start harnesses, wait for them, read their answers and close them.\n\n**It needs the Harness CLI** (macOS or Linux):\n\n```\ncurl -fsSL https://harness.autonomous.ai/cli/install.sh | bash\nharness start\n```\n\nOn Linux the installer installs tmux and curl with apt-get, which asks for your password.\n\nNo account is needed for harnesses on this computer. Until the CLI is installed, the extension offers one tool, `harness_setup`, that says how to install it.\n\nClaude may give work to, and close, only the harnesses it started. The rest are the person's.",
+ "description": "Start coding agents (Claude Code, Codex, and more) the person can watch and read.",
+ "long_description": "Harness runs coding agents (Claude Code, Codex, and other engines) in sessions of their own, on this computer or the person's other machines. The person can watch and join every one in the Harness app. With this extension, Claude can start harnesses, wait for them, read their answers and close them.\n\n**It needs the Harness CLI** (macOS or Linux):\n\n```\ncurl -fsSL https://harness.autonomous.ai/cli/install.sh | bash\nharness start\n```\n\nOn Linux the installer installs tmux and curl with apt-get, which asks for your password.\n\nNo account is needed for harnesses on this computer. Until the CLI is installed, the extension offers one tool, `harness_setup`, that says how to install it.\n\nClaude may give work to, and close, only the harnesses it started. The rest are the person's.",
"author": {
"name": "Autonomous",
"url": "https://harness.autonomous.ai"
@@ -44,7 +44,7 @@
},
{
"name": "harness_start",
- "description": "Start a new harness: an agent in a session of its own, working on a task in a folder, or in a new project Harness makes for it. Returns at once."
+ "description": "Start a new harness: an agent (claude, codex, opencode, pi, …) in a session of its own, working on a task in a new project Harness makes and owns (no approval) or in an existing folder (the engine asks the person to trust it). Prefer project."
},
{
"name": "harness_wait",
diff --git a/cli/src/agentClient/mcp.spec.ts b/cli/src/agentClient/mcp.spec.ts
index b69af8642..03bcdd8ad 100644
--- a/cli/src/agentClient/mcp.spec.ts
+++ b/cli/src/agentClient/mcp.spec.ts
@@ -2,7 +2,7 @@ import { PassThrough } from 'node:stream'
import { parseNewArgs } from '../lib/newCommand.js'
import { step } from './commands.js'
import { describe, expect, it } from 'vitest'
-import { agentOfClient, answer, callerEnv, INSTRUCTIONS, mcpCommand, PROTOCOL_VERSIONS, result, TOOLS, type McpDeps, type Ran } from './mcp.js'
+import { agentOfClient, answer, callerEnv, INSTRUCTIONS, mcpCommand, PROTOCOL_VERSIONS, result, STARTABLE_AGENTS, TOOLS, type McpDeps, type Ran } from './mcp.js'
import { HARNESS_AGENT_TOOLS } from '../engines/facets/hooks.js'
/** A runner that records what it was asked and answers [ran]. */
@@ -134,6 +134,20 @@ describe('harness mcp', () => {
expect(r.calls.map((c) => c.argv)).toEqual([['search', 'the missing diff'], ['machines']])
})
+ it('lets harness_start run any startable engine, not only claude and codex', async () => {
+ const listed = ((await answer({ jsonrpc: '2.0', id: 1, method: 'tools/list' }, deps()))!.result as { tools: Array<{ name: string; inputSchema: { properties: Record<string, unknown> } }> }).tools
+ const start = listed.find((tool) => tool.name === 'harness_start')!
+ const agentSchema = start.inputSchema.properties.agent as { enum?: string[] }
+ expect(agentSchema.enum).toContain('claude')
+ expect(agentSchema.enum).toContain('codex')
+ expect(agentSchema.enum).toContain('opencode')
+ expect(agentSchema.enum).toContain('pi')
+ expect(agentSchema.enum).toContain('cursor')
+ // Every engine but the terminal is startable, and the terminal is not an agent.
+ expect(agentSchema.enum).toEqual(STARTABLE_AGENTS)
+ expect(agentSchema.enum).not.toContain('terminal')
+ })
+
it('starts a harness in a new project Harness makes when asked for one, or when given no folder', async () => {
// A folder was required, so Codex as an MCP client could only name one of its own: Claude Code, started in an empty
// ~/work, waited on its trust question (a clean VM, CLI 0.3.75, 2026-10-11).
@@ -141,7 +155,7 @@ describe('harness mcp', () => {
.tools.find((tool) => tool.name === 'harness_start')!
expect(listed.inputSchema.required).toEqual(['task', 'name'])
expect(listed.inputSchema.properties).toHaveProperty('project')
- expect(INSTRUCTIONS).toContain('For scratch or new work give it a project name (project), not a folder of your own')
+ expect(INSTRUCTIONS).toContain('Give it a project name (project), never a folder of your own')
const r = runner()
const d = deps({ run: r.run })
await answer(call('harness_start', { task: 'a second opinion', project: 'opinion', name: 'opinion' }), d)
diff --git a/cli/src/agentClient/mcp.ts b/cli/src/agentClient/mcp.ts
index 677cd93f6..be0e85246 100644
--- a/cli/src/agentClient/mcp.ts
+++ b/cli/src/agentClient/mcp.ts
@@ -16,14 +16,15 @@ import { createInterface } from 'node:readline'
import { VERSION } from '../version.js'
import { AGENT_SESSION_ENV } from './model.js'
import { EXIT, VIA_MCP_ENV } from './commands.js'
+import { ENGINES, TERMINAL_ENGINE } from '../engines/types.js'
/** Newest first: the client's own when it is one of these, else the newest. */
export const PROTOCOL_VERSIONS = ['2025-11-25', '2025-06-18', '2025-03-26', '2024-11-05'] as const
/** What an agent is told once, as it connects: when Harness is the right tool, and whose harnesses are whose. */
-export const INSTRUCTIONS = `Harness runs coding agents (Claude Code, Codex) in sessions of their own, on this computer or the person's other machines. The person can watch and join every one in the Harness app.
+export const INSTRUCTIONS = `Harness runs coding agents (Claude Code, Codex, and other engines) in sessions of their own, on this computer or the person's other machines. The person can watch and join every one in the Harness app.
-Every harness spends the person's tokens. Start one (harness_start) only for work that can run in parallel with yours, needs another model's view (a review, a second opinion from Codex), takes long, or belongs in its own folder. Do quick work yourself. For scratch or new work give it a project name (project), not a folder of your own: Claude Code and Codex ask the person to trust a folder Harness did not make.
+Every harness spends the person's tokens. Start one (harness_start) only for work that can run in parallel with yours, needs another model's view (a review, a second opinion from Codex), takes long, or belongs in its own folder. Do quick work yourself. Give it a project name (project), never a folder of your own: Harness owns and trusts a project folder it makes (~/harnesses/<name>), so the agent needs no approval; a folder you name makes Claude Code or Codex ask the person to trust it, and it waits until they answer.
Call harness_whoami first: it says whether you may start harnesses now. Then list (harness_list), search what was already said or decided (harness_search), and see the machines you may run on (harness_machines). Put everything in the task: starting a harness does not let you message it. A follow-up goes by harness_send only to a teammate in your tab, while Agent Messages are on; otherwise start a new harness with the fuller task. Never give work to, or close, a harness you did not start: those are the person's.
@@ -46,6 +47,9 @@ interface Tool {
argv: (args: Record<string, unknown>, cwd: string) => string[]
}
+/** The agents a harness may be started with: every engine but the terminal (a shell pane is not an agent). */
+export const STARTABLE_AGENTS = ENGINES.filter((engine) => engine !== TERMINAL_ENGINE)
+
const str = (value: unknown): string => (typeof value === 'string' ? value.trim() : '')
const schema = (properties: Record<string, unknown>, required: string[] = []) => ({ type: 'object', properties, required, additionalProperties: false })
@@ -80,13 +84,13 @@ export const TOOLS: Tool[] = [
},
{
name: 'harness_start',
- description: 'Start a new harness: an agent in a session of its own, working on [task] in an existing [folder], or in a new [project] Harness makes for it. Returns within a minute; wait for it with harness_wait and read its answer with harness_read. If its agent is still being installed then, it starts by itself: follow it by its name, and never start it again.',
+ description: 'Start a new harness: an agent in a session of its own, working on [task] in a new [project] Harness makes and owns (no approval needed), or in an existing [folder] (the engine asks the person to trust it). Prefer project. Returns within a minute; wait for it with harness_wait and read its answer with harness_read. If its agent is still being installed then, it starts by itself: follow it by its name, and never start it again.',
inputSchema: schema({
task: { type: 'string', description: 'The whole task, as you would write it to a colleague: what to do, where, and what to answer with.' },
- folder: { type: 'string', description: 'An existing folder to work in: an absolute path, or one relative to where this server runs. Claude Code and Codex ask the person to trust a folder Harness did not make, and wait until they answer.' },
- project: { type: 'string', description: 'For scratch or new work, instead of folder: a name for a new project folder Harness makes (~/harnesses/<name>), which needs no approval. With neither, Harness names one.' },
+ project: { type: 'string', description: 'For scratch or new work, always prefer this: a name for a new project folder Harness makes (~/harnesses/<name>) and trusts, so the agent needs no approval. With neither, Harness names one.' },
+ folder: { type: 'string', description: 'Only for work that must live in an existing folder: an absolute path, or one relative to where this server runs. Claude Code and Codex ask the person to trust a folder Harness did not make, and wait until they answer — so prefer project.' },
name: { type: 'string', description: 'A short name to call it by (e.g. "reviewer"). Always give one.' },
- agent: { type: 'string', enum: ['claude', 'codex'], description: 'Claude Code (default) or Codex.' },
+ agent: { type: 'string', enum: [...STARTABLE_AGENTS], description: 'The agent to run: Claude Code (default), Codex, or another harness engine (opencode, pi, cursor, …).' },
machine: { type: 'string', description: 'Another of the person\'s machines, by name, to run it there.' },
}, ['task', 'name']),
// Starting a harness only adds one, on the person's own machines. Said so, Codex runs it without asking: a tool
diff --git a/server.json b/server.json
index ec4e471be..c75d94e09 100644
--- a/server.json
+++ b/server.json
@@ -2,7 +2,7 @@
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "ai.autonomous.harness/harness",
"title": "Harness",
- "description": "Start Claude Code and Codex agents the person can watch, wait for them and read their answers.",
+ "description": "Start coding agents (Claude Code, Codex, and more) the person can watch and read.",
"websiteUrl": "https://harness.autonomous.ai/agents",
"repository": {
"url": "https://github.com/autonomous-ai/openharness",