SDK and MCP API
Agent Harness exposes programmatic control through its Node SDK and MCP integration. The CLI remains the best interactive diagnostic surface.
The SDK and MCP server are integration surfaces for a locally controlled Harness deployment; they are not a hosted Agent Harness API.
SDK
The source package's primary SDK entry point is harness/sdk/index.ts.
Supported high-level flows are:
- delegate one bounded task
- enqueue work for a remote controller
- inspect run status
- collect reports
- resolve approval decisions where the current helper supports them
Use the exported types and examples from the matching release. Treat report fields as additive during the current soft-stable compatibility period.
MCP
The MCP integration is implemented by harness/mcp.ts. Its supported flow is
agent-facing delegation and governance:
- create a plan from task definitions
- delegate a task
- inspect run status
- collect a report
- resolve approvals
MCP clients should discover the current tool schemas at connection time rather than assuming a fixed list of names or fields.
Controller and UI surfaces
Distributed deployments also expose controller and UI operations for status, runner health, approvals, summaries, reports, and compliance evidence. These are deployment-local interfaces. The controller binds to loopback by default; if you expose it for distributed workers, configure authentication and network controls in the deployment rather than publishing private hostnames or tokens.
Integration rules
- Keep credentials in environment variables or the configured credential store.
- Set explicit timeouts and task bounds.
- Treat run IDs, task IDs, and artifact fields as opaque.
- Inspect verification evidence before accepting a result.
- Pin the Agent Harness version when building automation.
For operator commands and approval/recovery workflows, see the CLI reference and operations guide.