SuperAPIAI Directory

mcp-server

github.com · AI developer platforms

Access and interact with Harness platform data, including pipelines, repositories, logs, and artifact registries.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux · API

About this tool

Purpose

Harness MCP Server is the official MCP (Model Context Protocol) server provided by Harness, used to give AI agents full access to the Harness.io platform. It is aimed at scenarios where AI agents need to operate on Harness platform data and resources, such as querying pipelines, repositories, logs, artifact repositories, and performing create, update, and other operations.

Main Capabilities

  • 11 tools, 261 resource types: Uses a registry-based dispatch system to route tools such as harness_list, harness_get, harness_create to any Harness resource, including pipelines, services, environments, organizations, projects, feature flags, cost data, etc. The LLM only needs to choose from 11 tools instead of hundreds.
  • Complete platform coverage: 42 default toolsets covering 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 coverage, knowledge graph, etc. Ansible and observability assessment coverage can be enabled as needed.
  • Multi-project workflows: Agents can dynamically discover organizations and projects without hardcoding environment variables. For example, they can ask "show failed executions across all projects," and the agent can navigate the full account hierarchy.
  • 35 prompt templates: Provides preset prompts for common workflows, such as end-to-end building and deploying applications, debugging failed pipelines, reviewing DORA metrics, triaging vulnerabilities, optimizing cloud costs, auditing access control, planning feature flag releases, reviewing pull requests, approving pending pipelines, etc.
  • Multi-environment support: Local clients (Claude Desktop, Cursor, Devin Desktop) use stdio transport; remote/shared deployments use HTTP transport; Docker and Kubernetes are supported.
  • Zero-configuration startup: Only a Harness API key is required. The account ID can be automatically extracted from PAT and SAT tokens, organization/project defaults are optional, and toolset filtering can expose only what is needed.
  • Extensible design: Adding a new Harness resource only requires adding a declarative data file, with no new tool registration, schema changes, or prompt updates.

Usage

Prerequisites

A Harness API key is required: log in to your Harness account, go to My Profile → API Keys → + New API Key, create a new Token under the API key, generate a PAT or SAT in the format <prefix>.<accountId>.<tokenId>.<secret>, and save it securely.

Installation Options

  • Option 0: Hosted Harness MCP: If the hosted MCP service is enabled for the account, clients that support remote MCP servers can connect directly to the hosted endpoint. Hosted MCP uses Harness Platform OAuth instead of HARNESS_API_KEY, and must be enabled/configured per account by Harness Support.
  • Option 1: npx (recommended): No installation required, run directly. The account ID is automatically extracted from PAT and SAT tokens; HARNESS_ACCOUNT_ID is only needed when the API key does not contain an account segment.
  • Option 2: Global installation: Install harness-mcp-v2 globally via npm.
  • Option 3: Build from source: For development or customization.

Transport Modes

stdio is used by default; http is used for remote/shared deployments. HTTP mode is session-based: a new MCP session is created on initialize, the server returns an mcp-session-id header, and subsequent requests must include the same header. Operational constraints in HTTP mode include: shared or remotely reachable single-user/multi-user deployments must set HARNESS_MCP_AUTH_TOKEN; non-loopback bindings require this token by default; POST /mcp without mcp-session-id must be an initialize request; GET /mcp is used for SSE notifications; idle sessions are reclaimed after MCP_SESSION_TTL_MS milliseconds (default 1800000, i.e. 30 minutes); GET /health is the only non-MCP endpoint; request body size is limited by HARNESS_MAX_BODY_SIZE_MB (default 10 MB).

Authentication Modes

  • OAuth mode: Set HARNESS_MCP_MODE=oauth to let remote MCP clients discover HarnessID and complete OAuth 2.1 authorization code + PKCE. Only available for HTTP transport. HARNESS_API_KEY must not be set in this mode.
  • OAuth proxy mode: Set HARNESS_MCP_MODE=oauth-proxy, suitable for scenarios where the MCP client only holds an upstream identity provider token. Requires a confidential HarnessID client, with the client ID and secret created and provided by the Harness ID team. Only available for HTTP.
  • Multi-user mode: Set HARNESS_MCP_MODE=multi-user for shared HTTP deployments, where each client authenticates as a different Harness user. HARNESS_API_KEY must not be set in this mode, and each session must provide x-harness-api-key in the initialize request.

Client Configuration

HARNESS_ORG and HARNESS_PROJECT are optional and are used to set the organization ID and project ID used when not specified in a tool call. Agents can dynamically discover organizations and projects via harness_list(resource_type="organization") and harness_list(resource_type="project"). The deprecated HARNESS_DEFAULT_ORG_ID and HARNESS_DEFAULT_PROJECT_ID remain backward compatible.

Hosted MCP endpoint https://mcp.harness.io/mcp is a hosted service, and client-side MCP configuration cannot override the Harness environment it routes to. For Harness0 or other private Harness SaaS environments, you need to contact Harness Support to enable/configure hosted MCP, or run a local/self-hosted server and set HARNESS_BASE_URL to point to the target Harness host.

Troubleshooting

npx ENOENT or node: No such file or directory is a client process startup failure, not a Harness authentication failure. GUI applications (Cursor, Claude Desktop, Devin Desktop, VS Code) do not always inherit the shell's PATH and may not find npx or node. The solution is to use absolute paths and explicitly set PATH in the env block.

Use Cases

  • Let AI agents query and operate resources in the Harness platform such as pipelines, services, environments, organizations, projects, feature flags, cost data, and more.
  • Dynamically discover organizations and projects in multi-project workflows.
  • Use preset prompt templates to complete common tasks such as build and deployment, debugging, metrics review, vulnerability triage, cost optimization, and access control auditing.
  • Local clients, remote shared deployments, Docker/Kubernetes environments.
  • Compatible with MCP Gateways, and can be placed behind a reverse proxy that provides centralized authentication, governance, tool routing, and observability.

Limitations

  • The hosted MCP service requires Harness Support to enable/configure it per account, and it uses Harness Platform OAuth, not HARNESS_API_KEY.
  • The OAuth proxy mode requires the Harness ID team to create a confidential client and provide credentials.
  • In multi-user mode, the server does not hold Harness credentials; each session must provide an API key.
  • In HTTP mode, non-loopback binding requires HARNESS_MCP_AUTH_TOKEN by default, unless HARNESS_MCP_ALLOW_UNAUTHENTICATED_HTTP=true is explicitly set.
  • The default request body size limit is 10 MB, and idle sessions are reclaimed after 30 minutes by default.
  • Specific charges, pricing, platform supportscope, etc. are not provided in the materials.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools