harness-mcp

Create and manage MCP server config entities in the agent-harness workspace.

5 stars

Best use case

harness-mcp is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Create and manage MCP server config entities in the agent-harness workspace.

Teams using harness-mcp should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/harness-mcp/SKILL.md --create-dirs "https://raw.githubusercontent.com/madebywild/agent-harness/main/.claude/skills/harness-mcp/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/harness-mcp/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How harness-mcp Compares

Feature / Agentharness-mcpStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Create and manage MCP server config entities in the agent-harness workspace.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# /harness-mcp

Use this skill to create, edit, and manage `mcp` entities in the agent-harness workspace. An `mcp` entity defines one or more MCP (Model Context Protocol) servers in a single JSON config file. When `harness apply` runs, all `mcp` config files are merged and rendered into each enabled provider's native format.

---

## What is an `mcp` entity?

An `mcp` entity is a JSON file under `.harness/src/mcp/<config-id>.json`. It contains a map of server definitions keyed by server ID. Multiple `mcp` config files are supported — harness merges them at apply time. If the same server ID appears in more than one file, harness rejects the plan with a collision error.

Source path: `.harness/src/mcp/<config-id>.json`

The file is a flat JSON object where each top-level key is a server ID and its value is the server definition. Any key-shape that does not use a reserved wrapper key (`servers` or `mcpServers`) is treated as a direct server map; files that happen to use those wrapper keys are unwrapped automatically before merging.

---

## Provider output mapping

| Field | Claude Code | OpenAI Codex CLI | GitHub Copilot | Cursor |
|-------|-------------|------------------|----------------|--------|
| Output file | `.mcp.json` | `.codex/config.toml` | `.vscode/mcp.json` | `.cursor/mcp.json` |
| Root key | `mcpServers` | `[mcp_servers.<id>]` | `servers` | `mcpServers` |
| Format | JSON | TOML | JSON | JSON |

### Claude Code — `.mcp.json`

Root key: `mcpServers`. Each server entry supports:

| Field | Type | Description |
|-------|------|-------------|
| `command` | string | Executable to run (stdio transport) |
| `args` | string[] | Arguments passed to the command |
| `env` | object | Environment variables forwarded to the server process |
| `type` | string | Transport: `stdio` (default), `sse`, or `http` |
| `url` | string | Endpoint URL (for `sse` / `http` transport) |

Project-scoped MCP servers live in `.mcp.json` at the repo root. This is the file harness writes.

Official docs: https://code.claude.com/docs/en/mcp

### OpenAI Codex CLI — `.codex/config.toml`

Section: `[mcp_servers.<id>]`. Fields rendered by harness are `command`, `args`, and `env`. The full field set supported by Codex config includes:

| Field | Type | Description |
|-------|------|-------------|
| `command` | string | Launcher command for a stdio MCP server |
| `args` | string[] | Arguments passed to the command |
| `cwd` | string | Working directory for the server process |
| `env` | map | Environment variables forwarded to the server |
| `env_vars` | string[] | Additional env vars to whitelist |
| `url` | string | Endpoint for an HTTP/streamable MCP server |
| `bearer_token_env_var` | string | Env var name supplying the bearer token (HTTP) |
| `enabled` | boolean | Disable without removing (default: true) |
| `enabled_tools` | string[] | Allowlist of tool names exposed by this server |
| `disabled_tools` | string[] | Denylist applied after `enabled_tools` |
| `required` | boolean | Fail startup if server cannot initialize |
| `startup_timeout_sec` | number | Override default 10 s startup timeout |
| `tool_timeout_sec` | number | Override default 60 s per-tool timeout |

Official docs: https://developers.openai.com/codex/config-reference

### GitHub Copilot — `.vscode/mcp.json`

Root key: `servers`. Each server entry supports:

| Field | Type | Description |
|-------|------|-------------|
| `type` | string | Transport: `stdio` (default), `sse`, or `http` |
| `command` | string | Executable to run (stdio) |
| `args` | string[] | Arguments passed to the command |
| `env` | object | Environment variables |
| `url` | string | Remote server endpoint (sse / http) |
| `inputs` | object | Input variable definitions for sensitive data |

Official docs: https://code.visualstudio.com/docs/copilot/chat/mcp-servers

### Cursor — `.cursor/mcp.json`

Root key: `mcpServers`. Each server entry supports:

| Field | Type | Description |
|-------|------|-------------|
| `command` | string | Executable to run (stdio transport) |
| `args` | string[] | Arguments passed to the command |
| `env` | object | Environment variables forwarded to the server process |
| `envFile` | string | Path to an `.env` file (stdio only) |
| `type` | string | Transport: `stdio` (default) |
| `url` | string | Endpoint URL (for `sse` / Streamable HTTP transport) |
| `headers` | object | HTTP headers (for remote servers) |
| `auth` | object | Static OAuth credentials (`CLIENT_ID`, `CLIENT_SECRET`, `scopes`) |

Cursor supports three transport methods: `stdio` (local), `SSE` (local/remote), and `Streamable HTTP` (local/remote). Protocol capabilities include tools, prompts, resources, roots, elicitation, and MCP apps (interactive UI extension).

Configuration locations: project (`.cursor/mcp.json`) or global (`~/.cursor/mcp.json`).

Config interpolation supported in `command`, `args`, `env`, `url`, and `headers`:
- `${env:NAME}` — environment variables
- `${userHome}` — home directory
- `${workspaceFolder}` — project root
- `${workspaceFolderBasename}` — project root name
- `${pathSeparator}` / `${/}` — OS path separator

Official docs: https://docs.cursor.com/context/mcp

---

## Canonical source format

The harness source file is a plain JSON object. Use one server-ID key per server you want to register:

```json
{
  "<server-id>": {
    "command": "...",
    "args": ["..."],
    "env": {
      "VAR_NAME": "value"
    }
  }
}
```

You may define as many servers as needed in one file, or split them across multiple `mcp` entity files. Harness merges all files before rendering — server IDs must be unique across all files.

---

## Harness CLI commands

```bash
# Scaffold a new mcp config file and register it in the manifest
npx harness add mcp <config-id>

# After editing the source file, generate provider artifacts
npx harness apply

# Preview what apply will do (no writes)
npx harness plan

# Remove an mcp entity and its source file
npx harness remove mcp <config-id>

# Remove entity but keep the source file
npx harness remove mcp <config-id> --no-delete-source
```

---

## Copy-paste example

`.harness/src/mcp/servers.json` — a filesystem server and a Postgres server:

```json
{
  "filesystem": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"],
    "env": {}
  },
  "postgres": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-postgres"],
    "env": {
      "POSTGRES_CONNECTION_STRING": "${POSTGRES_CONNECTION_STRING}"
    }
  }
}
```

After running `npx harness apply`, harness writes:

**`.mcp.json`** (Claude Code):
```json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "POSTGRES_CONNECTION_STRING": "actual-value-from-env"
      }
    }
  }
}
```

**`.codex/config.toml`** (Codex CLI):
```toml
[mcp_servers.filesystem]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]

[mcp_servers.postgres]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-postgres"]

[mcp_servers.postgres.env]
POSTGRES_CONNECTION_STRING = "actual-value-from-env"
```

**`.vscode/mcp.json`** (GitHub Copilot):
```json
{
  "servers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "POSTGRES_CONNECTION_STRING": "actual-value-from-env"
      }
    }
  }
}
```

---

## Environment variable substitution

Use `${ENV_VAR_NAME}` placeholders anywhere in the JSON values. Harness substitutes them at apply time using the process environment. This keeps secrets out of source-controlled files.

```json
{
  "my-api-server": {
    "command": "npx",
    "args": ["-y", "my-mcp-server"],
    "env": {
      "API_KEY": "${MY_API_KEY}",
      "BASE_URL": "${MY_API_BASE_URL}"
    }
  }
}
```

If a referenced variable is not set in the environment, harness will error during apply.

---

## Typical workflow

```bash
# 1. Enable providers (once per project)
npx harness provider enable claude
npx harness provider enable codex
npx harness provider enable copilot

# 2. Scaffold the config file
npx harness add mcp servers

# 3. Edit .harness/src/mcp/servers.json with your server definitions

# 4. Review the plan
npx harness plan

# 5. Write provider artifacts
npx harness apply
```

---

## Official documentation

- Claude Code MCP: https://code.claude.com/docs/en/mcp
- Claude Code Settings: https://code.claude.com/docs/en/settings
- OpenAI Codex Config Reference: https://developers.openai.com/codex/config-reference
- GitHub Copilot MCP (VS Code): https://code.visualstudio.com/docs/copilot/chat/mcp-servers
- Cursor MCP: https://docs.cursor.com/context/mcp

Related Skills

harness-subagent

5
from madebywild/agent-harness

Create and manage subagent entities in the agent-harness workspace. Invoke this skill when a user wants to define, scaffold, apply, or remove a subagent across Claude Code, OpenAI Codex, or GitHub Copilot.

harness-skill

5
from madebywild/agent-harness

Create and manage skill entities in the agent-harness workspace. Use when the user wants to add a new skill, understand how skills work across providers, or generate provider skill artifacts from a canonical source.

harness-settings

5
from madebywild/agent-harness

Configure provider-specific settings (permissions, model, features) for Claude Code, OpenAI Codex CLI, and GitHub Copilot using the harness settings entity.

harness-prompt

5
from madebywild/agent-harness

Create and manage the system prompt entity in agent-harness, generating CLAUDE.md, AGENTS.md, and copilot-instructions.md from a single canonical source.

harness-hook

5
from madebywild/agent-harness

Create and manage lifecycle hook entities in the agent-harness workspace. Covers canonical event authoring, provider projection (Claude Code, GitHub Copilot, OpenAI Codex CLI, Cursor), mode behavior, handler types, the full event/provider support matrix, copy-paste recipes, and common diagnostics.

npm-workflow-release

5
from madebywild/agent-harness

Release agent-harness packages to npm and verify publication. Use when the user asks to cut a release, push a missing release tag, or troubleshoot why a version was not published.

academic-figure-drawing-harness

9
from u9401066/pubmed-search-mcp

Codex drawing harness integration. Triggers: 繪圖, draw, figure, chart, plot, mermaid, SVG, Gemini, graph, 生成圖表.

zotero-keeper-harness

9
from u9401066/pubmed-search-mcp

Cline harness for Zotero Keeper and the bundled VS Code extension. Triggers: zotero keeper, zotero mcp, full check, release checklist, workflow, vsix, Cline.

pubmed-search-mcp-harness

9
from u9401066/pubmed-search-mcp

Cline harness for PubMed Search MCP. Triggers: pubmed search, literature search, unified_search, pipeline, fulltext, release checklist, Cline.

asset-aware-mcp-harness

9
from u9401066/pubmed-search-mcp

Cline harness for this repo (rules + workflows + checks). Triggers: cline harness, full check, release checklist, workflow, 文檔工作流, DFM, citation-ready.

long-running-harness

9
from dapi/claude-code-marketplace

**UNIVERSAL TRIGGER**: Use when user wants to START/CONTINUE/MANAGE a long-running development project across multiple sessions. Common patterns: - "start/init/begin new project [description]" - "continue/resume working on [project]" - "начать/инициализировать проект", "продолжить работу над проектом" - "set up harness for [project]", "create project scaffolding" Session types supported: **Initialize (first run)**: - "init long-running project", "start new multi-session project" - "set up project harness", "create progress tracking" - "initialize [web-app/api/cli] project", "начать долгий проект" **Continue (subsequent sessions)**: - "continue project", "resume work", "продолжить работу" - "pick up where I left off", "what's next", "следующая фича" - "next feature", "continue implementation" **Status & Progress**: - "show project progress", "what features are done" - "project status", "статус проекта", "что сделано" - "remaining features", "what's left to do" **Management**: - "mark feature as done", "update progress" - "add new feature to list", "reprioritize features" Context patterns: - "get/show/list project progress" - "check project status" - "what features in project" - "display remaining features" - "fetch session history" - "retrieve progress log" TRIGGERS: long-running, multi-session, project harness, initialize project, continue project, resume work, progress tracking, feature list, session handoff, incremental development, cross-session, долгий проект, продолжить работу, прогресс проекта, следующая сессия, инициализация проекта, get project status, show features, list remaining, check progress, display status, fetch history, retrieve log, what features done, start harness, begin project, resume session, next feature, pick up work, update progress, mark done, end session Based on Anthropic's research on effective harnesses for long-running agents. Source: https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents

eval-harness

9
from j7-dev/everything-github-copilot

Formal evaluation framework for Copilot CLI sessions implementing eval-driven development (EDD) principles