Skip to content
Back to search

mcp-server

Harness’ official MCP Server

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/harness/mcp-server with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/harness/mcp-server'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/harness--mcp-server/badge.svg)](/listings/harness--mcp-server)

HTML

<a href="/listings/harness--mcp-server"><img src="/api/listings/harness--mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Option 0: Hosted Harness MCP

If your Harness account has the hosted MCP service enabled, clients that support remote MCP servers can connect directly to the managed endpoint instead of running the server locally.

> **Important:** The hosted MCP service uses **Harness Platform OAuth**, not `HARNESS_API_KEY`. It must also be enabled/configured per account by **Harness Support** before the endpoint can be used.

See [Hosted Harness MCP](#hosted-harness-mcp) for configuration examples.

Option 1: npx (Recommended)

No install required — just run it:

HARNESS_API_KEY=pat.xxx.xxx.xxx npx harness-mcp-v2@latest

Or configure the API key in your AI client (see [Client Configuration](#client-configuration) below).

# Stdio transport (default — for Claude Desktop, Cursor, Devin Desktop, etc.)
HARNESS_API_KEY=pat.xxx npx harness-mcp-v2

# HTTP transport (for remote/shared deployments)
HARNESS_API_KEY=pat.xxx npx harness-mcp-v2 http --port 8080

> **Note:** The account ID is auto-extracted from PAT and SAT tokens (`pat.<accountId>...` or `sat.<accountId>...`), so `HARNESS_ACCOUNT_ID` is only needed for API keys without an embedded account segment.

Option 2: Global Install

npm install -g harness-mcp-v2

# Then run directly
harness-mcp-v2

Option 3: Build from Source

For development or customization:

git clone https://github.com/harness/mcp-server.git
cd mcp-server
pnpm install
pnpm build

# Run
pnpm start              # Stdio transport
pnpm start:http         # HTTP transport
pnpm inspect            # Test with MCP Inspector

Anthropic MCP Directory bundle

The MCPB bundle manifest lives in `[mcp-directory/](mcp-directory/)`, and the 512×512 bundle icon is tracked at `[icon.png](icon.png)` in the repository root. The packaged archive contains root-level `manifest.json`, `icon.png`, `server/`, `package.json`, `npm-shrinkwrap.json`, and production `node_modules/`.

To keep the archive small, build MCPB packages from a staging directory:

pnpm prepare:mcpb

The staging directory is written to `dist/mcpb/` with production dependencies installed from `npm-shrinkwrap.json` using npm's flat layout. The pinned official MCPB CLI validates it and creates `dist/harness-mcp-server-<version>.mcpb`.

Version tags matching `v*.*.*` publish that bundle to the corresponding GitHub Release automatically. To backfill an existing release without republishing npm, run the `Release` workflow manually with its `release_tag` input (for example, `v3.2.20`). The workflow checks out and builds that exact tag before replacing only its versioned MCPB asset.

CLI Usage

harness-mcp-v2 [stdio|http] [--port <number>]

Options:
  --port <number>  Port for HTTP transport (default: 3000, or PORT env var)
  --help           Show help message and exit
  --version        Print version and exit

Transport defaults to `stdio` if not specified. Use `http` for remote/shared deployments.

HTTP Transport

When running in HTTP mode, the server exposes:

| Endpoint | Method | Description | | --------- | --------- | ---------------------------------------------------------------- | | `/mcp` | `POST` | MCP JSON-RPC endpoint (initialize + session requests) | | `/mcp` | `GET` | SSE stream for server-initiated messages (progress, elicitation) | | `/mcp` | `DELETE` | Terminate an active MCP session | | `/mcp` | `OPTIONS` | CORS preflight | | `/health` | `GET` | Health check — returns `{ "status": "ok", "sessions": <count> }` | | `/.well-known/oauth-protected-resource` | `GET` | RFC 9728 metadata when `HARNESS_MCP_MODE=oauth` | | `/.well-known/oauth-protected-resource/mcp` | `GET` | Path-aware RFC 9728 metadata for the default `/mcp` resource |

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 2,478 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. ## Harness MCP Server 2.0
  2. [![MCP Toplist](https://mcptoplist.com/badge/glama%2Fharness%2Fmcp-server.svg)](https://mcptoplist.com/server/glama%2Fharness%2Fmcp-server)
  3. An MCP (Model Context Protocol) server that gives AI agents full access to the Harness.io platform through 11 consolidated tools and 274 resource types.
  4. ## Why Use This MCP Server
  5. Most MCP servers map one tool per API endpoint. For a platform as broad as Harness, that means 240+ tools — and LLMs get worse at tool selection as the count grows. Context windows fill up with schemas, and every new endpoint means new code.
  6. This server is built differently:
  7. - **11 tools, 274 resource types.** A registry-based dispatch system routes `harness_list`, `harness_get`, `harness_create`, etc. to any Harness resource — pipelines, services, environments, orgs, projects, feature flags, cost data, and more. The LLM picks from 11 tools instead of hundreds.
  8. - **Full platform coverage.** 44 default toolsets spanning CI/CD, GitOps, Feature Flags, Cloud Cost Management, Security Testing, Chaos Engineering, Database DevOps, Internal Developer Portal, Software Supply Chain, Infrastructure as Code Management, Release Management, Governance, Service Overrides, Knowledge Graph, and more. Opt-in Ansible and observability-evaluation coverage is available when needed.
  9. - **Multi-project workflows out of the box.** Agents discover organizations and projects dynamically — no hardcoded env vars needed. Ask "show failed executions across all projects" and the agent can navigate the full account hierarchy.
  10. - **35 prompt templates.** Pre-built prompts for common workflows: build & deploy apps end-to-end, debug failed pipelines, review DORA metrics, triage vulnerabilities, optimize cloud costs, audit access control, plan feature flag rollouts, review pull requests, approve pending pipelines, and more.
  11. - **Works everywhere.** Stdio transport for local clients (Claude Desktop, Cursor, Devin Desktop), HTTP transport for remote/shared deployments, Docker and Kubernetes ready.
  12. - **Zero-config start.** Just provide a Harness API key. Account ID is auto-extracted from PAT and SAT tokens, org/project defaults are optional, and toolset filtering lets you expose only what you need.
  13. - **Extensible by design.** Adding a new Harness resource means adding a declarative data file — no new tool registration, no schema changes, no prompt updates.
  14. ## Prerequisites
  15. Before installing or running the server, you need a Harness API key:
  16. 1. Log in to your [Harness account](https://app.harness.io)
  17. 2. Go to **My Profile** → **API Keys** → **+ New API Key**
  18. 3. Create a new **Token** under the API key — this generates a PAT or SAT in the format `<prefix>.<accountId>.<tokenId>.<secret>`
  19. 4. Save the token somewhere secure — you'll need it in the next step
  20. > For detailed instructions, see the [Harness API Quickstart](https://developer.harness.io/docs/platform/automation/api/api-quickstart/).
  21. ## Quick Start
  22. ### Option 0: Hosted Harness MCP
  23. If your Harness account has the hosted MCP service enabled, clients that support remote MCP servers can connect directly to the managed endpoint instead of running the server locally.
  24. > **Important:** The hosted MCP service uses **Harness Platform OAuth**, not `HARNESS_API_KEY`. It must also be enabled/configured per account by **Harness Support** before the endpoint can be used.
  25. See [Hosted Harness MCP](#hosted-harness-mcp) for configuration examples.
  26. ### Option 1: npx (Recommended)
  27. No install required — just run it:
  28. ```bash
  29. HARNESS_API_KEY=pat.xxx.xxx.xxx npx harness-mcp-v2@latest
  30. ```
  31. Or configure the API key in your AI client (see [Client Configuration](#client-configuration) below).
  32. ```bash
  33. # Stdio transport (default — for Claude Desktop, Cursor, Devin Desktop, etc.)
  34. HARNESS_API_KEY=pat.xxx npx harness-mcp-v2
  35. # HTTP transport (for remote/shared deployments)
  36. HARNESS_API_KEY=pat.xxx npx harness-mcp-v2 http --port 8080
  37. ```
  38. > **Note:** The account ID is auto-extracted from PAT and SAT tokens (`pat.<accountId>...` or `sat.<accountId>...`), so `HARNESS_ACCOUNT_ID` is only needed for API keys without an embedded account segment.
  39. ### Option 2: Global Install
  40. ```bash
  41. npm install -g harness-mcp-v2
  42. # Then run directly
  43. harness-mcp-v2
  44. ```
  45. ### Option 3: Build from Source
  46. For development or customization:
  47. ```bash
  48. git clone https://github.com/harness/mcp-server.git
  49. cd mcp-server
  50. pnpm install
  51. pnpm build
  52. # Run
  53. pnpm start # Stdio transport
  54. pnpm start:http # HTTP transport
  55. pnpm inspect # Test with MCP Inspector
  56. ```
  57. ### Anthropic MCP Directory bundle
  58. The MCPB bundle manifest lives in `[mcp-directory/](mcp-directory/)`, and the 512×512 bundle icon is tracked at `[icon.png](icon.png)` in the repository root. The packaged archive contains root-level `manifest.json`, `icon.png`, `server/`, `package.json`, `npm-shrinkwrap.json`, and production `node_modules/`.
  59. To keep the archive small, build MCPB packages from a staging directory:
  60. ```bash
  61. pnpm prepare:mcpb
  62. ```
  63. The staging directory is written to `dist/mcpb/` with production dependencies installed from `npm-shrinkwrap.json` using npm's flat layout. The pinned official MCPB CLI validates it and creates `dist/harness-mcp-server-<version>.mcpb`.
  64. Version tags matching `v*.*.*` publish that bundle to the corresponding GitHub Release automatically. To backfill an existing release without republishing npm, run the `Release` workflow manually with its `release_tag` input (for example, `v3.2.20`). The workflow checks out and builds that exact tag before replacing only its versioned MCPB asset.
  65. ### CLI Usage
  66. ```bash
  67. harness-mcp-v2 [stdio|http] [--port <number>]
  68. Options:
  69. --port <number> Port for HTTP transport (default: 3000, or PORT env var)
  70. --help Show help message and exit
  71. --version Print version and exit
  72. ```
  73. Transport defaults to `stdio` if not specified. Use `http` for remote/shared deployments.
  74. ### HTTP Transport
  75. When running in HTTP mode, the server exposes:
  76. | Endpoint | Method | Description |
  77. | --------- | --------- | ---------------------------------------------------------------- |
  78. | `/mcp` | `POST` | MCP JSON-RPC endpoint (initialize + session requests) |
  79. | `/mcp` | `GET` | SSE stream for server-initiated messages (progress, elicitation) |
  80. | `/mcp` | `DELETE` | Terminate an active MCP session |
  81. | `/mcp` | `OPTIONS` | CORS preflight |
  82. | `/health` | `GET` | Health check — returns `{ "status": "ok", "sessions": <count> }` |
  83. | `/.well-known/oauth-protected-resource` | `GET` | RFC 9728 metadata in `oauth` and `oauth-proxy` modes |
  84. | `/.well-known/oauth-protected-resource/mcp` | `GET` | Path-aware RFC 9728 metadata for the default `/mcp` resource |
  85. | `/.well-known/oauth-authorization-server` | `GET` | Embedded broker RFC 8414 metadata in `oauth-proxy` mode |
  86. | `/oauth/authorize` | `GET` | Start MCP client login through the upstream provider and HarnessID |
  87. | `/oauth/upstream/callback` | `GET` | Upstream identity-provider callback |
  88. | `/oauth/harnessid/callback` | `GET` | HarnessID login callback |
  89. | `/oauth/token` | `POST` | Return or refresh upstream tokens for the MCP client; never returns HarnessID tokens |
  90. The HTTP transport runs in **session-based mode**. A new MCP session is created on `initialize`, the server returns an `mcp-session-id` header, and subsequent requests for that session must include the same header.
  91. Operational constraints in HTTP mode:
  92. - Set `HARNESS_MCP_AUTH_TOKEN` for shared or remotely reachable single-user and multi-user deployments. When set, every `POST`, `GET`, and `DELETE` request to `/mcp` must include `Authorization: Bearer <token>`.
  93. - OAuth mode accepts HarnessID access tokens instead of `HARNESS_MCP_AUTH_TOKEN` and can bind to a non-loopback address without the unauthenticated opt-out.
  94. - OAuth proxy mode accepts an upstream identity-provider token, exchanges it internally for a per-user HarnessID token, and requires the upstream token on every request.
  95. - Non-loopback single-user and multi-user binds require `HARNESS_MCP_AUTH_TOKEN` by default. To run unauthenticated on a non-loopback interface anyway, set `HARNESS_MCP_ALLOW_UNAUTHENTICATED_HTTP=true` explicitly.
  96. - `POST /mcp` without `mcp-session-id` must be an `initialize` request.
  97. - `POST /mcp`, `GET /mcp`, and `DELETE /mcp` for existing sessions require the `mcp-session-id` header.
  98. - `GET /mcp` is used for SSE notifications (progress updates and elicitation prompts).
  99. - Idle sessions are reaped after `MCP_SESSION_TTL_MS` milliseconds once no request or SSE stream is active (default `1800000`, or 30 minutes).
  100. - `GET /health` is the only non-MCP endpoint.
  101. - Request body size is capped by `HARNESS_MAX_BODY_SIZE_MB` (default `10` MB).
  102. - Set `x-harness-pipeline-version: 0` or `1` on the `initialize` request to select V0 or V1 pipeline resources for that HTTP session.
  103. - Set `x-harness-auto-approve-risk: none|low_write|medium_write|high_write|all` on the `initialize` request to choose a stricter per-session auto-approval threshold. The server caps this value at the deployment-level `HARNESS_AUTO_APPROVE_RISK`, so a session can reduce but not expand the configured approval ceiling.
  104. #### HarnessID OAuth Mode
  105. Set `HARNESS_MCP_MODE=oauth` to let remote MCP clients discover HarnessID and complete OAuth 2.1 Authorization Code with PKCE. OAuth mode is available only with HTTP transport. Production HarnessID, MCP resource, and API routing defaults are built in:
  106. ```bash
  107. HARNESS_MCP_MODE=oauth
  108. ```
  109. This defaults to the issuer `https://id.harness.io/idp/realms/HarnessIDP`, resource `https://mcp.harness.io/mcp`, OAuth client `mcp-client`, and Harness API base `https://mcp.harness.io/cli`. Override them only for QA, local development, or another Harness environment.
  110. `HARNESS_API_KEY` must not be set in this mode. `HARNESS_MCP_OAUTH_JWKS_URI` defaults to `<issuer>/protocol/openid-connect/certs`, and `HARNESS_ACCOUNT_ID` is unnecessary because the account comes from the token. If the opt-in `appsec` toolset (`HARNESS_TOOLSETS=+appsec`) is enabled, sessions must also pass `x-harness-appsec-api-key` on the `initialize` request (HarnessID OAuth tokens are never forwarded to `api.traceable.ai`).
  111. The server publishes RFC 9728 protected-resource metadata and returns this challenge when a client has not authenticated:
  112. ```http
  113. HTTP/1.1 401 Unauthorized
  114. WWW-Authenticate: Bearer resource_metadata="https://mcp.harness.io/.well-known/oauth-protected-resource/mcp"
  115. ```
  116. It validates the HarnessID access token's RS256 signature, `iss`, expiry, and `sub` using the configured JWKS endpoint, and checks that the token was issued to `HARNESS_MCP_OAUTH_CLIENT_ID` through the `azp` claim. `HARNESS_MCP_OAUTH_RESOURCE` is the RFC 9728 protected-resource identifier used for discovery and challenges. Current HarnessID access tokens use `aud: account` rather than the MCP URL, so the resource is not compared with `aud`.
  117. The account ID comes from the token's `HARNESS_MCP_OAUTH_ACCOUNT_CLAIM` claim (`account_id` by default), which the HarnessID `organization` scope populates. Each session stores the caller's access token and forwards it to the Harness API as `Authorization: Bearer`, so Harness RBAC and audit records reflect the logged-in user rather than a shared PAT. The session is bound to the `sub` and account it was created with: a later request may carry a refreshed token, but one for a different user or account is rejected.
  118. Clients normally need only the MCP resource URL:
  119. ```json
  120. {
  121. "mcpServers": {
  122. "harness": {
  123. "url": "https://mcp.harness.io/mcp"
  124. }
  125. }
  126. }
  127. ```
  128. The client reads the protected-resource metadata, discovers `HARNESS_MCP_OAUTH_ISSUER`, and then uses that authorization server's RFC 8414 metadata. If the client does not support dynamic client registration, use the pre-registered `mcp-client` client ID.
  129. See [HarnessID OAuth for a self-hosted MCP server](docs/harnessid-oauth.md) for the QA Keycloak checklist and validation commands.
  130. #### Upstream Identity Provider OAuth Proxy Mode
  131. OAuth proxy mode needs a confidential HarnessID client. The Harness ID team creates that client and provides the client ID and client secret. Reach out to the Harness ID team before enabling this mode.
  132. Set `HARNESS_MCP_MODE=oauth-proxy` when an MCP client must hold only an upstream identity-provider token. The public client name can be anything. Set `HARNESS_MCP_BROKER_CLIENT_ID` to the same name the MCP client uses. The integrated OAuth broker starts the upstream browser login, completes the HarnessID login in the same flow, and returns only the upstream access and refresh tokens to the MCP client. On every `/mcp` request, the server validates the upstream token and uses a cached per-user HarnessID access token, renewing it with the refresh token before expiry. A missing upstream-to-HarnessID mapping returns 401 so the client signs in again. HarnessID tokens stay on the server. Refresh tokens, cached access tokens, and transient OAuth state are encrypted at rest.
  133. This mode is HTTP-only. It also needs the upstream issuer and audience, and a stable 32-byte vault key. See
  134. [Upstream identity provider OAuth proxy mode](docs/oauth-proxy.md) for configuration and
  135. end-to-end MCP test commands.
  136. #### Multi-User Mode
  137. Set `HARNESS_MCP_MODE=multi-user` for shared HTTP deployments where each client authenticates as a different Harness user. In this mode:
  138. - `HARNESS_API_KEY` must **not** be set in the server config — the server holds no Harness credentials.
  139. - Each session must provide `x-harness-api-key` on the `initialize` request. `x-harness-account-id` is required only when the API key does not embed an account segment.
  140. - Sessions may also provide `x-harness-org` and `x-harness-project` headers to set default scope for that session.
  141. - If the opt-in `appsec` toolset (`HARNESS_TOOLSETS=+appsec`) is enabled, sessions that call `appsec_*` resources must also provide `x-harness-appsec-api-key` on the `initialize` request (the session's `x-harness-api-key` is never forwarded to `api.traceable.ai`).
  142. - The Harness API key flows through to every Harness API call for that session, so the audit trail in Harness reflects the real user.
  143. - `HARNESS_MCP_AUTH_TOKEN` is independent and can still be used as an additional transport-layer gate.
  144. ```bash
  145. # Health check
  146. curl http://localhost:3000/health
  147. # MCP initialize request (capture mcp-session-id response header)
  148. # In multi-user mode, x-harness-api-key is required on initialize.
  149. # x-harness-account-id is needed only for API keys without an embedded account segment.
  150. curl -i -X POST http://localhost:3000/mcp \
  151. -H "Content-Type: application/json" \
  152. -H "Accept: application/json, text/event-stream" \
  153. -H "Authorization: Bearer $HARNESS_MCP_AUTH_TOKEN" \
  154. -H "x-harness-api-key: $HARNESS_API_KEY" \
  155. -H "x-harness-account-id: $HARNESS_ACCOUNT_ID" \
  156. -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'
  157. # Subsequent MCP request (use returned session ID)
  158. curl -X POST http://localhost:3000/mcp \
  159. -H "Content-Type: application/json" \
  160. -H "Accept: application/json, text/event-stream" \
  161. -H "Authorization: Bearer $HARNESS_MCP_AUTH_TOKEN" \
  162. -H "mcp-session-id: <session-id>" \
  163. -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
  164. # Terminate session
  165. curl -X DELETE http://localhost:3000/mcp \
  166. -H "Authorization: Bearer $HARNESS_MCP_AUTH_TOKEN" \
  167. -H "mcp-session-id: <session-id>"
  168. ```
  169. `HARNESS_MCP_ALLOWED_HOSTS` controls Host-header validation for DNS-rebinding protection, and CORS limits browser origins. Neither is authentication; use `HARNESS_MCP_AUTH_TOKEN` or an authenticated gateway/reverse proxy for access control.
  170. ### Client Configuration
  171. > **Note:** `HARNESS_ORG` and `HARNESS_PROJECT` are optional. They set the org ID and project ID used when not specified per tool call. Agents can discover orgs and projects dynamically using `harness_list(resource_type="organization")` and `harness_list(resource_type="project")`. The deprecated names `HARNESS_DEFAULT_ORG_ID` and `HARNESS_DEFAULT_PROJECT_ID` are still accepted for backward compatibility.
  172. #### Hosted Harness MCP
  173. Harness also supports a hosted MCP endpoint for accounts that have the managed service enabled. This is useful when you want a shared remote MCP endpoint instead of running `npx harness-mcp-v2` or self-hosting the HTTP transport yourself.
  174. > **Important:** Hosted MCP authentication uses **Harness Platform OAuth**. It does **not** use `HARNESS_API_KEY` in the client config. Hosted MCP availability is configured per Harness account, so you will need to work with **Harness Support** to enable/configure the setting before using it.
  175. >
  176. > The hosted endpoint `https://mcp.harness.io/mcp` is a managed service. Client-side MCP config in Claude, Cursor, or Cowork cannot override which Harness environment it routes to. For Harness0 or another private Harness SaaS environment, ask Harness Support to enable/configure hosted MCP for that environment, or run the local/self-hosted server and set `HARNESS_BASE_URL` to the target Harness host.
  177. **Hosted MCP example:**
  178. ```json
  179. {
  180. "mcpServers": {
  181. "harness-prod1-mcp": {
  182. "url": "https://mcp.harness.io/mcp",
  183. "auth": {
  184. "CLIENT_ID": "mcp-client"
  185. }
  186. }
  187. }
  188. }
  189. ```
  190. **Example with both hosted and local entries:**
  191. ```json
  192. {
  193. "mcpServers": {
  194. "harness-hosted": {
  195. "url": "https://mcp.harness.io/mcp",
  196. "auth": {
  197. "CLIENT_ID": "mcp-client"
  198. }
  199. },
  200. "harness-local": {
  201. "command": "/absolute/path/to/npx",
  202. "args": ["-y", "harness-mcp-v2@latest"],
  203. "env": {
  204. "HARNESS_API_KEY": "pat.xxx.xxx.xxx",
  205. "PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
  206. }
  207. }
  208. }
  209. }
  210. ```
  211. > **Troubleshooting `npx ENOENT` or `node: No such file or directory`**
  212. >
  213. > This is a client process-launch failure, not a Harness authentication failure. The MCP server has not started yet, so changing `HARNESS_API_KEY` will not affect `spawn npx ENOENT`.
  214. >
  215. > GUI apps (Cursor, Claude Desktop, Devin Desktop, VS Code) don't always inherit your shell's `PATH`, so they can fail to find `npx` or `node` after a config reload. Fix this by using absolute paths and explicitly setting `PATH` in the `env` block:
  216. >
  217. > ```json
  218. > {
  219. > "mcpServers": {
  220. > "harness": {
  221. > "command": "/absolute/path/to/npx",
  222. > "args": ["-y", "harness-mcp-v2"],
  223. > "env": {
  224. > "HARNESS_API_KEY": "pat.xxx.xxx.xxx",
  225. > "PATH": "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
  226. > }
  227. > }
  228. > }
  229. > }
  230. > ```
  231. >
  232. > Find your paths with `which npx` and `which node` in a terminal, then make sure the directory containing `node` is included in the `PATH` value above. Common locations:
  233. >
  234. > - **Homebrew (macOS):** `/opt/homebrew/bin/npx`
  235. > - **nvm:** `~/.nvm/versions/node/v20.x.x/bin/npx` (run `nvm which current` to find the exact path)
  236. > - **System Node:** `/usr/local/bin/npx`
  237. #### Claude Desktop (`claude_desktop_config.json`)
  238. npx (zero install)
  239. ```json
  240. {
  241. "mcpServers": {
  242. "harness": {
  243. "command": "/absolute/path/to/npx",
  244. "args": ["-y", "harness-mcp-v2@latest"],
  245. "env": {
  246. "HARNESS_API_KEY": "pat.xxx.xxx.xxx",
  247. "PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
  248. }
  249. }
  250. }
  251. }
  252. ```
  253. node (local install)
  254. ```bash
  255. npm install -g harness-mcp-v2
  256. ```
  257. ```json
  258. {
  259. "mcpServers": {
  260. "harness": {
  261. "command": "/absolute/path/to/harness-mcp-v2",
  262. "env": {
  263. "HARNESS_API_KEY": "pat.xxx.xxx.xxx",
  264. "PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
  265. }
  266. }
  267. }
  268. }
  269. ```
  270. #### Claude Code (via `claude mcp add`)
  271. npx (zero install)
  272. ```bash
  273. claude mcp add harness -- npx harness-mcp-v2
  274. ```
  275. node (local install)
  276. ```bash
  277. npm install -g harness-mcp-v2
  278. claude mcp add harness -- harness-mcp-v2
  279. ```
  280. Then set `HARNESS_API_KEY` in your environment or `.env` file.
  281. #### Cursor (`.cursor/mcp.json`)
  282. npx (zero install, recommended for local Cursor configs)
  283. ```json
  284. {
  285. "mcpServers": {
  286. "harness": {
  287. "command": "/absolute/path/to/npx",
  288. "args": ["-y", "harness-mcp-v2@latest"],
  289. "env": {
  290. "HARNESS_API_KEY": "pat.xxx.xxx.xxx",
  291. "PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
  292. }
  293. }
  294. }
  295. }
  296. ```
  297. Run `which npx` in a terminal and use that full path for `command`; include the directory from `which node` at the front of `PATH`.
  298. node (local install)
  299. ```bash
  300. npm install -g harness-mcp-v2
  301. ```
  302. ```json
  303. {
  304. "mcpServers": {
  305. "harness": {
  306. "command": "/absolute/path/to/harness-mcp-v2",
  307. "env": {
  308. "HARNESS_API_KEY": "pat.xxx.xxx.xxx",
  309. "PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
  310. }
  311. }
  312. }
  313. }
  314. ```
  315. Run `which harness-mcp-v2` after `npm install -g harness-mcp-v2` and use that full path for `command`; include the directory from `which node` at the front of `PATH`.
  316. #### Devin Desktop (`~/.windsurf/mcp.json`)
  317. npx (zero install)
  318. ```json
  319. {
  320. "mcpServers": {
  321. "harness": {
  322. "command": "/absolute/path/to/npx",
  323. "args": ["-y", "harness-mcp-v2@latest"],
  324. "env": {
  325. "HARNESS_API_KEY": "pat.xxx.xxx.xxx",
  326. "PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
  327. }
  328. }
  329. }
  330. }
  331. ```
  332. node (local install)
  333. ```bash
  334. npm install -g harness-mcp-v2
  335. ```
  336. ```json
  337. {
  338. "mcpServers": {
  339. "harness": {
  340. "command": "/absolute/path/to/harness-mcp-v2",
  341. "env": {
  342. "HARNESS_API_KEY": "pat.xxx.xxx.xxx",
  343. "PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
  344. }
  345. }
  346. }
  347. }
  348. ```
  349. Using a local build from source?
  350. Replace the command with the path to your built `index.js`:
  351. ```json
  352. {
  353. "command": "node",
  354. "args": ["/absolute/path/to/harness-mcp-v2/build/index.js", "stdio"]
  355. }
  356. ```
  357. ### MCP Gateway
  358. The Harness MCP server is fully compatible with MCP Gateways — reverse proxies that provide centralized authentication, governance, tool routing, and observability across multiple MCP servers. Since the server implements the standard MCP protocol with both stdio and HTTP transports, it works behind any MCP-compliant gateway with no code changes.
  359. **Why use a gateway?**
  360. - Centralized credential management — no API keys in agent configs
  361. - Governance & audit logging for all tool calls across teams
  362. - Single endpoint for agents instead of N connections to N MCP servers
  363. - Access control — restrict which teams can use which tools
  364. #### Docker MCP Gateway
  365. Register the server in your Docker MCP Gateway configuration:
  366. ```json
  367. {
  368. "mcpServers": {
  369. "harness": {
  370. "command": "npx",
  371. "args": ["harness-mcp-v2"],
  372. "env": {
  373. "HARNESS_API_KEY": "pat.xxx.xxx.xxx"
  374. }
  375. }
  376. }
  377. }
  378. ```
  379. #### Portkey
  380. Add the Harness MCP server to your [Portkey MCP Gateway](https://portkey.ai/features/mcp) for enterprise governance, cost tracking, and multi-LLM routing:
  381. ```json
  382. {
  383. "mcpServers": {
  384. "harness": {
  385. "command": "npx",
  386. "args": ["harness-mcp-v2"],
  387. "env": {
  388. "HARNESS_API_KEY": "pat.xxx.xxx.xxx"
  389. }
  390. }
  391. }
  392. }
  393. ```
  394. #### LiteLLM
  395. Add to your [LiteLLM proxy config](https://docs.litellm.ai/docs/mcp):
  396. ```yaml
  397. mcp_servers:
  398. - name: harness
  399. command: npx
  400. args:
  401. - harness-mcp-v2
  402. env:
  403. HARNESS_API_KEY: "pat.xxx.xxx.xxx"
  404. ```
  405. #### Envoy AI Gateway
  406. The server works with [Envoy AI Gateway's MCP support](https://aigateway.envoyproxy.io/docs/0.5/capabilities/mcp/) via HTTP transport:
  407. ```bash
  408. # Start the server in HTTP mode
  409. HARNESS_API_KEY=pat.xxx.xxx.xxx npx harness-mcp-v2 http --port 8080
  410. ```
  411. Then configure Envoy to route to `http://localhost:8080/mcp` as an upstream MCP backend.
  412. #### Kong
  413. Use [Kong's AI MCP Proxy plugin](https://developer.konghq.com/mcp/) to expose the Harness MCP server through your existing Kong gateway infrastructure.
  414. #### Other Gateways
  415. Any gateway that supports the MCP specification (Microsoft MCP Gateway, IBM ContextForge, Cloudflare Workers, etc.) can proxy this server. For **stdio-based** gateways, use the default transport. For **HTTP-based** gateways, start the server with `http` transport and point the gateway at the `/mcp` endpoint.
  416. ### Docker
  417. Build and run the server as a Docker container:
  418. ```bash
  419. # Build the image
  420. pnpm docker:build
  421. # Run with your .env file
  422. pnpm docker:run
  423. # Or run directly with env vars
  424. docker run --rm -p 3000:3000 \
  425. -e HARNESS_API_KEY=pat.xxx.xxx.xxx \
  426. -e HARNESS_ACCOUNT_ID=your-account-id \
  427. harness-mcp-server
  428. ```
  429. The container runs in HTTP mode on port 3000 by default with a built-in health check.
  430. ### Kubernetes
  431. Deploy to a Kubernetes cluster using the provided manifests:
  432. ```bash
  433. # 1. Edit the Secret with your real credentials
  434. # k8s/secret.yaml — replace HARNESS_API_KEY and HARNESS_ACCOUNT_ID
  435. # 2. Apply all manifests
  436. kubectl apply -f k8s/
  437. # 3. Verify the deployment
  438. kubectl -n harness-mcp get pods
  439. # 4. Port-forward for local testing
  440. kubectl -n harness-mcp port-forward svc/harness-mcp-server 3000:80
  441. curl http://localhost:3000/health
  442. ```
  443. The deployment runs 2 replicas with readiness/liveness probes, resource limits, and non-root security context. The Service exposes port 80 internally (targeting container port 3000).
  444. ## Configuration
  445. The server automatically loads environment variables from a `.env` file in the project root if one exists. Copy `.env.example` to `.env` and fill in your values. Environment variables can also be set via your shell or MCP client config.
  446. | Variable | Required | Default | Description |
  447. | --------------------------- | -------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  448. | `HARNESS_MCP_MODE` | No | `single-user` | Deployment mode: `single-user`, `multi-user`, `oauth` (direct HarnessID token), or `oauth-proxy` (upstream identity-provider token exchanged for a per-user HarnessID token) |
  449. | `HARNESS_API_KEY` | Yes* | -- | Harness personal access token or service account token. Required in `single-user` mode. Must NOT be set in `multi-user`, `oauth`, or `oauth-proxy` mode, where each session brings its own credential |
  450. | `HARNESS_ACCOUNT_ID` | No | *(from PAT/SAT)* | Harness account identifier. Auto-extracted from PAT/SAT tokens in single-user mode; multi-user sessions can provide their own via `x-harness-account-id` when the API key does not embed one |
  451. | `HARNESS_BASE_URL` | No | `https://app.harness.io` (`https://mcp.harness.io/cli` in `oauth` and `oauth-proxy`) | Harness API/UI base URL. `oauth` and `oauth-proxy` route through the hosted MCP `/cli` proxy by default; other modes use the Harness SaaS API directly |
  452. | `HARNESS_MCP_OAUTH_ISSUER` | No | `https://id.harness.io/idp/realms/HarnessIDP` | HarnessID issuer matched exactly against the access token `iss` claim |
  453. | `HARNESS_MCP_OAUTH_RESOURCE` | No | `https://mcp.harness.io/mcp` | Public canonical MCP URL published as the RFC 9728 resource identifier |
  454. | `HARNESS_MCP_OAUTH_JWKS_URI` | No | `<issuer>/protocol/openid-connect/certs` | HarnessID JWKS endpoint used to validate RS256 access-token signatures |
  455. | `HARNESS_MCP_OAUTH_CLIENT_ID` | No | `mcp-client` | HarnessID client the access token must be issued to, checked against the token's `azp` claim |
  456. | `HARNESS_MCP_OAUTH_ACCOUNT_CLAIM` | No | `account_id` | Access-token claim carrying the Harness account ID, populated by the HarnessID `organization` scope |
  457. | `HARNESS_MCP_OAUTH_SCOPES` | No | `openid profile email organization` | Space-separated scopes advertised in RFC 9728 protected-resource metadata |
  458. | `HARNESS_MCP_OAUTH_CLIENT_SECRET` | Yes* | -- | Confidential HarnessID client secret issued by the Harness ID team; required only in `oauth-proxy` mode |
  459. | `HARNESS_MCP_OAUTH_EXTERNAL_SUB_CLAIM` | No | `external_sub` | HarnessID token claim matched to the upstream subject or upstream email during linking |
  460. | `HARNESS_MCP_OAUTH_PROXY_GRANT` | No | `refresh` | Later-request grant in `oauth-proxy` mode: `refresh` or `jwt-bearer` |
  461. | `HARNESS_MCP_OAUTH_PROXY_PUBLIC_URL` | Yes* | -- | Public origin of the OAuth broker. Required in `oauth-proxy` mode and must share an origin with `HARNESS_MCP_OAUTH_RESOURCE` |
  462. | `HARNESS_MCP_OAUTH_PROXY_VAULT_MODE` | No | `file` | `file` stores the encrypted vault on local disk for one pod. `redis` shares refresh tokens and login state across pods |
  463. | `HARNESS_MCP_OAUTH_PROXY_VAULT_PATH` | No | `.harness-mcp/oauth-proxy-vault.enc` | Encrypted HarnessID token and login-state file used when vault mode is `file` |
  464. | `HARNESS_MCP_OAUTH_PROXY_VAULT_KEY` | Yes* | -- | Base64-encoded 32-byte AES key required in `oauth-proxy` mode |
  465. | `HARNESS_MCP_OAUTH_PROXY_REDIS_URL` | Yes* | -- | `rediss://` URL required when vault mode is `redis`. `redis://` requires `HARNESS_ALLOW_HTTP=true`. Redis 6.2 or newer |
  466. | `HARNESS_MCP_OAUTH_PROXY_REDIS_KEY_PREFIX` | No | `harness-mcp:oauth` | Prefix for OAuth vault keys in Redis |
  467. | `HARNESS_MCP_UPSTREAM_ISSUER` | Yes* | -- | Exact upstream token issuer required in `oauth-proxy` mode |
  468. | `HARNESS_MCP_UPSTREAM_AUDIENCE` | Yes* | -- | Exact upstream token audience required in `oauth-proxy` mode |
  469. | `HARNESS_MCP_UPSTREAM_JWKS_URI` | No | `<upstream issuer>/v1/keys` | Upstream RS256 JWKS endpoint |
  470. | `HARNESS_MCP_UPSTREAM_SCOPES` | No | `openid profile email offline_access` | Scopes requested by the embedded broker and published to the MCP client |
  471. | `HARNESS_MCP_UPSTREAM_OAUTH_CLIENT_ID` | Yes* | -- | Confidential upstream OAuth client used by the embedded broker |
  472. | `HARNESS_MCP_UPSTREAM_OAUTH_CLIENT_SECRET` | Yes* | -- | Upstream OAuth client secret used only by the server |
  473. | `HARNESS_MCP_UPSTREAM_DISCOVERY_URI` | No | `<upstream issuer>/.well-known/openid-configuration` | Upstream OIDC discovery endpoint |
  474. | `HARNESS_MCP_UPSTREAM_EMAIL_DOMAINS` | No | -- | Comma-separated domains. Email linking requires `email_verified=true` and a domain on this list. An empty list does not link by email |
  475. | `HARNESS_MCP_BROKER_ISSUER` | No | OAuth proxy public URL | Authorization-server issuer the MCP client discovers |
  476. | `HARNESS_MCP_BROKER_CLIENT_ID` | No | `cursor-harness-mcp` | Public OAuth client ID. Any name works when the MCP client is configured with the same value |
  477. | `HARNESS_MCP_BROKER_REDIRECT_URIS` | No | *(empty)* | Comma-separated redirect URIs. Empty rejects every callback. `*` allows only loopback `http`/`https`. Custom schemes must be listed exactly |
  478. | `HARNESS_MCP_BROKER_CODE_TTL_MS` | No | `60000` | Lifetime of one-time authorization codes issued to the MCP client |
  479. | `HARNESS_MCP_BROKER_TRANSACTION_TTL_MS` | No | `600000` | Maximum lifetime of the chained browser authorization transaction |
  480. | `HARNESS_FME_API_KEY` | No | -- | Optional single-user/self-hosted FME/Split Admin credential used for `fme_` resources in **legacy (`workspace_id`) mode only**. Legacy FME is unavailable in OAuth mode so HarnessID tokens are never sent to `api.split.io`; use Harness-native `org_id`+`project_id` scope instead. Must not be set in `multi-user`, `oauth`, or `oauth-proxy` mode |
  481. | `HARNESS_FME_BASE_URL` | No | `https://api.split.io` | Split/FME Admin API base URL used by `fme_` resources in **legacy (`workspace_id`) mode only**. HTTP URLs require `HARNESS_ALLOW_HTTP=true` for local development. Harness-native (`org_id`+`project_id`) mode ignores this and uses the standard `HARNESS_API_KEY`/`HARNESS_BASE_URL` instead |
  482. | `HARNESS_APPSEC_API_KEY` | No | -- | Optional single-user Traceable Platform API token used by `appsec_` resources (`HARNESS_TOOLSETS=+appsec`). `HARNESS_API_KEY`, session `x-harness-api-key`, and HarnessID OAuth tokens are never forwarded to Traceable. Must not be set in `multi-user`, `oauth`, or `oauth-proxy` mode (hosted sessions supply `x-harness-appsec-api-key` per session) |
  483. | `HARNESS_APPSEC_BASE_URL` | No | `https://api.traceable.ai` | Traceable GraphQL API base URL used by `appsec_` resources. HTTP URLs require `HARNESS_ALLOW_HTTP=true` for local development |
  484. | `HARNESS_APPSEC_UI_URL` | No | `https://app.traceable.ai` | Traceable web UI base URL used for deep links on `appsec_` resources (auto-derived from `HARNESS_APPSEC_BASE_URL` when unset) |
  485. | `HARNESS_ORG` | No | -- | Organization ID. Used when `org_id` is not specified per tool call. If omitted, `org_id` must be provided explicitly. Agents can also discover orgs dynamically via `harness_list(resource_type="organization")` |
  486. | `HARNESS_PROJECT` | No | -- | Project ID. Used when `project_id` is not specified per tool call. Agents can also discover projects dynamically via `harness_list(resource_type="project")` |
  487. | `HARNESS_API_TIMEOUT_MS` | No | `30000` | HTTP request timeout in milliseconds |
  488. | `HARNESS_MAX_RETRIES` | No | `3` | Retry count for transient failures (429, 5xx) |
  489. | `HARNESS_MAX_BODY_SIZE_MB` | No | `10` | Max HTTP request body size in MB for `http` transport |
  490. | `HARNESS_RATE_LIMIT_RPS` | No | `10` | Client-side request throttle (requests per second) to Harness APIs |
  491. | `LOG_LEVEL` | No | `info` | Log verbosity: `debug`, `info`, `warn`, `error` |
  492. | `HARNESS_TOOLSETS` | No | *(defaults)* | Comma-separated toolset list. Empty loads default toolsets. Supports `+name` to explicitly include opt-in toolsets and `-name` to remove defaults (see [Toolset Filtering](#toolset-filtering)) |
  493. | `HARNESS_READ_ONLY` | No | `false` | Block all mutating operations (create, update, delete, execute). Only list and get are allowed. Useful for shared/demo environments |
  494. | `HARNESS_SCHEMA_MODE` | No | `compact` | `compact` (default) or `full`. Compact replaces the per-tool resource-type enum with a plain string and shortens field copy, cutting the tool list sent to the model by about half (see `docs/schema-budget.md`). Types are discovered via `harness_describe`. Set `full` to inline every resource type. |
  495. | `HARNESS_MCP_APPS` | No | `off` | [MCP Apps](https://modelcontextprotocol.io/extensions/apps/overview) views. `off` (default) keeps text-only results. `auto` serves the `ui://harness/app` resource and adds view data to `harness_get`, `harness_execute`, and `harness_status` results only for hosts that declare the `io.modelcontextprotocol/ui` extension; other clients still get unchanged text results |
  496. | `HARNESS_AUTO_APPROVE_RISK` | No | `none` | Risk-based auto-approve threshold for autonomous workflows. Operations at or below this risk proceed without confirmation. Values: `none`, `low_write`, `medium_write`, `high_write`, `all`. See [Elicitation](#elicitation) |
  497. | `HARNESS_SKIP_ELICITATION` | No | `false` | **Deprecated** — use `HARNESS_AUTO_APPROVE_RISK=all` instead. Kept for backward compatibility |
  498. | `HARNESS_ALLOW_HTTP` | No | `false` | Allow non-HTTPS `HARNESS_BASE_URL`. By default, the server enforces HTTPS for security. Set to `true` only for local development against a non-TLS Harness instance |
  499. | `HARNESS_PIPELINE_VERSION` | No | `0` | **(Alpha)** Pipeline YAML version. `0` loads the `pipeline` resource type and excludes `pipeline_v1`; `1` loads `pipeline_v1` and excludes `pipeline`. HTTP sessions can override this at initialize time with `x-harness-pipeline-version: 0` or `1` |
  500. | `HARNESS_MCP_ALLOWED_HOSTS` | No | -- | Comma-separated hostnames allowed by HTTP transport Host-header validation. `mcp.harness.io` is allowed by default for localhost binds; add proxy/custom domains here |
  501. | `HARNESS_MCP_AUTH_TOKEN` | No | -- | Static Bearer token required on `/mcp` HTTP routes when set. Required by default for non-loopback single-user and multi-user binds. Must be unset in `oauth` mode |
  502. | `HARNESS_MCP_ALLOW_UNAUTHENTICATED_HTTP` | No | `false` | Explicitly allow unauthenticated HTTP transport on non-loopback binds. Use only behind another authenticated control |
  503. | `HARNESS_MCP_TRUST_PROXY` | No | `0` | Number of reverse proxy / load balancer hops to trust for client IP resolution (Express `trust proxy`). Set to the proxy count in front of the server so per-IP rate limiting keys on the real client rather than the proxy socket peer |
  504. | `HARNESS_MCP_LOG_FILE` | No | `~/.claude/harness-mcp.log` | File used for stdio disconnect/crash diagnostics when stderr may no longer be available |
  505. | `HARNESS_LOG_UNSAFE_BODIES` | No | `false` | Include raw request/response bodies in logs. Off by default since bodies can contain secrets; enable only for local debugging |
  506. | `HARNESS_AUDIT_FILE` | No | -- | Append audit events to a newline-delimited JSON file for durable local collection |
  507. | `HARNESS_AUDIT_WEBHOOK_URL` | No | -- | HTTPS endpoint that receives batched audit events. HTTP URLs require `HARNESS_ALLOW_HTTP=true` for local development |
  508. | `HARNESS_AUDIT_WEBHOOK_TOKEN` | No | -- | Optional bearer token sent to the audit webhook |
  509. | `HARNESS_AUDIT_WEBHOOK_BATCH_SIZE` | No | `10` | Number of audit events to batch before webhook flush |
  510. | `HARNESS_AUDIT_WEBHOOK_FLUSH_MS` | No | `5000` | Max time to hold audit events before webhook flush |
  511. | `OTEL_EXPORTER_OTLP_ENDPOINT` | No | -- | Enables OpenTelemetry audit spans when the optional OpenTelemetry packages are installed |
  512. | `HARNESS_SEARCH_PROVIDER` | No | `local` | Semantic search backend: `local` (in-process ONNX embeddings, default), `remote` (external search service via HTTP, required for multi-user mode), or `none` (disable semantic search, fall back to keyword scatter-gather only). Use `none` in air-gapped environments or when startup model loading is undesirable |
  513. | `HARNESS_SEARCH_SERVICE_URL` | No | -- | Base URL of the remote search service when `HARNESS_SEARCH_PROVIDER=remote` (e.g. `http://search-svc:8080`). Required when using the `remote` provider |
  514. | `HARNESS_SEARCH_SERVICE_HEADERS` | No | -- | JSON object of headers sent with every request to the remote search service. Supports any auth scheme: `{"Authorization":"Bearer tok"}`, `{"x-api-key":"key"}`, or multiple internal service-to-service headers |
  515. | `HARNESS_HF_CACHE_DIR` | No | `/tmp/hf-cache` | Directory for the `@huggingface/transformers` model cache used by the `local` search provider. The Docker image pre-bakes the model into `/app/.cache/hf` to avoid runtime downloads. Set to a persistent volume path in production deployments |
  516. | `HARNESS_DIAGNOSE_LOG_FETCH_CONCURRENCY` | No | `3` | Max concurrent log-blob downloads issued by `harness_diagnose` when fetching logs for failed steps. Increase only if diagnose latency is dominated by log-fetch wall-clock and the pod has memory headroom |
  517. ### Semantic Search
  518. `harness_search` uses semantic routing to narrow scatter-gather API calls before fanning out to Harness. Three search providers are available:
  519. | Provider | When to use |
  520. |----------|-------------|
  521. | `local` (default) | Single-user stdio mode. Runs `all-MiniLM-L6-v2` in-process via `@huggingface/transformers`. Downloads ~23 MB model on first use; subsequent starts use the cache. |
  522. | `remote` | Multi-user HTTP mode (Harness-hosted). Delegates embedding and retrieval to an external search service. Tenant isolation is enforced via `tenant_id` — static knowledge/docs use `global`, per-account entity data uses the account ID. |
  523. | `none` | Disable semantic search entirely; falls back to keyword scatter-gather across all resource types. |
  524. **Remote provider configuration:**
  525. ```bash
  526. HARNESS_SEARCH_PROVIDER=remote
  527. HARNESS_SEARCH_SERVICE_URL=http://search-svc:8080
  528. # Auth — any scheme via HARNESS_SEARCH_SERVICE_HEADERS (JSON object):
  529. HARNESS_SEARCH_SERVICE_HEADERS='{"Authorization":"Bearer <token>"}' # standard bearer
  530. HARNESS_SEARCH_SERVICE_HEADERS='{"x-api-key":"<key>"}' # API key header
  531. HARNESS_SEARCH_SERVICE_HEADERS='{"x-harness-token":"<svc-token>"}' # internal service-to-service
  532. # Multiple headers (e.g. service mesh + tenant routing):
  533. HARNESS_SEARCH_SERVICE_HEADERS='{"x-harness-token":"<tok>","x-tenant":"<id>"}'
  534. # No auth (service mesh / mTLS handles it):
  535. # omit HARNESS_SEARCH_SERVICE_HEADERS entirely
  536. ```
  537. **Testing the remote provider locally** with the included stub service (no external dependencies):
  538. ```bash
  539. # 1. Create a venv and install FastAPI
  540. python3 -m venv .venv-stub
  541. .venv-stub/bin/pip install fastapi uvicorn
  542. # 2. Start the stub (in-memory, cosine similarity, corpus + tenant filtering)
  543. .venv-stub/bin/uvicorn stub-search-service:app --port 8082
  544. # 3. Build the MCP server
  545. pnpm build
  546. # 4. Run the integration smoke test
  547. node test-remote-provider.mjs
  548. # Expected output:
  549. # available: true
  550. # indexed 2 docs
  551. # entity search results: pipeline:ts-test score=... corpus=entities
  552. # knowledge search results: schema:trigger score=...
  553. # all-corpus search results: (merged, sorted by score)
  554. # isolation check (other-acct, should be empty): PASS
  555. # 5. Tear down
  556. kill $(lsof -ti :8082)
  557. ```
  558. The stub (`stub-search-service.py`) implements the same `/v1/health`, `/v1/ingest`, and `/v1/search` contract as the production search service. It uses a simple bag-of-chars embedding so no model download is required — results are semantically plausible but not production-quality.
  559. ### HTTPS Enforcement
  560. `HARNESS_BASE_URL` must use HTTPS by default. If you set a non-HTTPS URL (e.g. `http://localhost:8080`), the server will refuse to start with:
  561. ```
  562. HARNESS_BASE_URL must use HTTPS (got "http://..."). If you need HTTP for local development, set HARNESS_ALLOW_HTTP=true.
  563. ```
  564. ### Audit Logging
  565. All registry-dispatched Harness API operations (`list`, `get`, `create`, `update`, `delete`, and `execute`) emit structured audit events when audit sinks are configured. Mutating events include the confirmation path used by elicitation or auto-approval when a confirmation context is present; read events currently omit confirmation metadata. Local metadata and schema discovery tools that bypass the registry, such as `harness_describe` and `harness_schema`, are not part of this audit stream. A stderr sink is registered by default but goes through the normal logger and obeys `LOG_LEVEL`; configure file or webhook sinks for durable audit collection:
  566. - `HARNESS_AUDIT_FILE` appends newline-delimited JSON events for local collection.
  567. - `HARNESS_AUDIT_WEBHOOK_URL` posts `{ "events": [...] }` batches to an HTTPS webhook, optionally with `HARNESS_AUDIT_WEBHOOK_TOKEN`. Failed batches are re-enqueued with bounded capacity and eventually dropped with a warning rather than blocking tool execution.
  568. - `OTEL_EXPORTER_OTLP_ENDPOINT` enables audit spans when the optional OpenTelemetry peer dependencies are installed. The sink reuses an existing tracer provider when one is registered, otherwise it bootstraps a standalone OTLP exporter.
  569. Each event includes the tool name, resource type, operation, identifiers, timestamp, risk, outcome, HTTP method/path, duration, and confirmation method when applicable. Audit sinks are best-effort telemetry; delivery issues are logged and never replay or change the underlying Harness API operation. For OTel setup details and span attributes, see [`specs/005-otel-audit-sink.md`](specs/005-otel-audit-sink.md).
  570. ## Tools Reference
  571. The server exposes 11 MCP tools. Most API tools accept `org_id` and `project_id` as optional overrides — if omitted, they fall back to `HARNESS_ORG` and `HARNESS_PROJECT`. `harness_describe` is local metadata only and does not use org/project scope.
  572. **URL support:** Most API-facing tools accept a `url` parameter — paste a Harness UI URL and the server auto-extracts org, project, resource type, resource ID, pipeline ID, and execution ID. `harness_describe` does not accept `url`.
  573. **Scope support:** Resource types with account/org/project variants expose `supportedScopes` in `harness_describe`. Pass `resource_scope` when you need a specific level:
  574. - `resource_scope: "account"` sends only `accountIdentifier`.
  575. - `resource_scope: "org"` sends `accountIdentifier` and `orgIdentifier`.
  576. - `resource_scope: "project"` sends account, org, and project identifiers.
  577. Current multi-scope resources include `connector`, `service`, `environment`, `infrastructure`, `secret`, `file_store`, `template`, `policy`, and `policy_set`. If `resource_scope` is omitted, the registry uses the resource's default scope and configured defaults, except resources marked as optional scope may omit org/project unless explicitly passed. Harness URLs can also set the scope automatically when the path contains account-level or project-level context.
  578. **Approval-card metadata (`reviewCard`):** Resource types that opt in expose an optional `reviewCard` object in `harness_describe(resource_type="<type>")`. It tells chat clients how to render a create/update review card: `version` (currently `1`), optional `label` (card title noun), and `fields[]` rows, each with `label`, `path` (dotted path into the request body), and optional `labels` (enum → display text), `template`, `default`, and `lookup` (`{ resourceType, match, display }` id → name resolution via `harness_list`). Resources without it use the generic confirm card. Currently declared for `cost_perspective` and `cost_category`. See `docs/coding-standards.md` (`reviewCard` contract).
  579. **Structured output:** Every tool declares an MCP `outputSchema`. `harness_list` normalizes list-like Harness responses into object-shaped structured content so strict clients can validate it: top-level arrays become `{ "items": [...], "total": <count>, "page": <page> }`, and common wrapper keys such as `content`, `data`, `body`, `objects`, or `features` are hoisted to `items` when needed. The text response still contains the compact JSON payload returned to all clients.
  580. | Tool | Description |
  581. | --------------------| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  582. | `harness_describe` | Discover available resource types, operations, and fields. No API call — returns local registry metadata. |
  583. | `harness_schema` | Fetch exact YAML/JSON Schema definitions and examples for creating/updating resources. Pipeline/template schemas are bundled; connector, environment, service, secret, and infrastructure schemas are scope-aware entity schemas fetched from bundled snapshots or NG `/yaml-schema`; `release_process` and `release_activity` schemas are fetched live from RMG `/api/yamlSchema`. Supports deep drilling via `path`. |
  584. | `harness_list` | List resources of a given type with filtering, search, and pagination. |
  585. | `harness_get` | Get a single resource by its identifier. |
  586. | `harness_create` | Create a new resource. Supports inline and remote (Git-backed) pipelines. Prompts for user confirmation via [elicitation](#elicitation). |
  587. | `harness_update` | Update an existing resource. Supports inline and remote (Git-backed) pipelines. Prompts for user confirmation via [elicitation](#elicitation). |
  588. | `harness_delete` | Delete a resource. Prompts for user confirmation via [elicitation](#elicitation). Destructive. |
  589. | `harness_execute` | Execute an action on a resource (run/retry pipeline, import pipeline from Git, toggle flag, sync app). Prompts for user confirmation via [elicitation](#elicitation). For pipeline runs, use the runtime-input workflow below (supports `branch`/`tag`/`pr_number`/`commit_sha` shorthand expansion). |
  590. | `harness_search` | Search across Harness resource types with a single query. Uses semantic routing (local `all-MiniLM-L6-v2` ONNX embeddings, 384-dim) to predict relevant resource types from a `knowledge` corpus indexed at startup — typically narrowing from ~163 types to 1–8 before scatter-gather. Falls back to full keyword scatter-gather when semantic confidence is low. Response includes `semantic_routed` and `types_skipped` when routing fires. See `docs/search-guidelines.md` for how to make new resource types discoverable. |
  591. | `harness_diagnose` | Diagnose `pipeline`, `connector`, `delegate`, and `gitops_application` resources (aliases: `execution` -> `pipeline`, `gitops_app` -> `gitops_application`). For pipelines, returns stage/step timing and failure details; for connectors/delegates/GitOps apps, returns targeted health and troubleshooting signals. |
  592. | `harness_status` | Get a real-time project health dashboard — recent executions, failure rates, and deep links. |
  593. ### Schema Lookup Workflow
  594. Use `harness_schema` before creating or updating YAML-backed resources so agents can copy exact field names and constraints instead of guessing from prose.
  595. - Bundled schemas include `pipeline`, `template`, `trigger`, `pipeline_v1`, `template_v1`, `inputSet_v1`, `overlayInputSet_v1`, and `agent-pipeline`.
  596. - Entity schemas include `connector`, `environment`, `service`, `secret`, and `infrastructure`. They are scope-aware (`account`, `org`, or `project`) and require `org_id`/`project_id` when the selected scope requires them.
  597. - Release Management definitions (`release_process`, `release_activity`) fetch live JSON Schema from RMG `/api/yamlSchema` (not bundled). Pass `scope`, `org_id`, and `project_id` when scoping to org or project.
  598. - Vendored entity snapshots are used first when they match the runtime account; otherwise the tool falls back to the Harness NG `/yaml-schema` API and caches the result.
  599. - Omit `path` for a field/section summary, then pass a dot-separated `path` to inspect a nested definition.
  600. Examples:
  601. ```json
  602. { "resource_type": "pipeline", "path": "pipeline.stages" }
  603. ```
  604. ```json
  605. {
  606. "resource_type": "connector",
  607. "scope": "project",
  608. "org_id": "default",
  609. "project_id": "payments"
  610. }
  611. ```
  612. Maintainers can refresh the vendored entity snapshots with `pnpm sync-entity-schemas` when Harness entity YAML schemas change.
  613. ### Tool Examples
  614. **Discover what resources are available:**
  615. ```json
  616. { "resource_type": "pipeline" }
  617. ```
  618. **List organizations in the account:**
  619. ```json
  620. { "resource_type": "organization" }
  621. ```
  622. **List projects in an organization:**
  623. ```json
  624. { "resource_type": "project", "org_id": "default" }
  625. ```
  626. **List pipelines in a project:**
  627. ```json
  628. { "resource_type": "pipeline", "search_term": "deploy", "size": 10 }
  629. ```
  630. **Get a specific service:**
  631. ```json
  632. { "resource_type": "service", "resource_id": "my-service-id" }
  633. ```
  634. **Run a pipeline:**
  635. ```json
  636. {
  637. "resource_type": "pipeline",
  638. "action": "run",
  639. "resource_id": "my-pipeline",
  640. "inputs": { "tag": "v1.2.3" },
  641. "wait": true
  642. }
  643. ```
  644. **Toggle a feature flag:**
  645. ```json
  646. {
  647. "resource_type": "feature_flag",
  648. "action": "toggle",
  649. "resource_id": "new_checkout_flow",
  650. "enable": true,
  651. "environment": "production"
  652. }
  653. ```
  654. **Search across all resource types:**
  655. ```json
  656. { "query": "payment-service" }
  657. ```
  658. **Diagnose an execution by ID (summary mode — default):**
  659. ```json
  660. { "execution_id": "abc123XYZ" }
  661. ```
  662. **Diagnose from a Harness URL:**
  663. ```json
  664. { "url": "https://app.harness.io/ng/account/.../pipelines/myPipeline/executions/abc123XYZ/pipeline" }
  665. ```
  666. **Diagnose connector connectivity:**
  667. ```json
  668. { "resource_type": "connector", "resource_id": "my_github_connector" }
  669. ```
  670. **Diagnose delegate health:**
  671. ```json
  672. { "resource_type": "delegate", "resource_id": "delegate-us-east-1" }
  673. ```
  674. **Diagnose a GitOps application (with options):**
  675. ```json
  676. {
  677. "resource_type": "gitops_application",
  678. "resource_id": "checkout-app",
  679. "options": { "agent_id": "gitops-agent-1" }
  680. }
  681. ```
  682. **Get the latest execution report for a pipeline:**
  683. ```json
  684. { "pipeline_id": "my-pipeline" }
  685. ```
  686. **Full diagnostic mode with YAML and failed step logs:**
  687. ```json
  688. { "execution_id": "abc123XYZ", "summary": false }
  689. ```
  690. **Summary mode with logs enabled (best of both):**
  691. ```json
  692. { "execution_id": "abc123XYZ", "include_logs": true }
  693. ```
  694. **Get project health status:**
  695. ```json
  696. { "org_id": "default", "project_id": "my-project", "limit": 5 }
  697. ```
  698. **List database schemas filtered by migration type:**
  699. ```json
  700. { "resource_type": "database_schema", "migration_type": "Liquibase" }
  701. ```
  702. **List database instances for a schema:**
  703. ```json
  704. { "resource_type": "database_instance", "dbschema_id": "my_schema" }
  705. ```
  706. **Get the resolved LLM authoring pipeline for a schema and instance:**
  707. ```json
  708. { "resource_type": "database_llm_authoring_pipeline", "resource_id": "my_schema", "dbinstance_id": "prod_db" }
  709. ```
  710. **List snapshot object names (e.g. tables) for a schema instance:**
  711. ```json
  712. {
  713. "resource_type": "database_snapshot_object",
  714. "dbschema_id": "my_schema",
  715. "dbinstance_id": "prod_db",
  716. "object_type": "Table"
  717. }
  718. ```
  719. **Get full snapshot metadata for specific named objects:**
  720. ```json
  721. {
  722. "resource_type": "database_snapshot_object",
  723. "resource_id": "prod_db",
  724. "params": {
  725. "dbschema_id": "my_schema",
  726. "object_type": "Table",
  727. "object_names": ["users", "orders"]
  728. }
  729. }
  730. ```
  731. ### Pipeline Run Workflow (Recommended)
  732. For v0 pipelines, use this sequence to reduce execution-time input errors:
  733. 1. **Discover required runtime inputs**
  734. - `harness_get(resource_type="runtime_input_template", resource_id="<pipeline_id>")`
  735. - The returned template shows `<+input>` placeholders that need values.
  736. 2. **Choose input strategy**
  737. - **Simple variables:** pass flat key-value `inputs` (for example `{"branch":"main","env":"prod"}`).
  738. - **Complex/structural inputs:** use `input_set_ids` (CI codebase/build blocks and nested template inputs are best handled this way).
  739. - **CI codebase shorthand keys (pipeline run only):**
  740. | Shorthand key | Expanded structure |
  741. | ------------- | ------------------------------------------------------ |
  742. | `branch` | `build.type=branch`, `build.spec.branch=<value>` |
  743. | `tag` | `build.type=tag`, `build.spec.tag=<value>` |
  744. | `pr_number` | `build.type=PR`, `build.spec.number=<value>` |
  745. | `commit_sha` | `build.type=commitSha`, `build.spec.commitSha=<value>` |
  746. - **Constraint:** shorthand expansion is skipped when `inputs.build` is already present (explicit `build` wins).
  747. 3. **Execute the run**
  748. - `harness_execute(resource_type="pipeline", action="run", resource_id="<pipeline_id>", ...)`
  749. - For Git-backed pipelines whose YAML should be loaded from a non-default branch, pass `params.pipeline_branch` (sent to Harness as `branch`). This explicit definition selector takes precedence over the `params.branch` alias. `inputs.branch` independently selects the CI codebase branch:
  750. ```json
  751. {
  752. "resource_type": "pipeline",
  753. "action": "run",
  754. "resource_id": "deploy_app",
  755. "params": { "pipeline_branch": "feature/new-stage" },
  756. "inputs": { "branch": "main" },
  757. "wait": true
  758. }
  759. ```
  760. 4. **Optional: combine both**
  761. - Use `input_set_ids` for the base shape and `inputs` for simple overrides.
  762. For v1 pipelines:
  763. 1. Fetch `harness_get(resource_type="runtime_input_template_v1", resource_id="<pipeline_id>")`.
  764. For Git-backed pipelines, pass `branch_name`, `connector_ref`, and `repo_name` through `params`.
  765. 2. Use each returned `inputs[].details.name` as a top-level key in `harness_execute.inputs`.
  766. 3. Run `harness_execute(resource_type="pipeline_v1", action="run", resource_id="<pipeline_id>", inputs={...})`.
  767. The server wraps these values under an `inputs:` YAML root and sends the API's `inputs_yaml` body.
  768. If required fields are unresolved, the tool returns a pre-flight error with expected keys and suggested input sets. You can inspect available shorthand mappings with `harness_describe(resource_type="pipeline")` (`executeActions.run.inputShorthands`).
  769. ### Dynamic Pipeline Execution
  770. Use `pipeline_dynamic_execution.run` when an agent or external system generates the full v0 pipeline YAML at runtime and needs to run it against an existing Harness pipeline shell. This is not a replacement for normal `pipeline.run`: the saved v0 pipeline must already exist, account-level and pipeline-level **Allow Dynamic Execution** must be enabled, and the caller needs Edit plus Execute permissions on the pipeline.
  771. ```json
  772. {
  773. "resource_type": "pipeline_dynamic_execution",
  774. "action": "run",
  775. "resource_id": "deploy_app",
  776. "body": {
  777. "yaml": "pipeline:\n identifier: deploy_app\n name: Deploy App\n stages: []"
  778. },
  779. "params": {
  780. "module_type": "CD",
  781. "notes": "agent-generated dynamic run",
  782. "notify_only_user": true
  783. }
  784. }
  785. ```
  786. Constraints:
  787. - `body` must be an object with a `yaml` field. Raw string bodies are rejected by the public `harness_execute` schema.
  788. - `body.yaml` may be a YAML string or a JSON pipeline object; JSON is serialized to YAML before the request.
  789. - Runtime `<+input>` placeholders are not resolved by this API. Submit fully resolved YAML.
  790. - Input sets, selective stage execution, retry, and triggers are not supported by the dynamic execution endpoint.
  791. - The action is `high_write` and uses the normal confirmation/auto-approval path. The response projects the API envelope to `{ "execution_id": "...", "status": "..." }` and includes an `openInHarness` execution link when scope data is available.
  792. If Harness rejects the run as not enabled, check both the account-level Allow Dynamic Execution setting and the pipeline-level toggle under Pipeline -> Advanced Options -> Dynamic Execution Settings.
  793. ### Execution Input Forensics
  794. Use `execution_inputs` after a run to inspect the merged input YAML that produced a specific execution. This is useful when a failure depends on input-set merging, Git-backed input set branches, or trigger/runtime values that are hard to reconstruct from the execution page alone.
  795. ```json
  796. {
  797. "resource_type": "execution_inputs",
  798. "resource_id": "PLAN_EXECUTION_ID",
  799. "params": {
  800. "resolve_expressions": true,
  801. "resolve_expressions_type": "RESOLVE_ALL_EXPRESSIONS"
  802. }
  803. }
  804. ```
  805. The get response is projected to:
  806. - `executionId` - the plan execution ID from `resource_id`.
  807. - `inputSetYaml` - merged runtime input YAML used for the run, or `null`.
  808. - `inputSetTemplateYaml` - input template at execution time, or `null`.
  809. - `resolvedYaml` - expression-resolved YAML when `resolve_expressions=true`, otherwise usually `null`.
  810. - `inputSetDetails` - contributing saved input sets as `{ identifier, name }` pairs.
  811. - `inputSetBranchName` - source branch for Git-backed input sets, or `null`.
  812. `execution_inputs` is get-only and read-risk. If `resolve_expressions` is omitted, the server omits the API query parameters and Harness uses its default `UNKNOWN` resolution mode.
  813. ### Pipeline Execute Wait Mode
  814. For `pipeline.run`, `pipeline.retry`, and `pipeline_v1.run`, pass `wait: true` to let the server poll until the execution reaches a terminal status. This keeps a pipeline launch and status check in one tool call instead of asking the client or LLM to run a polling loop.
  815. ```json
  816. {
  817. "resource_type": "pipeline",
  818. "action": "run",
  819. "resource_id": "deploy_app",
  820. "inputs": { "branch": "main" },
  821. "wait": true,
  822. "wait_timeout_seconds": 900,
  823. "wait_poll_interval_seconds": 5
  824. }
  825. ```
  826. Wait mode behavior:
  827. - Default timeout is 600 seconds; allowed range is 10 seconds to 7200 seconds.
  828. - Initial poll interval defaults to 3 seconds, backs off by 1.5x, and caps at 30 seconds.
  829. - On success or failure, the response includes fields such as `execution_id`, `execution_status`, `execution_terminal`, `execution_elapsed_ms`, and `execution_poll_count`.
  830. - If the timeout fires, the original trigger still succeeded; the response includes `execution_timed_out: true` and `_wait.hint` with the last observed status.
  831. - If polling fails after the trigger succeeds, the response includes `_wait.error` and a recheck hint. Do not blindly rerun the pipeline unless you have confirmed the first execution is not running.
  832. - Failed terminal statuses include `_diagnose_hint` pointing to `harness_diagnose(resource_type="execution", options={execution_id: "..."})`.
  833. **Ask the AI DevOps Agent to create a pipeline:**
  834. ```json
  835. {
  836. "prompt": "Create a pipeline that builds a Go app with Docker and deploys to Kubernetes",
  837. "action": "CREATE_PIPELINE"
  838. }
  839. ```
  840. **Update a service via natural language:**
  841. ```json
  842. {
  843. "prompt": "Add a sidecar container for logging",
  844. "action": "UPDATE_SERVICE",
  845. "conversation_id": "prev-conversation-id",
  846. "context": [{ "type": "yaml", "payload": "<existing service YAML>" }]
  847. }
  848. ```
  849. ### Pipeline Storage Modes
  850. Harness pipelines can be stored in three ways:
  851. | Mode | Description | When to use |
  852. | ------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------ |
  853. | **Inline** | Pipeline YAML stored in Harness | Default. Simplest setup, no Git required. |
  854. | **Remote (External Git)** | Pipeline YAML stored in GitHub, GitLab, Bitbucket, etc. | Teams using Git-backed pipeline-as-code with an external provider. |
  855. | **Remote (Harness Code)** | Pipeline YAML stored in a Harness Code repository | Teams using Harness's built-in Git hosting. |
  856. **Create an inline pipeline (default):**
  857. ```json
  858. // harness_create
  859. {
  860. "resource_type": "pipeline",
  861. "body": {
  862. "yamlPipeline": "pipeline:\n name: My Pipeline\n identifier: my_pipeline\n stages:\n - stage:\n name: Build\n type: CI\n spec:\n execution:\n steps:\n - step:\n type: Run\n name: Echo\n spec:\n command: echo hello"
  863. }
  864. }
  865. ```
  866. **Create a remote pipeline (External Git — e.g. GitHub):**
  867. ```json
  868. // harness_create
  869. {
  870. "resource_type": "pipeline",
  871. "body": {
  872. "yamlPipeline": "pipeline:\n name: Deploy Service\n identifier: deploy_service\n stages: []"
  873. },
  874. "params": {
  875. "store_type": "REMOTE",
  876. "connector_ref": "my_github_connector",
  877. "repo_name": "my-repo",
  878. "branch": "main",
  879. "file_path": ".harness/deploy-service.yaml",
  880. "commit_msg": "Add deploy pipeline via MCP"
  881. }
  882. }
  883. ```
  884. **Create a remote pipeline (Harness Code — no connector needed):**
  885. ```json
  886. // harness_create
  887. {
  888. "resource_type": "pipeline",
  889. "body": {
  890. "yamlPipeline": "pipeline:\n name: Build App\n identifier: build_app\n stages: []"
  891. },
  892. "params": {
  893. "store_type": "REMOTE",
  894. "is_harness_code_repo": true,
  895. "repo_name": "product-management",
  896. "branch": "main",
  897. "file_path": ".harness/build-app.yaml",
  898. "commit_msg": "Add build pipeline via MCP"
  899. }
  900. }
  901. ```
  902. **Update a remote pipeline:**
  903. ```json
  904. // harness_update
  905. {
  906. "resource_type": "pipeline",
  907. "resource_id": "deploy_service",
  908. "body": {
  909. "yamlPipeline": "pipeline:\n name: Deploy Service\n identifier: deploy_service\n stages:\n - stage:\n name: Deploy\n type: Deployment"
  910. },
  911. "params": {
  912. "store_type": "REMOTE",
  913. "connector_ref": "my_github_connector",
  914. "repo_name": "my-repo",
  915. "branch": "main",
  916. "file_path": ".harness/deploy-service.yaml",
  917. "commit_msg": "Update deploy pipeline via MCP",
  918. "last_object_id": "abc123",
  919. "last_commit_id": "def456"
  920. }
  921. }
  922. ```
  923. **Import a pipeline from an external Git repo:**
  924. ```json
  925. // harness_execute
  926. {
  927. "resource_type": "pipeline",
  928. "action": "import",
  929. "params": {
  930. "connector_ref": "my_github_connector",
  931. "repo_name": "my-repo",
  932. "branch": "main",
  933. "file_path": ".harness/existing-pipeline.yaml"
  934. },
  935. "body": {
  936. "pipeline_name": "Existing Pipeline",
  937. "pipeline_description": "Imported from GitHub"
  938. }
  939. }
  940. ```
  941. **Import a pipeline from a Harness Code repo:**
  942. ```json
  943. // harness_execute
  944. {
  945. "resource_type": "pipeline",
  946. "action": "import",
  947. "params": {
  948. "is_harness_code_repo": true,
  949. "repo_name": "product-management",
  950. "branch": "main",
  951. "file_path": ".harness/existing-pipeline.yaml"
  952. },
  953. "body": {
  954. "pipeline_name": "Existing Pipeline"
  955. }
  956. }
  957. ```
  958. **Create a connector:**
  959. ```json
  960. {
  961. "resource_type": "connector",
  962. "body": { "connector": { "name": "My Docker Hub", "identifier": "my_docker", "type": "DockerRegistry" } }
  963. }
  964. ```
  965. **Delete a trigger:**
  966. ```json
  967. {
  968. "resource_type": "trigger",
  969. "resource_id": "nightly-trigger",
  970. "pipeline_id": "my-pipeline"
  971. }
  972. ```
  973. **List input sets for a pipeline:**
  974. ```json
  975. {
  976. "resource_type": "input_set",
  977. "pipeline_id": "my-pipeline"
  978. }
  979. ```
  980. **Get a specific input set:**
  981. ```json
  982. {
  983. "resource_type": "input_set",
  984. "resource_id": "prod-inputs",
  985. "pipeline_id": "my-pipeline"
  986. }
  987. ```
  988. **Create an input set:**
  989. ```json
  990. {
  991. "resource_type": "input_set",
  992. "pipeline_id": "my-pipeline",
  993. "body": "inputSet:\n name: Production Inputs\n identifier: prod_inputs\n pipeline:\n identifier: my-pipeline\n variables:\n - name: env\n type: String\n value: production"
  994. }
  995. ```
  996. **Update an input set:**
  997. ```json
  998. {
  999. "resource_type": "input_set",
  1000. "resource_id": "prod_inputs",
  1001. "pipeline_id": "my-pipeline",
  1002. "body": "inputSet:\n name: Production Inputs\n identifier: prod_inputs\n pipeline:\n identifier: my-pipeline\n variables:\n - name: env\n type: String\n value: production\n - name: replicas\n type: String\n value: \"3\""
  1003. }
  1004. ```
  1005. **Delete an input set:**
  1006. ```json
  1007. {
  1008. "resource_type": "input_set",
  1009. "resource_id": "prod_inputs",
  1010. "pipeline_id": "my-pipeline"
  1011. }
  1012. ```
  1013. ## Resource Types
  1014. 274 resource types organized across 44 toolsets. Each resource type supports a subset of CRUD operations and optional execute actions.
  1015. ### Platform
  1016. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1017. | -------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1018. | `organization` | x | x | x | x | x | |
  1019. | `project` | x | x | x | x | x | |
  1020. ### Pipelines
  1021. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1022. | ------------------------------ | ---- | --- | ------ | ------ | ------ | ------------------- |
  1023. | `pipeline` | x | x | x | x | x | `run`, `retry` |
  1024. | `pipeline_v1` **(Alpha)** | x | x | x | x | x | `run` |
  1025. | `pipeline_dynamic_execution` | | | | | | `run` |
  1026. | `execution` | x | x | | | | `interrupt` |
  1027. | `execution_inputs` | | x | | | | |
  1028. | `trigger` | x | x | x | x | x | |
  1029. | `pipeline_summary` | | x | | | | |
  1030. | `input_set` | x | x | x | x | x | |
  1031. | `runtime_input_template` | | x | | | | |
  1032. | `runtime_input_template_v1` | | x | | | | |
  1033. | `pipeline_resolved_yaml` | | x | | | | |
  1034. | `approval_instance` | x | | | | | `approve`, `reject` |
  1035. Both pipeline YAML resource types are available when the pipelines toolset is enabled. `HARNESS_PIPELINE_VERSION` and the HTTP `x-harness-pipeline-version` initialization header select the default version preference; they do not hide the other version.
  1036. ### AI Agents
  1037. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1038. | ------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1039. | `agent` | x | x | x | x | x | |
  1040. | `agent_run` | x | | | | | |
  1041. ### Services
  1042. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1043. | ------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1044. | `service` | x | x | x | x | x | |
  1045. ### Environments
  1046. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1047. | ------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1048. | `environment` | x | x | x | x | x | `move_configs` |
  1049. ### Connectors
  1050. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1051. | --------------------- | ---- | --- | ------ | ------ | ------ | ----------------- |
  1052. | `connector` | x | x | x | x | x | `test_connection` |
  1053. | `connector_catalogue` | x | | | | | |
  1054. | `llm_model` | x | | | | | |
  1055. ### Infrastructure
  1056. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1057. | ---------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1058. | `infrastructure` | x | x | x | x | x | `move_configs` |
  1059. ### Secrets
  1060. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1061. | ------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1062. | `secret` | x | x | | | | |
  1063. ### Execution Logs
  1064. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1065. | --------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1066. | `execution_log` | | x | | | | |
  1067. ### Audit Trail
  1068. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1069. | ------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1070. | `audit_event` | x | x | | | | |
  1071. ### Delegates
  1072. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1073. | ---------------- | ---- | --- | ------ | ------ | ------ | ------------------------- |
  1074. | `delegate` | x | x | | | | |
  1075. | `delegate_token` | x | x | x | | x | `revoke`, `get_delegates` |
  1076. ### Code Repositories
  1077. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1078. | -------------- | ---- | --- | ------ | ------ | ------ | -------------------- |
  1079. | `repository` | x | x | x | x | | |
  1080. | `branch` | x | x | x | | x | |
  1081. | `commit` | x | x | x | | | `diff`, `diff_stats` |
  1082. | `file_content` | x | x | | | | `blame` |
  1083. | `tag` | x | | x | | x | |
  1084. | `repo_rule` | x | x | | | | |
  1085. | `space_rule` | x | x | | | | |
  1086. `commit` creation commits one or more file actions directly through the Harness Code API without cloning. Pass `body.title`, `body.branch`, and `body.actions`; each action is `CREATE`, `UPDATE`, `DELETE`, or `MOVE`, and `UPDATE` requires the current blob SHA.
  1087. `file_content` list returns every path at a ref; get returns file or directory content (omit or pass empty `path` for the repo root; nested paths keep slashes). Omit `git_ref` to use the repository default branch — do not guess `main`.
  1088. ### Artifact Registries
  1089. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1090. | ------------------ | ---- | --- | ------ | ------ | ------ | --------------- |
  1091. | `registry` | x | x | | | | |
  1092. | `artifact` | x | | | | | |
  1093. | `artifact_version` | x | | | | | |
  1094. | `artifact_file` | x | | | | | |
  1095. ### File Store
  1096. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1097. | ------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1098. | `file_store` | x | x | x | x | x | `list_children` |
  1099. `file_store` manages Harness File Store files and folders through the generic tools. It supports account, org, and project scope; pass `resource_scope="account"|"org"|"project"` or paste a Harness File Store URL so the server can derive scope and IDs.
  1100. Common calls:
  1101. ```text
  1102. # List the account-level File Store.
  1103. harness_list(resource_type="file_store", resource_scope="account")
  1104. # Create a folder at the current scope root.
  1105. harness_create(resource_type="file_store", body={
  1106. name: "scripts",
  1107. type: "FOLDER",
  1108. parent_identifier: "Root"
  1109. })
  1110. # Upload a UTF-8 script file. Use content_base64 instead for binary data.
  1111. harness_create(resource_type="file_store", body={
  1112. name: "deploy.sh",
  1113. type: "FILE",
  1114. parent_identifier: "Root",
  1115. content: "#!/usr/bin/env bash\n./deploy",
  1116. mime_type: "text/x-shellscript",
  1117. file_usage: "SCRIPT"
  1118. })
  1119. # Rename metadata without replacing file content.
  1120. harness_update(resource_type="file_store", resource_id="deploy_script", body={
  1121. name: "deploy-prod.sh",
  1122. type: "FILE",
  1123. parent_identifier: "Root"
  1124. })
  1125. # List first-level children of a folder. This is a read-risk execute action.
  1126. harness_execute(resource_type="file_store", action="list_children",
  1127. resource_id="scripts_folder", params={folder_name: "scripts"})
  1128. ```
  1129. Multipart body constraints:
  1130. - Create/update accept JSON `body`, then convert it to `multipart/form-data` for `/ng/api/file-store`.
  1131. - `name`, `type` (`FILE` or `FOLDER`), and `parent_identifier` are required; use the literal `"Root"` only for the root of the selected scope.
  1132. - `FILE` create requires exactly one of `content` (UTF-8 string) or `content_base64` (valid non-empty base64). `FILE` update can omit content for metadata-only updates, or provide exactly one content field to replace content.
  1133. - `FOLDER` create/update must omit `content` and `content_base64`.
  1134. - Optional `file_usage` must be `MANIFEST_FILE`, `CONFIG`, or `SCRIPT`; optional scalar metadata such as `description`, `mime_type`, `path`, and `tags` must be strings.
  1135. - Upload content is capped at 100 MB. Confirmation prompts redact `content`, `content_base64`, and `contentBase64` previews before elicitation.
  1136. `list_children` accepts either shorthand (`resource_id` plus `params.folder_name`, or `params.file_store_id`/`params.folder_identifier` plus `params.folder_name`) or a full FileStoreNode `body` with `identifier`, `name`, and `type: "FOLDER"`. Full bodies use Harness camelCase `parentIdentifier`; shorthand may use `params.parent_identifier`.
  1137. ### Templates
  1138. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1139. | ------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1140. | `template` | x | x | x | x | x | |
  1141. Template operations use the Harness Template service paths (`/template/api/templates...`). Create and update require the full template YAML string in `body.template_yaml` or `body.yaml`; `version_label` targets a specific version for update/delete, while deleting without `version_label` deletes all versions.
  1142. ### Dashboards
  1143. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1144. | ---------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1145. | `dashboard` | x | x | | | | |
  1146. | `dashboard_data` | | x | | | | |
  1147. ### Database DevOps
  1148. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1149. | --------------------------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1150. | `database_schema` | x | x | x | x | x | |
  1151. | `database_instance` | x | x | x | x | x | |
  1152. | `database_snapshot_object` | x | x | | | | |
  1153. | `database_llm_authoring_pipeline` | | x | | | | |
  1154. ### Infrastructure as Code Management (IaCM)
  1155. IaCM resources are default-enabled and mostly project-scoped. Start with `iacm_workspace` to find workspace identifiers, then use that `workspace_id` for workspace resources, costs, and activity diffs. Use `iacm_variable_set` for reusable variable sets at account, org, or project scope. The provider registry is account-scoped.
  1156. `iacm_module` spans account, org, and project scope. It defaults to the account registry; every operation (list, get, create, update) sends the same `scope_org` / `scope_project` query params, so a module you create is discoverable at the scope you created it. Select the scope with `resource_scope="account" | "org" | "project"` plus `org_id`/`project_id`. Scoping is opt-in: when `resource_scope` is omitted, `org_id`/`project_id` apply only if you pass them explicitly — configured `HARNESS_ORG`/`HARNESS_PROJECT` defaults are not applied, so an ambient project config cannot silently register an account module under a project. A module body's own `org`/`project` fields locate its Git connector and are unrelated to this visibility scope.
  1157. `iacm_workspace` create/update return `{ policy_evaluation }` only — follow up with `harness_get` to fetch the workspace. `iacm_variable_set` and `iacm_module` create/update return the resource itself. `iacm_provider` create returns `{ id }` only — follow up with `harness_get`; **update is version-oriented only** (POST/PUT `/providers/{id}/version`) — there is no metadata PUT. Version writes may return an empty body; HarnessClient normalizes that to `{ status: "SUCCESS", message: "No content" }`.
  1158. Variable-set **update is HTTP PUT with full-replacement collections** — always `harness_get` first, then PUT the full desired body (`terraform_variables` / `environment_variables` are required on update; omit/empty clears connectors and variable files). Module update is also PUT — prefer get-then-put for optional fields. Writes are `medium_write` and require confirmation (elicitation or `confirm: true`).
  1159. Variable-set and provider-registry RBAC (`iac_variableset_*`, `iac_providerregistry_*`) are currently Experimental in Harness — access checks always allow until iac-server activates enforcement. Module registry RBAC (`iac_registry_view` / `iac_registry_edit`) is Active and enforceable. MCP always forwards the caller PAT/SAT unchanged.
  1160. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1161. | ------------------------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1162. | `iacm_workspace` | x | x | x | x | | |
  1163. | `iacm_variable_set` | x | x | x | x | | |
  1164. | `iacm_resource` | x | | | | | |
  1165. | `iacm_module` | x | x | x | x | | |
  1166. | `iacm_provider` | x | x | x | x | | |
  1167. | `iacm_workspace_costs` | x | | | | | |
  1168. | `iacm_activity_resource_change` | x | | | | | |
  1169. Typical workflow:
  1170. 1. `harness_list(resource_type="iacm_workspace", org_id="...", project_id="...")` to find the workspace.
  1171. 2. `harness_create` / `harness_update` on `iacm_workspace` to create from scratch or a template (`associated_template`), or update an existing workspace — response is `{ policy_evaluation }` only.
  1172. 3. `harness_get(resource_type="iacm_workspace", workspace_id="...")` to fetch the created/updated workspace.
  1173. 4. `harness_list` / `harness_create` / `harness_update` on `iacm_variable_set` (optionally with `resource_scope`) for reusable Terraform/env variable sets — response is the VariableSet resource.
  1174. 5. `harness_list` / `harness_create` / `harness_update` on `iacm_module` for the module registry (`name` + `system` required; add `resource_scope` with `org_id`/`project_id` for an org- or project-scoped module) — response is the module resource.
  1175. 6. `harness_list` / `harness_create` / `harness_update` on `iacm_provider` for the account provider registry (`body.type` required for create; create returns `{ id }` only — then `harness_get`; update creates/updates **versions** only) — version update may return empty success.
  1176. 7. `harness_list(resource_type="iacm_resource", org_id="...", project_id="...", workspace_id="...")` to inspect Terraform resources, outputs, and data sources.
  1177. 8. `harness_list(resource_type="iacm_workspace_costs", org_id="...", project_id="...", workspace_id="...")` to review per-execution cost entries.
  1178. 9. `harness_list(resource_type="iacm_activity_resource_change", org_id="...", project_id="...", activity_id="...", workspace_id="...")` to inspect before/after resource diffs for a plan, apply, or destroy activity.
  1179. IaCM list responses expose `page_count` as the count for the current page only (except `iacm_variable_set`, which is not paginated). When `has_more` is true, keep requesting the next 1-based page and sum page counts if you need a total.
  1180. ### Internal Developer Portal (IDP)
  1181. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1182. | ----------------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1183. | `idp_entity` | x | x | | | | |
  1184. | `scorecard` | x | x | | | | |
  1185. | `scorecard_check` | x | x | | | | |
  1186. | `scorecard_stats` | | x | | | | |
  1187. | `scorecard_check_stats` | | x | | | | |
  1188. | `idp_score` | x | x | | | | |
  1189. | `idp_workflow` | x | | | | | `execute` |
  1190. | `idp_tech_doc` | x | | | | | |
  1191. ### Pull Requests
  1192. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1193. | -------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1194. | `pull_request` | x | x | x | x | | `close`, `merge` |
  1195. | `pr_reviewer` | x | | x | | | `submit_review` |
  1196. | `pr_comment` | | | x | x | x | `resolve`, `unresolve` |
  1197. | `pr_check` | x | | | | | |
  1198. | `pr_activity` | x | | | | | |
  1199. Use `harness_execute(resource_type="pull_request", action="close", ...)` for an explicit close operation. `harness_update` also accepts `body.state` (`open` or `closed`) and routes state changes to the dedicated Harness Code PR state endpoint; send title/description edits in a separate update call.
  1200. Use `harness_list(resource_type="pr_activity", filters={type: ["comment", "code-comment"]}, ...)` to read PR comments. Use `pr_comment` for comment write operations.
  1201. Use `harness_execute(resource_type="pr_comment", action="resolve", ...)` to resolve a comment thread and `action="unresolve"` to reopen it; neither takes a body. `comment_id` must be a row's `id` from `pr_activity` where that row's `parent_id` is `null`; the API rejects reply ids.
  1202. ### Release Management
  1203. Release Management (RMG) resources are default-enabled. Definition resources (`release_process`, `release_activity`) support list/get/create/update/delete with `body.yaml`; call `harness_schema(resource_type="release_process"|"release_activity")` before create/update. Execution resources monitor running releases — most list operations require `release_id` (UUID from `harness_list resource_type=release`, or the UI URL slug such as `identifier-1.0.0-abc`). Paste an RMG release URL into `harness_list` to auto-fill `release_id`.
  1204. RMG calls use `${HARNESS_BASE_URL}/gateway/rmg` with account scoping via the `Harness-Account` header. Org/project scope uses header-based scoping when `org_id`/`project_id` are provided. `release_execution_phase` is list-only — use each phase item's `identifier` field as `params.phase_identifier` when calling `harness_get` on phase input/output resources (do not call `harness_get` on `release_execution_phase` itself). Release list `status` filtering is applied client-side on the current page only; keep paging with the same filters when results may span pages.
  1205. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1206. | ------------------------------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1207. | `release_process` | x | x | x | x | x | |
  1208. | `release_activity` | x | x | x | x | x | |
  1209. | `release` | x | x | | | | |
  1210. | `release_execution_phase` | x | | | | | |
  1211. | `release_execution_task` | x | | | | | |
  1212. | `release_execution_activity` | x | | | | | |
  1213. | `release_input` | | x | | | | |
  1214. | `release_execution_phase_input` | | x | | | | |
  1215. | `release_execution_phase_output` | | x | | | | |
  1216. | `release_execution_activity_input` | | x | | | | |
  1217. | `release_execution_activity_output` | | x | | | | |
  1218. Typical workflow:
  1219. 1. `harness_list(resource_type="release_process", org_id="...", project_id="...")` to discover orchestration process definitions.
  1220. 2. `harness_schema(resource_type="release_process")` (or `release_activity`) before create/update; then `harness_create` / `harness_update` with `body.yaml`.
  1221. 3. `harness_list(resource_type="release", org_id="...", project_id="...")` to find active or recent releases (default 30-day look-back; optional `filters.status`, `filters.search_term`, `filters.days_back`).
  1222. 4. `harness_get(resource_type="release", release_id="...")` for release details.
  1223. 5. `harness_list(resource_type="release_execution_phase", filters={ release_id: "..." })` for phase status; same `release_id` for `release_execution_task` and `release_execution_activity`.
  1224. 6. `harness_get` on `release_input`, `release_execution_phase_input`, `release_execution_phase_output`, `release_execution_activity_output`, or `release_execution_activity_input` using `release_id` plus `params.phase_identifier` / `params.activity_identifier` / `activity_execution_id` as documented on each resource.
  1225. ### Unified Search
  1226. The opt-in `unified-search` toolset (`HARNESS_TOOLSETS=+unified-search`) adds semantic (meaning-based) search across every source search-service serves. Results are scoped to the caller's account and RBAC-filtered. The account needs the semantic search feature flag.
  1227. | Resource Type | List | Get | Execute Actions |
  1228. | ------------- | ---- | --- | --------------- |
  1229. | `unified_search` | x | | `search` |
  1230. | `unified_search_source` | | x | |
  1231. ```text
  1232. # 1. Search with the user's words (all sources)
  1233. harness_search(query="payments service that keeps crashing")
  1234. # 2. Optional: if a hit names a Knowledge Graph type, look it up or query it
  1235. harness_get(resource_type="kg_type", resource_id="<type id>", params={kind: "<kind>"})
  1236. # 3. Narrow with filters on the hits' metadata keys, per source
  1237. harness_execute(resource_type="unified_search", action="search", body={
  1238. query: "payments service that keeps crashing",
  1239. source_filters: {"<source>": {predicate: {field: "<metadata key>", op: "NE", values: [{string_value: "closed"}]}}}
  1240. })
  1241. ```
  1242. `harness_get(resource_type="unified_search_source")` lists the sources. See `harness_describe(resource_type="unified_search")` for the filter syntax.
  1243. This is separate from the semantic routing providers in [Semantic Search](#semantic-search), which index MCP resource definitions and docs to narrow `harness_search`'s fan-out.
  1244. ### Vibe
  1245. The default-enabled `vibe` toolset covers the [Vibe Orchestrator BFF contract](tests/fixtures/vibe-bff-openapi.yaml) under `${HARNESS_BASE_URL}/vibe/v1`. It uses the existing Harness connection and account header, without adding account/org/project query parameters or scope fields to request bodies. The team validated the Vibe flow using Harness API-key authentication (PAT/SAT), so no opt-in setting is required for default sessions. The curated OpenAPI documents bearer/session authentication; the server's OAuth mode forwards the current session's bearer token. Automated regressions verify both header paths; gateway authentication remains subject to the target environment's configuration.
  1246. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1247. | ------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1248. | `vibe_project` | | | x | | | `prepare`, `deploy` |
  1249. | `vibe_app_lifecycle` | | x | | | | `events` |
  1250. The API supports two intake paths. Keep these API-native request shapes:
  1251. | Source available to the coding agent | API flow |
  1252. | ----------------------------------- | -------- |
  1253. | GitHub repository link/connector | `harness_create` with `resource_type="vibe_project"` and `body.mode` plus the mode-specific fields. The contract names `github_link` and `github_connector` but does not define their URL, branch, or connector field shapes; these fields are forwarded to the backend without inventing a mapping. |
  1254. | ZIP file | Call `prepare` with the app name and file metadata, upload the bytes to the returned signed target, then call `deploy`. |
  1255. | Local source directory | The coding agent archives the intended workspace source into a ZIP locally, then follows the ZIP flow. A local path or conversational context is not an API-supported source upload. |
  1256. When packaging a directory, include the source, manifests, lockfiles, configuration, and intended uncommitted edits needed to build it. Exclude credentials, `.git`, installed dependencies, and generated artifacts. Packaging and the signed upload happen where the files are accessible; a hosted MCP server cannot read the coding agent's local directory.
  1257. For an existing ZIP, prepare the upload:
  1258. ```json
  1259. {
  1260. "resource_type": "vibe_project",
  1261. "action": "prepare",
  1262. "body": {
  1263. "name": "demo-app",
  1264. "file": {
  1265. "path": "app.zip",
  1266. "size_bytes": 12345,
  1267. "content_type": "application/zip"
  1268. }
  1269. }
  1270. }
  1271. ```
  1272. Pass this to `harness_execute`. The size must describe the actual ZIP; `size_bytes`, `content_type`, and `md5` are optional and nullable. Additional prepare fields are preserved for backend validation, as permitted by the OpenAPI. Preparation returns `projectId`, `sourceId`, and `upload`, including each file's `uploadUrl`, `method`, `headers`, and `expiresAt`. Upload the file bytes directly using that signed URL, method, and headers; preserve the URL exactly and do not add Harness credentials to the storage request. The prepare action does not read or upload local files.
  1273. After a successful upload, explicitly deploy:
  1274. ```json
  1275. {
  1276. "resource_type": "vibe_project",
  1277. "action": "deploy",
  1278. "resource_id": "<projectId returned by prepare>"
  1279. }
  1280. ```
  1281. For JSON imports, use the returned `id` instead. Deployment also accepts `body: {"project_id": "<Vibe app id>"}` or `params.app_id`; the API wire field is snake_case `project_id` even though prepare returns camelCase `projectId`. The generic tool's top-level `project_id` is a Harness scope identifier and is never used as the Vibe app id. Import and prepare create the app/source; neither starts deployment. Writes are not automatically retried, and deployment uses the existing high-risk confirmation policy.
  1282. Read progress with `harness_get(resource_type="vibe_app_lifecycle", resource_id="<Vibe app id>")`. It retains app URLs, execution stages, substeps, failures, log lines, and build-analyzer details. The `events` execute action accepts `resource_id` or `params.app_id` and consumes the SSE endpoint as a finite batch: up to 20 JSON events or five seconds after connection, with a 1 MiB response limit. These limits belong to the Vibe endpoint. The connection's `HARNESS_API_TIMEOUT_MS` also bounds connection and stream consumption together; expiration returns a timeout error. A completed batch returns `events` and `stop_reason` (`end`, `event_limit`, or `duration_limit`) and closes the stream. Neither initial connection failures nor broken streams are retried. Events are transient diffs with no documented replay cursor; use lifecycle get for an authoritative snapshot. Both lifecycle reads are available in read-only mode.
  1283. ### Feature Flags
  1284. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1285. | ----------------------------------- | ---- | --- | ------ | ------ | ------ | ----------------------------------------- |
  1286. | `fme_workspace` | x | | | | | |
  1287. | `fme_environment` | x | x | x | x | x | |
  1288. | `fme_feature_flag` | x | x | x | x | x | `kill`, `restore`, `reallocate`, `archive`, `unarchive` |
  1289. | `fme_feature_flag_definition` | x | x | x | x | x | `kill`, `restore`, `reallocate` |
  1290. | `fme_rollout_status` | x | | | | | |
  1291. | `fme_rule_based_segment` | x | x | x | | x | |
  1292. | `fme_rule_based_segment_definition` | x | | | x | | `enable`, `disable`, `change_request` |
  1293. | `fme_traffic_type` | x | | | | | |
  1294. | `fme_identity` | | | x | x | | |
  1295. | `fme_standard_segment` | x | x | | | | |
  1296. | `fme_segment_keys` | x | | | x | | |
  1297. | `fme_segment` | x | x | x | x | x | |
  1298. | `fme_segment_definition` | x | x | x | x | x | `list_keys`, `add_keys`, `remove_keys` |
  1299. | `fme_metric` | x | x | x | x | x | |
  1300. | `fme_event_type` | x | x | | | | |
  1301. | `fme_experiment` | x | x | x | x | x | |
  1302. | `fme_experiment_settings` | | x | | x | x | |
  1303. | `fme_experiment_alerting` | | x | | x | | |
  1304. | `fme_experiment_result` | x | | | | | |
  1305. **FME (Split.io) resources** — `fme_`* resources support **dual-mode scoping**: legacy calls pass `workspace_id` and hit the Split.io API (`api.split.io`); newer calls pass `org_id`+`project_id` together and hit Harness-native endpoints (standard `HARNESS_API_KEY`/`HARNESS_BASE_URL`, same auth as every other `harness_*` resource) instead. Passing both `workspace_id` and `org_id`/`project_id` on the same call, or mixing `org_id` with `project_id` alone, is an error — pick one mode per call. Every operation below is available in legacy mode, unchanged, unless the resource is marked Harness-native only. Harness-native mode coverage is currently narrower:
  1306. - **`fme_workspace`** — no Harness-native equivalent; legacy-only (used to discover `workspace_id` values).
  1307. - **`fme_environment`** — dual-mode `list` (`workspace_id` or `org_id`+`project_id`). `get`/`create`/`update`/`delete` are Harness-native only (`/fme/api/v4/environments`) — MCP never had a `workspace_id` contract for those ops. Native list uses optional `offset`/`limit` (max 100; `harness_list` `size` maps to `limit`); envelope `{data, limit, offset, totalCount}` is promoted to `items`/`total`. Native create/update use `isProduction` (`production` accepted as an alias). Native update is JSON Merge Patch; `name` and `isProduction` are not clearable. Name max 15 characters.
  1308. - **`fme_feature_flag`** — dual-mode, both branches fully wired. Harness-native (`org_id`+`project_id`): `list`/`get`/`create`/`delete` hit `/fme/api/v4/feature-flags` (body for `create`: `name`, `trafficType`, optional `description`/`tags`/`owners`, per `CreateFeatureFlagRequest`); `update` sends a merge-patch to `/fme/api/v4/feature-flags/{name}`; `archive`/`unarchive` hit `/fme/api/v4/feature-flags/{name}/archive|unarchive` (optional `comment` only — no `title`, per `ArchiveUnarchiveRequest`); `kill`/`restore`/`reallocate` hit `/fme/api/v4/feature-flag-definitions/{name}/kill|restore|reallocate` with `environment_id` as a query param (optional `comment`/`title`, per `FeatureFlagDefinitionActionRequest`).
  1309. - **`fme_feature_flag_definition`** — `get`/`create`/`update` remain dual-mode (`workspace_id` or `org_id`+`project_id`). `list`/`delete`/`kill`/`restore`/`reallocate` are Harness-native only (`org_id`+`project_id`) — MCP never had a `workspace_id` contract for those ops. Native list requires `feature_flag_name` and uses `offset`/`limit` (default 100, max 100); it does not take `environment_id`. Delete and execute require `environment_id`. Kill/restore/reallocate are the same actions as on `fme_feature_flag`. Get/create/update body matches legacy (`treatments`, `defaultTreatment`, `defaultRule`, optional `rules`/`baselineTreatment`/`trafficAllocation`/`comment`), plus optional `title` in Harness-native mode. Native update is JSON Merge Patch.
  1310. - **`fme_rollout_status`** — dual-mode `list`. Pass `org_id`+`project_id` (preferred) or the deprecated `workspace_id`. Native pagination uses `offset`/`limit` (max 100; `harness_list` `size` maps to `limit`); results are promoted to `items`/`total`. Each item has `id`, `name`, and optional `description`.
  1311. - **`fme_rule_based_segment`** — (Deprecated — see `fme_segment`.) Harness-native mode is rejected on every operation (`list`/`get`/`create`/`delete`) — use `fme_segment` instead; this resource supports only the legacy `workspace_id` contract.
  1312. - **`fme_rule_based_segment_definition`** — (Deprecated — see `fme_segment_definition`.) Harness-native mode is rejected on every operation/action (`list`/`update`/`enable`/`disable`/`change_request`) — use `fme_segment_definition` instead (no `enable`/`disable`/`change_request` equivalent there); this resource supports only the legacy `workspace_id`/`environment_id` contract.
  1313. - **`fme_traffic_type`** — dual-mode `list`. Pass `org_id`+`project_id` (preferred) or the deprecated `workspace_id`. Native pagination uses `offset`/`limit` (max 100; `harness_list` `size` maps to `limit`); results are promoted to `items`/`total`. Each item has `id` and `name` (no `displayAttributeId`).
  1314. - **`fme_identity`** — `create`/`update` are not yet implemented if `org_id`+`project_id` are passed together; otherwise proceeds as a normal legacy call.
  1315. - **`fme_standard_segment`** — deprecated. Legacy `workspace_id` still hits Split v2. Harness-native is rejected — use `fme_segment`.
  1316. - **`fme_segment_keys`** — `list`/`update` remain legacy (`workspace_id` / `environment_id`+`segment_name`). Harness-native (`org_id`+`project_id`) is rejected — use `fme_segment_definition` execute `list_keys`/`add_keys`/`remove_keys`.
  1317. - **`fme_segment`** — Native only (`org_id`+`project_id`). CRUD. `list`/`get`/`update`/`delete` require `segment_type`: `STANDARD` | `LARGE` | `RULE_BASED`. Create body: `name`, `trafficType`, `segmentType`; optional `description`, `tags`, `owners`.
  1318. - **`fme_segment_definition`** — Native only. CRUD plus execute `list_keys`/`add_keys`/`remove_keys`. Update is description only. Delete fails with `hasDependents` while keys remain.
  1319. - **`fme_metric`** — Harness-native only (no legacy `workspace_id` support). `list`/`get`/`create`/`update`/`delete` are wired to `/fme/api/v4/metrics` (`list`'s `harness_list` `size` maps to `limit`). `create` requires `spread` even though the backend `CreateMetricRequest` keeps it optional (default `PER`) — an MCP-side-only stricter contract, since omitting it silently changes a `RATE` metric's semantics. `update` is JSON Merge Patch; `name`/`trafficType` are immutable and not accepted. `delete` is a permanent hard delete (no archive/restore) — classified `destructive`.
  1320. - **`fme_event_type`** — Harness-native only (no legacy `workspace_id` support). Read-only: `list`/`get` are wired to `/fme/api/v4/event-types`; `id` is the event name. Only event types with events in the last 30 days are visible; `get` returns a 404 for an event type outside the requesting workspace's traffic-type scope, or idle longer than 30 days. List filters: `name` (substring), `traffic_type` (by ID or name), `offset`/`limit` (`harness_list` `size` maps to `limit`). Use this to discover real event type IDs before referencing one in `fme_metric`'s `baseEventTypes`/`filterEventType` or `event_type_ids` filter, instead of guessing an ID.
  1321. - **`fme_experiment`** — Harness-native only (no legacy `workspace_id` support). CRUD wired to `/fme/api/v4/experiments`. `list` requires `parent_type` (`FEATURE_FLAG`, `AI_CONFIG`; `CONFIG` returns 404) and defaults to `ACTIVE` experiments unless `status` is passed. `create` requires `environment_id` (query param) plus `parent`/`name`/`startAt`/`endAt`/`baselineTreatment`/`comparisonTreatments` in the body; the parent must exist in that environment. `update` is JSON Merge Patch; `parent` and `environment` cannot be changed. `delete` is a permanent hard delete — classified `destructive`. Optional `owners` on create/update: each entry is `{type: "USER", id or email}` or `{type: "GROUP", identifier}`. Optional `rule` (targeting-rule label results are scoped to; create defaults to `"default"` when omitted, update `null` clears it) and `tags` (`[{name}]`; update replaces the list, `null`/`[]` clears) on create/update. `list` accepts a `tags` array filter (experiments with any of the tag names); items include `tags` and `rule`.
  1322. - **`fme_experiment_settings`** — Statistical & monitoring settings for a single experiment (test type, significance threshold, multiple comparison correction, minimum sample size, review period, variance reduction). `get`/`update`/`delete` only — 1:1 with the experiment, no `list`. `get` always returns applied settings (own override or organization defaults) and never 404s except when the experiment itself doesn't exist. `update` is JSON Merge Patch and implicitly creates the experiment-level override. `delete` reverts to organization defaults (idempotent) — classified `destructive` even though it's non-permanent.
  1323. - **`fme_experiment_alerting`** — Whether a single experiment is subscribed to significance-regression alerting. `get`/`update` only. `get` returns `{id, isEnabled}` and reports `isEnabled: false` when no alert policy exists; it only 404s when the experiment itself doesn't exist. `update` is JSON Merge Patch with a required `isEnabled` boolean.
  1324. - **`fme_experiment_result`** — Evaluated per-metric results for an experiment's latest calculation run. `list` only (no `get` — results have no identifier of their own). One row per (metric, comparison treatment) pair across all metric categories. Optional filters: `metric_ids`, `comparisons`. Reflects only the latest run — no historical access.
  1325. In single-user/self-hosted mode, legacy-mode auth uses a Bearer token from `HARNESS_FME_API_KEY`, falling back to a non-placeholder `HARNESS_API_KEY`. `HARNESS_FME_API_KEY` may be a legacy Split admin key or an FME-entitled Harness PAT/SAT, but it is rejected in `multi-user` mode so shared deployments cannot override each session user's credential. Hosted OAuth/service-routing credentials for Harness platform APIs do not authenticate direct Split.io requests. `fme_feature_flag` supports full lifecycle management in legacy mode: create (requires `traffic_type_id`), list, get, update metadata, delete, and kill/restore/reallocate/archive/unarchive execute actions. Use `fme_traffic_type` to discover traffic type IDs, `fme_identity` to create/update identity attributes, and `fme_standard_segment` / `fme_segment_keys` to inspect standard segments and add member keys. `fme_rule_based_segment` provides CRUD for targeting segments, while `fme_rule_based_segment_definition` manages environment-specific segment rules with enable/disable and change request approval flows.
  1326. ### GitOps
  1327. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1328. | ---------------------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1329. | `gitops_agent` | x | x | | | | |
  1330. | `gitops_agent_metrics` | x | | | | | |
  1331. | `gitops_argo_project` | x | | | | | |
  1332. | `gitops_app_project_mapping` | x | | x | x | x | `import` |
  1333. | `gitops_autocreate_log` | x | | | | | |
  1334. | `gitops_application` | x | x | | | | `sync` |
  1335. | `gitops_cluster` | x | x | | | | |
  1336. | `gitops_repository` | x | x | | | | |
  1337. | `gitops_applicationset` | x | x | | | | |
  1338. | `gitops_repo_credential` | x | x | | | | |
  1339. | `gitops_app_event` | x | | | | | |
  1340. | `gitops_pod_log` | | x | | | | |
  1341. | `gitops_managed_resource` | x | | | | | |
  1342. | `gitops_resource_action` | x | | | | | |
  1343. | `gitops_dashboard` | | x | | | | |
  1344. | `gitops_app_resource_tree` | | x | | | | |
  1345. | `gitops_cluster_link` | x | | x | | x | |
  1346. ### Chaos Engineering
  1347. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1348. |----------------------------------| ---- | --- | ------ | ------ | ------ |------------------------------------------------------------------------------|
  1349. | `chaos_experiment` | x | x | x | x | x | `run`, `stop`, `list_metadata`, `update_cron` |
  1350. | `chaos_experiment_run` | | x | | | | |
  1351. | `chaos_experiment_variable` | x | | | | | |
  1352. | `chaos_component_variable` | | x | | | | |
  1353. | `chaos_input_set` | x | x | x | x | x | |
  1354. | `chaos_experiment_template` | x | x | x | x | x | `create_from_template`, `list_revisions`, `get_variables`, `get_yaml`, `compare_revisions` |
  1355. | `chaos_probe` | x | x | x | | x | `list_metadata`, `enable`, `verify`, `get_manifest` |
  1356. | `chaos_probe_in_run` | x | | | | | |
  1357. | `chaos_probe_template` | x | x | x | x | x | `get_variables` |
  1358. | `chaos_infrastructure` | x | x | x | x | x | |
  1359. | `chaos_k8s_infrastructure` | x | x | x | x | x | `check_health`, `get_yaml`, `get_manifest`, `helm_command` |
  1360. | `chaos_enabled_infrastructure` | x | | | | | |
  1361. | `chaos_environment` | x | | | | | |
  1362. | `chaos_hub` | x | x | x | x | x | `list_metadata` |
  1363. | `chaos_hub_fault` | x | | | | | |
  1364. | `chaos_fault` | x | x | | | x | `list_metadata`, `get_variables`, `get_yaml` |
  1365. | `chaos_fault_template` | x | x | x | x | x | `list_revisions`, `get_variables`, `get_yaml`, `compare_revisions` |
  1366. | `chaos_fault_experiment_run` | x | | | | | |
  1367. | `chaos_action` | x | x | x | x | x | `list_metadata`, `get_manifest` |
  1368. | `chaos_action_template` | x | x | x | x | x | `list_revisions`, `get_variables`, `compare_revisions` |
  1369. | `chaos_loadtest` | x | x | x | x | x | `run`, `stop`, `estimate_workers`, `convert_har` |
  1370. | `chaos_loadtest_run` | x | x | | | | `status`, `live_metrics`, `ai_insights`, `generate_ai_insights` |
  1371. | `chaos_service` | x | x | x | x | x | `list_experiment_runs`, `list_load_tests` |
  1372. | `custom_service` | x | x | x | x | | |
  1373. | `chaos_application_map` | x | x | | | x | |
  1374. | `discovered_agent` | x | | | | | |
  1375. | `discovered_namespace` | x | | | | | |
  1376. | `discovered_service` | x | | | | | |
  1377. | `discovered_network_map` | x | | | | | |
  1378. | `chaos_guard_condition` | x | x | x | x | x | |
  1379. | `chaos_guard_rule` | x | x | x | x | x | `enable` |
  1380. | `chaos_recommendation` | x | x | | | | |
  1381. | `chaos_onboarding` | x | x | x | | x | `stats`, `confirm_discovery`, `onboard_services`, `confirm_service_onboarding`, `trigger_risk_scan`, `risk_scan`, `confirm_risk_scan`, `list_services`, `confirm_network_map`, `confirm_experiment_creation`, `confirm_experiment_run`, `skip`, `stop` |
  1382. | `chaos_pipeline_onboarding` | x | x | x | | x | `can_onboard` |
  1383. | `chaos_risk` | x | x | | | | |
  1384. | `chaos_dr_test` | x | | x | | | |
  1385. | `scanned_risk` | x | x | | | | `occurrences`, `summary_by_service` |
  1386. | `chaos_risk_rule` | x | x | x | x | x | |
  1387. | `chaos_risk_scan` | x | x | x | x | x | `retry`, `abort`, `report`, `report_download`, `heatmap`, `submit_findings` |
  1388. | `chaos_dashboard` | x | x | | x | | |
  1389. | `chaos_image_registry` | | x | x | x | | `resolve` |
  1390. ### Cloud Cost Management (CCM)
  1391. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1392. | ---------------------------- | ---- | --- | ------ | ------ | ------ | ------------------------------------------------------------------------------ |
  1393. | `cost_perspective` | x | x | x | x | x | |
  1394. | `cost_breakdown` | x | | | | | |
  1395. | `cost_timeseries` | x | | | | | |
  1396. | `cost_summary` | x | x | | | | |
  1397. | `cost_recommendation` | x | x | | | | `update_state`, `override_savings`, `create_jira_ticket`, `create_snow_ticket` |
  1398. | `cost_anomaly` | x | | | | | |
  1399. | `cost_anomaly_summary` | | x | | | | |
  1400. | `cost_category` | x | x | | | | |
  1401. | `cost_account_overview` | | x | | | | |
  1402. | `cost_filter_value` | x | | | | | |
  1403. | `cost_recommendation_stats` | | x | | | | |
  1404. | `cost_recommendation_detail` | | x | | | | |
  1405. | `cost_commitment` | | x | | | | |
  1406. | `ai_budget` | x | x | x | x | x | |
  1407. | `ai_budget_overview` | | x | | | | |
  1408. | `ai_budget_consumption` | x | | | | | |
  1409. | `ai_budget_override_request` | x | x | x | | | `approve`, `reject` |
  1410. ### Software Engineering Insights (SEI)
  1411. SEI resources are consolidated for token efficiency. Use `metric` or `aspect` params for DORA, team/org-tree details, and AI insights.
  1412. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1413. | ------------------------- | ---- | --- | ------ | ------ | ------ | -------------------------------------------------------------------------------------------------------- |
  1414. | `sei_metric` | x | | | | | |
  1415. | `sei_productivity_metric` | | x | | | | |
  1416. | `sei_dora_metric` | | x | | | | Pass `metric`: deployment_frequency, change_failure_rate, mttr, lead_time, or *_drilldown |
  1417. | `sei_team` | x | x | | | | |
  1418. | `sei_team_detail` | x | | | | | Pass `aspect`: integrations, developers, integration_filters |
  1419. | `sei_org_tree` | x | x | | | | |
  1420. | `sei_org_tree_detail` | x | x | | | | Pass `aspect`: efficiency_profile, productivity_profile, business_alignment_profile, integrations, teams |
  1421. | `sei_business_alignment` | x | x | | | | Pass `aspect`: feature_metrics, feature_summary, drilldown for get |
  1422. | `sei_ai_usage` | x | x | | | | Pass `aspect`: metrics, breakdown, summary, top_languages |
  1423. | `sei_ai_adoption` | x | x | | | | Pass `aspect`: metrics, breakdown, summary |
  1424. | `sei_ai_impact` | | x | | | | Pass `aspect`: pr_velocity, rework |
  1425. | `sei_ai_raw_metric` | x | | | | | |
  1426. ### Software Supply Chain Assurance (SCS)
  1427. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1428. | -------------------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1429. | `scs_artifact_source` | x | | | | | |
  1430. | `artifact_security` | x | x | | | | |
  1431. | `scs_artifact_component` | x | | | | | |
  1432. | `scs_artifact_remediation` | | x | | | | |
  1433. | `scs_chain_of_custody` | | x | | | | |
  1434. | `scs_compliance_result` | x | | | | | |
  1435. | `code_repo_security` | x | x | | | | |
  1436. | `scs_sbom` | | x | | | | |
  1437. ### Evidence Vault
  1438. Evidence Vault stores in-toto attestations (SDLC evidences). List supports account/org/project scope via `resource_scope`. Singular free-text filters (pipeline, artifact alone, gitoid) use `search_term`; an additional Name constraint uses `filters.subject_name`; subject content digest uses `filters.subject_digest`. Get looks up by `gitoid_sha256` and requires `org_id`/`project_id` (from the list row). Download (`harness_execute` action `download`) returns a time-limited `download_url` — always show that link to the user. Requires feature flag `SCS_EVIDENCE_VAULT`.
  1439. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1440. | ------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1441. | `attestation` | x | x | | | | `download` |
  1442. ### Security Testing Orchestration (STO)
  1443. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1444. | ------------------------- | ---- | --- | ------ | ------ | ------ | ------------------------------ |
  1445. | `security_issue` | x | | | | | |
  1446. | `security_issue_filter` | x | | | | | |
  1447. | `security_exemption` | x | | x | | | `approve`, `reject` |
  1448. | `remediation_diff` | x | | | | | |
  1449. `security_exemption` create is a `high_write` operation. The server derives `requester_id` from the authenticated PAT, sets `exemptFutureOccurrences=true`, and defaults `duration_days` to 30 when not provided. For listing exemptions, pass a small explicit page size (for example `filters: { "status": "Pending", "size": 5 }`) and follow the `_nextPageHint` returned in each response.
  1450. Security exemption execute workflow:
  1451. - Use `harness_list` with `resource_type="security_exemption"` and an explicit `status` such as `Pending`, `Approved`, `Rejected`, `Expired`, or `Canceled`.
  1452. - Use `harness_execute` with `action="approve"` and a required `body.scope`: `CURRENT`, `ACCOUNT`, `ORG`, or `PROJECT`. `CURRENT` approves at the exemption's existing scope; the other scopes use the STO promote endpoint internally. The server auto-fills `body.approver_id` from the authenticated user when omitted; `body.comment` is optional.
  1453. - Use `action="reject"` to reject an exemption. `body.approver_id` is also auto-filled when omitted.
  1454. - There is no separate `promote` execute action. Use `action="approve"` with a non-`CURRENT` `body.scope` when the requested outcome is approval at account, organization, or project scope.
  1455. ### Access Control
  1456. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1457. | ----------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1458. | `user` | x | x | | | | |
  1459. | `user_group` | x | x | x | x | x | |
  1460. | `service_account` | x | x | x | | x | |
  1461. | `role` | x | x | x | | x | |
  1462. | `role_assignment` | x | | x | | | |
  1463. | `resource_group` | x | x | x | | x | |
  1464. | `permission` | x | | | | | |
  1465. ### Governance
  1466. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1467. | ------------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1468. | `policy` | x | x | x | x | x | |
  1469. | `policy_set` | x | x | x | x | x | |
  1470. | `policy_evaluation` | x | x | | | | |
  1471. ### Deployment Freeze
  1472. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1473. | --------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1474. | `freeze_window` | x | x | x | x | x | `toggle_status` |
  1475. | `global_freeze` | | x | | | | `manage` |
  1476. ### Service Overrides
  1477. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1478. | ------------------ | ---- | --- | ------ | ------ | ------ | --------------- |
  1479. | `service_override` | x | x | x | x | x | |
  1480. ### Settings
  1481. | Resource Type | List | Get | Create | Update | Delete | Execute Actions |
  1482. | ------------- | ---- | --- | ------ | ------ | ------ | --------------- |
  1483. | `setting` | x | | | | | |
  1484. ## MCP Prompts
  1485. ### DevOps
  1486. | Prompt | Description | Parameters |
  1487. | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
  1488. | `build-deploy-app` | End-to-end CI/CD workflow: scan a git repo, generate CI pipeline (build & push Docker image), discover or generate K8s manifests, create CD pipeline, and deploy — with auto-retry on CI failures (up to 5 attempts) and CD failures (up to 3 attempts with user permission). On exhausted retries, provides Harness UI deep links to all created resources for manual investigation. | `repoUrl` (required), `imageName` (required), `projectId` (optional), `namespace` (optional) |
  1489. | `debug-pipeline-failure` | Analyze a failed execution: accepts an execution ID, pipeline ID, or Harness URL. Gets stage/step breakdown, failure details, delegate info, and failed step logs via `harness_diagnose`, then provides root cause analysis and suggested fixes. Automatically follows chained pipeline failures. | `executionId` (optional), `projectId` (optional) |
  1490. | `pipeline_summarizer` | Fetch and summarize ALL step logs from a pipeline execution. Uses `harness_diagnose` with `include_logs: true, include_all_step_logs: true` to get every step's log, then presents a table with Step Name, Status, Duration, and What Happened (log-based summary). Does NOT skip any steps. | `executionId` (optional), `projectId` (optional) |
  1491. | `create-pipeline` | Generate a new pipeline YAML from natural language requirements, reviewing existing resources for context | `description` (required), `projectId` (optional) |
  1492. | `create-agent` | Interactively build a Harness AI agent — check existing agents (detecting current `agent.uses` vs. legacy `agent.step.group.steps` spec format when updating), gather requirements, generate the agent spec in the appropriate format, confirm with user, then create or update via `harness_create`/`harness_update` | `agent_name` (required), `task_description` (required), `org_id` (optional), `project_id` (optional) |
  1493. | `onboard-service` | Walk through onboarding a new service with environments and a deployment pipeline | `serviceName` (required), `projectId` (optional) |
  1494. | `dora-metrics-review` | Review DORA metrics (deployment frequency, change failure rate, MTTR, lead time) with Elite/High/Medium/Low classification and improvement recommendations | `teamRefId` (optional), `dateStart` (optional), `dateEnd` (optional) |
  1495. | `setup-gitops-application` | Guide through onboarding a GitOps application — verify agent, cluster, repo, and create the application | `agentId` (required), `projectId` (optional) |
  1496. | `chaos-resilience-test` | Design a chaos experiment to test service resilience with fault injection, probes, and expected outcomes | `serviceName` (required), `projectId` (optional) |
  1497. | `feature-flag-rollout` | Plan and execute a progressive feature flag rollout across environments with safety gates | `flagIdentifier` (required), `projectId` (optional) |
  1498. | `migrate-pipeline-to-template` | Analyze an existing pipeline and extract reusable stage/step templates from it | `pipelineId` (required), `projectId` (optional) |
  1499. | `delegate-health-check` | Check delegate connectivity, health, token status, and troubleshoot infrastructure issues | `projectId` (optional) |
  1500. | `developer-portal-scorecard` | Review IDP scorecards for services and identify gaps to improve developer experience | `projectId` (optional) |
  1501. | `pending-approvals` | Find pipeline executions waiting for approval, show details, and offer to approve or reject | `projectId` (optional), `orgId` (optional), `pipelineId` (optional) |
  1502. ### FinOps
  1503. | Prompt | Description | Parameters |
  1504. | ------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |

Lines 2,001–2,478 are not shown. The link to the file on GitHub has every line.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.