Open Harness

v0.6.2Coding Agentsstable

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

agentsagentskillsaiai-agentsmcp
Share:
527
Stars
0
Downloads
0
Weekly
0/5

What is Open Harness?

Open Harness is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to code-first, composable sdk to build powerful ai agents

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

This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

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

Use Cases

Code-first AI agent SDK
Composable agent tools
Agent skill building
MaxGfeller

Maintainer

LicenseMIT
Languagetypescript
Versionv0.6.2
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y @openharness/core

Manual Installation

npx -y @openharness/core

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Open Harness

OpenHarness is a code-first, composable TypeScript SDK for building general-purpose AI agents, inspired by Claude Code and Codex. It provides an Agent class backed by Vercel's AI SDK, built-in filesystem and bash tools, multi-turn Session management with automatic context compaction and retry, composable middleware (turn tracking, retry, compaction), and nested subagent delegation with optional background runs. Developers use it to build custom coding agents, chat interfaces, and automation workflows in Node.js without being locked to a single LLM provider.

Prerequisites

  • Node.js 18+ and npm or pnpm
  • An LLM provider API key — default examples use OPENAI_API_KEY; the package supports any Vercel AI SDK provider including Anthropic, Groq, and others
  • An MCP-compatible client if using the MCP server mode (Claude Desktop, Cursor, etc.)
1

Install the core package

Install @openharness/core and an AI SDK provider package. The default examples use OpenAI, but you can substitute any Vercel AI SDK-compatible provider.

npm install @openharness/core @ai-sdk/openai
2

Create a basic agent

Import Agent from @openharness/core, configure it with a model and tools, then iterate over the streamed events. The built-in createFsTools and createBashTool give the agent file system and shell access.

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

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

for await (const event of agent.run([], "List all TypeScript files and count lines")) {
  if (event.type === "text.delta") process.stdout.write(event.text);
}
3

Add multi-turn Sessions for persistent conversations

Wrap the agent in a Session to maintain conversation history across messages. The Session handles context window compaction and automatic retry transparently.

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);
}
for await (const event of session.send("Now refactor the largest one")) {
  if (event.type === "text.delta") process.stdout.write(event.text);
}
4

Add composable middleware

Use the apply helper with middleware factories to add turn tracking, context compaction, and retry behavior to any agent runner without modifying the agent itself.

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 all linting errors")) { /* ... */ }
5

Add to your MCP client config

If you want to use the OpenHarness MCP server mode, add it to your Claude Desktop or Cursor configuration using npx.

{
  "mcpServers": {
    "open-harness": {
      "command": "npx",
      "args": ["-y", "@openharness/core"],
      "env": {
        "OPENAI_API_KEY": "your-openai-api-key"
      }
    }
  }
}

Open Harness Examples

Client configuration

Claude Desktop configuration for the OpenHarness MCP server using npx with an OpenAI API key.

{
  "mcpServers": {
    "open-harness": {
      "command": "npx",
      "args": ["-y", "@openharness/core"],
      "env": {
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Prompts to try

Example tasks suited to OpenHarness agents equipped with filesystem and bash tools.

- "List all TypeScript files in the src directory and identify any that are over 300 lines."
- "Refactor the auth module to use async/await instead of callbacks."
- "Run the test suite and summarize which tests are failing and why."
- "Find all TODO comments in the codebase and create a prioritized task list."
- "Analyze the package.json and suggest dependency updates with changelog summaries."

Troubleshooting Open Harness

Agent exceeds context window and throws a context length error

Wrap the agent in a Session or use the withCompaction middleware with a contextWindow value that matches your model's limit. Compaction summarizes older turns before they would overflow the window.

Bash tool executes commands but changes are not persisted between turns

Each bash tool invocation runs in a fresh shell by default. Chain commands with && or write state to files between turns. The filesystem tools (createFsTools) maintain state through the real filesystem.

Provider API key errors or model not found

Ensure the provider package matching your chosen model is installed (e.g. @ai-sdk/openai for OpenAI, @ai-sdk/anthropic for Claude) and the correct environment variable is set (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.).

Frequently Asked Questions about Open Harness

What is Open Harness?

Open Harness is a Model Context Protocol (MCP) server that code-first, composable sdk to build powerful ai agents It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Open Harness?

Install via npm with the command: npx -y @openharness/core. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Open Harness?

Open Harness works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Open Harness free to use?

Yes, Open Harness is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Coding Agents MCP Servers

Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "open-harness": { "command": "npx", "args": ["-y", "@openharness/core"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Open Harness?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides