# Open Harness

> A code-first, composable SDK to build powerful AI agents

- **Type:** MCP server
- **Install:** `agentstack add mcp-maxgfeller-open-harness`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [MaxGfeller](https://agentstack.voostack.com/s/maxgfeller)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [MaxGfeller](https://github.com/MaxGfeller)
- **Source:** https://github.com/MaxGfeller/open-harness
- **Website:** https://open-harness.dev

## Install

```sh
agentstack add mcp-maxgfeller-open-harness
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# OpenHarness

Build capable, general-purpose AI agents in code. Based on [Vercel's AI SDK](https://sdk.vercel.ai), inspired by Claude Code, Codex, and similar agent harnesses.

**[Documentation](https://docs.open-harness.dev)**

## Packages

| Package | Description |
| --- | --- |
| [`@openharness/core`](packages/core) | Agent, Session, Conversation, middleware, tools, UI stream integration |
| [`@openharness/provider-chatgpt`](packages/provider-chatgpt) | Experimental ChatGPT/Codex OAuth model provider for ChatGPT subscription-backed local harnesses |
| [`@openharness/provider-vfs`](packages/provider-vfs) | Virtual filesystem provider for sandboxed, in-memory, or SQLite-backed file access |
| [`@openharness/react`](packages/react) | React hooks and provider for AI SDK 5 chat UIs |
| [`@openharness/vue`](packages/vue) | Vue 3 composables and provider for AI SDK 5 chat UIs |

## Quick Start

```bash
npm install @openharness/core @ai-sdk/openai
```

```typescript
import { Agent, createFsTools, createBashTool, NodeFsProvider, NodeShellProvider } from "@openharness/core";
import { openai } from "@ai-sdk/openai";

const agent = new Agent({
  name: "dev",
  model: openai("gpt-5.4"),
  tools: {
    ...createFsTools(new NodeFsProvider()),
    ...createBashTool(new NodeShellProvider()),
  },
  maxSteps: 20,
});

for await (const event of agent.run([], "Refactor the auth module")) {
  if (event.type === "text.delta") process.stdout.write(event.text);
}
```

## Multi-Turn with Sessions

```typescript
import { Session } from "@openharness/core";

const session = new Session({ agent, contextWindow: 128_000 });

for await (const event of session.send("List all TypeScript files")) {
  if (event.type === "text.delta") process.stdout.write(event.text);
}

// Session remembers the conversation, handles compaction and retry
for await (const event of session.send("Now refactor the largest one")) {
  if (event.type === "text.delta") process.stdout.write(event.text);
}
```

## Composable Middleware

```typescript
import { Conversation, toRunner, apply, withTurnTracking, withCompaction, withRetry } from "@openharness/core";

const runner = apply(
  toRunner(agent),
  withTurnTracking(),
  withCompaction({ contextWindow: 200_000, model: agent.model }),
  withRetry({ maxRetries: 5 }),
);

const chat = new Conversation({ runner });
for await (const event of chat.send("Fix the bug")) { /* ... */ }
```

## Subagents

Built-in subagents stay stateless by default, but you can now opt into:

- Dynamic subagent catalogs resolved at run time
- Resumable subagent sessions built on top of `Session`
- Background runs with separate run IDs and session IDs

## Examples

| Example | Run |
| --- | --- |
| [CLI agent](examples/cli) — terminal agent with tool approval and subagents | `pnpm --filter cli-demo start` or `pnpm --filter cli-demo start -- --chatgpt` |
| [Next.js chat](examples/nextjs-demo) — streaming chat with `@openharness/react` | `pnpm --filter nextjs-demo dev` |
| [Nuxt chat](examples/nuxt-demo) — streaming chat with `@openharness/vue` | `pnpm --filter nuxt-demo dev` |

By default the examples use `OPENAI_API_KEY`. The CLI agent can instead use ChatGPT/Codex OAuth with `--chatgpt`.

To run them:

```bash
git clone https://github.com/MaxGfeller/open-harness.git
cd open-harness
echo "OPENAI_API_KEY=sk-..." > .env
pnpm install && pnpm build
```

## Learn More

See the full documentation at **[docs.open-harness.dev](https://docs.open-harness.dev)** for:

- [Agents](https://docs.open-harness.dev/core/agents) — stateless executors, events, configuration
- [Sessions](https://docs.open-harness.dev/core/sessions) — compaction, retry, persistence, hooks
- [Middleware](https://docs.open-harness.dev/core/middleware) — composable middleware and the Conversation API
- [Tools](https://docs.open-harness.dev/tools/built-in-tools) — filesystem, bash, custom tools, permissions
- [Subagents](https://docs.open-harness.dev/advanced/subagents) — nested delegation, dynamic catalogs, resumable sessions, and background execution
- [MCP Servers](https://docs.open-harness.dev/advanced/mcp-servers) — Model Context Protocol integration
- [Skills](https://docs.open-harness.dev/advanced/skills) — on-demand instruction packages
- [UI Integration](https://docs.open-harness.dev/ui-integration/server-streaming) — React and Vue streaming

## License

MIT — see [LICENSE](./LICENSE) for details.

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [MaxGfeller](https://github.com/MaxGfeller)
- **Source:** [MaxGfeller/open-harness](https://github.com/MaxGfeller/open-harness)
- **License:** MIT
- **Homepage:** https://open-harness.dev

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-maxgfeller-open-harness
- Seller: https://agentstack.voostack.com/s/maxgfeller
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
