# Harness MCP server

> Lets AI agents list, read, create, and manage Harness pipelines, services, environments, feature flags, and cloud cost data through 11 tools.

- Repository: https://github.com/harness/mcp-server
- Page: https://hostedmcp.org/servers/harness/mcp-server
- Official: yes
- Transport: stdio
- Stars: 114
- License: MIT

## Install

### Claude Code

```sh
claude mcp add mcp-server -- npx -y harness-mcp-v2
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "harness-mcp-v2"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "harness-mcp-v2"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp-server","type":"stdio","command":"npx","args":["-y","harness-mcp-v2"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "harness-mcp-v2"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add mcp-server -- npx -y harness-mcp-v2
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp-server]
command = "npx"
args = ["-y", "harness-mcp-v2"]
```

### Gemini CLI

```sh
gemini mcp add -s user mcp-server npx -- -y harness-mcp-v2
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "harness-mcp-v2"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `CLIENT_ID` | no | no |  |
| `HARNESS_API_KEY` | no | no |  |
| `HARNESS_AUTO_APPROVE_RISK` | no | no |  |
| `HARNESS_MCP_MODE` | no | no |  |
| `HARNESS_SEARCH_PROVIDER` | no | no |  |
| `HARNESS_SEARCH_SERVICE_HEADERS` | no | no |  |
| `HARNESS_SEARCH_SERVICE_URL` | no | no |  |
| `HARNESS_TOOLSETS` | no | no |  |

## Tools (12)

- `resource_scope`
- `harness_describe`
- `harness_schema`
- `harness_list`
- `harness_get`
- `harness_create`
- `harness_update`
- `harness_delete`
- `harness_execute`
- `harness_search`
- `harness_diagnose`
- `harness_status`

## FAQ

### How do I install the Harness MCP server?

Run it with npx using your Harness API key, or install it globally with npm. Stdio is the default transport, and HTTP is available for remote deployments.

### How many tools does the Harness MCP server expose?

It exposes 11 consolidated tools that dispatch to 273 Harness resource types through a registry-based system.

### Does the Harness MCP server support OAuth?

Yes. HTTP transport can run in HarnessID OAuth mode using OAuth 2.1 Authorization Code with PKCE, and the hosted service uses Harness Platform OAuth.

### Can it work across multiple Harness projects?

Yes, agents discover organizations and projects dynamically without hardcoded environment variables.

### Is there a hosted version of the Harness MCP server?

Yes, if your Harness account has the hosted MCP service enabled, clients can connect to the managed endpoint instead of running the server locally.
