Lets AI agents list, read, create, and manage Harness pipelines, services, environments, feature flags, and cloud cost data through 11 tools.
Also known as harness/mcp-server, harness-mcp-v2
- Stars
- 114
- Tools
- 12
- Downloads, 30 days
- 25,539
- Latest version
- —
- Last commit
- Nov 14, 2026
- License
- MIT
What is Harness MCP?
Harness lets AI agents list, read, create, and manage Harness pipelines, services, environments, feature flags, and cloud cost data through 11 tools. It exposes 12 tools, such as resource_scope, harness_describe, harness_schema.
Summary generated from the project's README
About Harness MCP server
Managing complex software delivery lifecycles through AI agents is possible with this MCP server, which provides a direct interface to the Harness.io platform. Instead of exposing hundreds of individual endpoints that can confuse large language models, this server uses a registry-based dispatch system to consolidate access into 11 specialized tools. These tools allow agents to interact with 274 different resource types, including pipelines, services, environments, feature flags, and cloud cost data.
Developers can run this server locally using stdio transport for clients like Claude Desktop or Cursor, or deploy it remotely via HTTP transport for shared environments. Setup is straightforward, requiring only a Harness API key to begin, as the system can automatically extract account information from your tokens. It supports diverse workflows across CI/CD, GitOps, security testing, and chaos engineering, making it a versatile bridge between AI reasoning and platform automation.
What you can do with it
- 1Debug failed deployment pipelinesAn AI agent can investigate why a specific deployment failed by navigating the Harness hierarchy.
Written from the project's README. Every use case is checked against a quote from it.
How to install Harness MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall Harness MCP in Claude Code
$ claude mcp add mcp-server -- npx -y harness-mcp-v2Install Harness MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"mcp-server": {
"command": "npx",
"args": [
"-y",
"harness-mcp-v2"
]
}
}
}Install Harness MCP in VS Code
.vscode/mcp.json
{
"servers": {
"mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"harness-mcp-v2"
]
}
}
}Install Harness MCP in VS Code CLI
$ code --add-mcp '{"name":"mcp-server","type":"stdio","command":"npx","args":["-y","harness-mcp-v2"]}'Install Harness MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"mcp-server": {
"command": "npx",
"args": [
"-y",
"harness-mcp-v2"
]
}
}
}Install Harness MCP in Codex
$ codex mcp add mcp-server -- npx -y harness-mcp-v2Install Harness MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.mcp-server] command = "npx" args = ["-y", "harness-mcp-v2"]
Install Harness MCP in Gemini CLI
$ gemini mcp add -s user mcp-server npx -- -y harness-mcp-v2Install Harness MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"mcp-server": {
"command": "npx",
"args": [
"-y",
"harness-mcp-v2"
]
}
}
}Needs a key before it starts
Started on 16 Nov 2026 with no keys, it stopped and asked for one, so a client sees no tools until you set the variables above.
Harness MCP tools 12
Detected from the READMEresource_scopeharness_describeharness_schemaharness_listharness_getharness_createharness_updateharness_deleteharness_executeharness_searchharness_diagnoseharness_status
Configuration
CLIENT_IDHARNESS_API_KEYHARNESS_AUTO_APPROVE_RISKHARNESS_MCP_MODEHARNESS_SEARCH_PROVIDERHARNESS_SEARCH_SERVICE_HEADERSHARNESS_SEARCH_SERVICE_URLHARNESS_TOOLSETS
Automated checks
Ran Nov 12, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packagePass
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledPass
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesNot checked
README
View on GitHubHarness MCP Server 2.0
An MCP (Model Context Protocol) server that gives AI agents full access to the Harness.io platform through 11 consolidated tools and 273 resource types.
Why Use This MCP Server
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.
This server is built differently:
- 11 tools, 273 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. - 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.
- 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.
- 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.
- Works everywhere. Stdio transport for local clients (Claude Desktop, Cursor, Devin Desktop), HTTP transport for remote/shared deployments, Docker and Kubernetes ready.
- 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.
- Extensible by design. Adding a new Harness resource means adding a declarative data file — no new tool registration, no schema changes, no prompt updates.
Prerequisites
Before installing or running the server, you need a Harness API key:
- Log in to your Harness account
- Go to My Profile → API Keys → + New API Key
- Create a new Token under the API key — this generates a PAT or SAT in the format
<prefix>.<accountId>.<tokenId>.<secret> - Save the token somewhere secure — you'll need it in the next step
For detailed instructions, see the Harness API Quickstart.
Quick Start
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 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 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>...orsat.<accountId>...), soHARNESS_ACCOUNT_IDis 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 in oauth and oauth-proxy modes |
/.well-known/oauth-protected-resource/mcp |
GET |
Path-aware RFC 9728 metadata for the default /mcp resource |
/.well-known/oauth-authorization-server |
GET |
Embedded broker RFC 8414 metadata in oauth-proxy mode |
/oauth/authorize |
GET |
Start MCP client login through the upstream provider and HarnessID |
/oauth/upstream/callback |
GET |
Upstream identity-provider callback |
/oauth/harnessid/callback |
GET |
HarnessID login callback |
/oauth/token |
POST |
Return or refresh upstream tokens for the MCP client; never returns HarnessID tokens |
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.
Operational constraints in HTTP mode:
- Set
HARNESS_MCP_AUTH_TOKENfor shared or remotely reachable single-user and multi-user deployments. When set, everyPOST,GET, andDELETErequest to/mcpmust includeAuthorization: Bearer <token>. - OAuth mode accepts HarnessID access tokens instead of
HARNESS_MCP_AUTH_TOKENand can bind to a non-loopback address without the unauthenticated opt-out. - 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.
- Non-loopback single-user and multi-user binds require
HARNESS_MCP_AUTH_TOKENby default. To run unauthenticated on a non-loopback interface anyway, setHARNESS_MCP_ALLOW_UNAUTHENTICATED_HTTP=trueexplicitly. POST /mcpwithoutmcp-session-idmust be aninitializerequest.POST /mcp,GET /mcp, andDELETE /mcpfor existing sessions require themcp-session-idheader.GET /mcpis used for SSE notifications (progress updates and elicitation prompts).- Idle sessions are reaped after
MCP_SESSION_TTL_MSmilliseconds once no request or SSE stream is active (default1800000, or 30 minutes). GET /healthis the only non-MCP endpoint.- Request body size is capped by
HARNESS_MAX_BODY_SIZE_MB(default10MB). - Set
x-harness-pipeline-version: 0or1on theinitializerequest to select V0 or V1 pipeline resources for that HTTP session. - Set
x-harness-auto-approve-risk: none|low_write|medium_write|high_write|allon theinitializerequest to choose a stricter per-session auto-approval threshold. The server caps this value at the deployment-levelHARNESS_AUTO_APPROVE_RISK, so a session can reduce but not expand the configured approval ceiling.
HarnessID OAuth Mode
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:
HARNESS_MCP_MODE=oauth
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.
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).
The server publishes RFC 9728 protected-resource metadata and returns this challenge when a client has not authenticated:
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer resource_metadata="https://mcp.harness.io/.well-known/oauth-protected-resource/mcp"
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.
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.
Clients normally need only the MCP resource URL:
{
"mcpServers": {
"harness": {
"url": "https://mcp.harness.io/mcp"
}
}
}
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.
See HarnessID OAuth for a self-hosted MCP server for the QA Keycloak checklist and validation commands.
Upstream Identity Provider OAuth Proxy Mode
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.
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.
This mode is HTTP-only. It also needs the upstream issuer and audience, and a stable 32-byte vault key. See Upstream identity provider OAuth proxy mode for configuration and end-to-end MCP test commands.
Multi-User Mode
Set HARNESS_MCP_MODE=multi-user for shared HTTP deployments where each client authenticates as a different Harness user. In this mode:
HARNESS_API_KEYmust not be set in the server config — the server holds no Harness credentials.- Each session must provide
x-harness-api-keyon theinitializerequest.x-harness-account-idis required only when the API key does not embed an account segment. - Sessions may also provide
x-harness-organdx-harness-projectheaders to set default scope for that session. - If the opt-in
appsectoolset (HARNESS_TOOLSETS=+appsec) is enabled, sessions that callappsec_*resources must also providex-harness-appsec-api-keyon theinitializerequest (the session'sx-harness-api-keyis never forwarded toapi.traceable.ai). - The Harness API key flows through to every Harness API call for that session, so the audit trail in Harness reflects the real user.
HARNESS_MCP_AUTH_TOKENis independent and can still be used as an additional transport-layer gate.
# Health check
curl http://localhost:3000/health
# MCP initialize request (capture mcp-session-id response header)
# In multi-user mode, x-harness-api-key is required on initialize.
# x-harness-account-id is needed only for API keys without an embedded account segment.
curl -i -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Authorization: Bearer $HARNESS_MCP_AUTH_TOKEN" \
-H "x-harness-api-key: $HARNESS_API_KEY" \
-H "x-harness-account-id: $HARNESS_ACCOUNT_ID" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'
# Subsequent MCP request (use returned session ID)
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Authorization: Bearer $HARNESS_MCP_AUTH_TOKEN" \
-H "mcp-session-id: <session-id>" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
# Terminate session
curl -X DELETE http://localhost:3000/mcp \
-H "Authorization: Bearer $HARNESS_MCP_AUTH_TOKEN" \
-H "mcp-session-id: <session-id>"
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.
Client Configuration
Note:
HARNESS_ORGandHARNESS_PROJECTare optional. They set the org ID and project ID used when not specified per tool call. Agents can discover orgs and projects dynamically usingharness_list(resource_type="organization")andharness_list(resource_type="project"). The deprecated namesHARNESS_DEFAULT_ORG_IDandHARNESS_DEFAULT_PROJECT_IDare still accepted for backward compatibility.
Hosted Harness MCP
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.
Important: Hosted MCP authentication uses Harness Platform OAuth. It does not use
HARNESS_API_KEYin 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.The hosted endpoint
https://mcp.harness.io/mcpis 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 setHARNESS_BASE_URLto the target Harness host.
Hosted MCP example:
{
"mcpServers": {
"harness-prod1-mcp": {
"url": "https://mcp.harness.io/mcp",
"auth": {
"CLIENT_ID": "mcp-client"
}
}
}
}
Example with both hosted and local entries:
{
"mcpServers": {
"harness-hosted": {
"url": "https://mcp.harness.io/mcp",
"auth": {
"CLIENT_ID": "mcp-client"
}
},
"harness-local": {
"command": "/absolute/path/to/npx",
"args": ["-y", "harness-mcp-v2@latest"],
"env": {
"HARNESS_API_KEY": "pat.xxx.xxx.xxx",
"PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
}
}
}
}
Troubleshooting
npx ENOENTornode: No such file or directoryThis is a client process-launch failure, not a Harness authentication failure. The MCP server has not started yet, so changing
HARNESS_API_KEYwill not affectspawn npx ENOENT.GUI apps (Cursor, Claude Desktop, Devin Desktop, VS Code) don't always inherit your shell's
PATH, so they can fail to findnpxornodeafter a config reload. Fix this by using absolute paths and explicitly settingPATHin theenvblock:{ "mcpServers": { "harness": { "command": "/absolute/path/to/npx", "args": ["-y", "harness-mcp-v2"], "env": { "HARNESS_API_KEY": "pat.xxx.xxx.xxx", "PATH": "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin" } } } }Find your paths with
which npxandwhich nodein a terminal, then make sure the directory containingnodeis included in thePATHvalue above. Common locations:
- Homebrew (macOS):
/opt/homebrew/bin/npx- nvm:
~/.nvm/versions/node/v20.x.x/bin/npx(runnvm which currentto find the exact path)- System Node:
/usr/local/bin/npx
Claude Desktop (claude_desktop_config.json)
npx (zero install)
{
"mcpServers": {
"harness": {
"command": "/absolute/path/to/npx",
"args": ["-y", "harness-mcp-v2@latest"],
"env": {
"HARNESS_API_KEY": "pat.xxx.xxx.xxx",
"PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
}
}
}
}
node (local install)
npm install -g harness-mcp-v2
{
"mcpServers": {
"harness": {
"command": "/absolute/path/to/harness-mcp-v2",
"env": {
"HARNESS_API_KEY": "pat.xxx.xxx.xxx",
"PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
}
}
}
}
Claude Code (via claude mcp add)
npx (zero install)
claude mcp add harness -- npx harness-mcp-v2
node (local install)
npm install -g harness-mcp-v2
claude mcp add harness -- harness-mcp-v2
Then set HARNESS_API_KEY in your environment or .env file.
Cursor (.cursor/mcp.json)
npx (zero install, recommended for local Cursor configs)
{
"mcpServers": {
"harness": {
"command": "/absolute/path/to/npx",
"args": ["-y", "harness-mcp-v2@latest"],
"env": {
"HARNESS_API_KEY": "pat.xxx.xxx.xxx",
"PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
}
}
}
}
Run which npx in a terminal and use that full path for command; include the directory from which node at the front of PATH.
node (local install)
npm install -g harness-mcp-v2
{
"mcpServers": {
"harness": {
"command": "/absolute/path/to/harness-mcp-v2",
"env": {
"HARNESS_API_KEY": "pat.xxx.xxx.xxx",
"PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
}
}
}
}
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.
Devin Desktop (~/.windsurf/mcp.json)
npx (zero install)
{
"mcpServers": {
"harness": {
"command": "/absolute/path/to/npx",
"args": ["-y", "harness-mcp-v2@latest"],
"env": {
"HARNESS_API_KEY": "pat.xxx.xxx.xxx",
"PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
}
}
}
}
node (local install)
npm install -g harness-mcp-v2
{
"mcpServers": {
"harness": {
"command": "/absolute/path/to/harness-mcp-v2",
"env": {
"HARNESS_API_KEY": "pat.xxx.xxx.xxx",
"PATH": "/directory/containing/node:/usr/local/bin:/usr/bin:/bin"
}
}
}
}
Using a local build from source?
Replace the command with the path to your built index.js:
{
"command": "node",
"args": ["/absolute/path/to/harness-mcp-v2/build/index.js", "stdio"]
}
MCP Gateway
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.
Why use a gateway?
- Centralized credential management — no API keys in agent configs
- Governance & audit logging for all tool calls across teams
- Single endpoint for agents instead of N connections to N MCP servers
- Access control — restrict which teams can use which tools
Docker MCP Gateway
Register the server in your Docker MCP Gateway configuration:
{
"mcpServers": {
"harness": {
"command": "npx",
"args": ["harness-mcp-v2"],
"env": {
"HARNESS_API_KEY": "pat.xxx.xxx.xxx"
}
}
}
}
Portkey
Add the Harness MCP server to your Portkey MCP Gateway for enterprise governance, cost tracking, and multi-LLM routing:
{
"mcpServers": {
"harness": {
"command": "npx",
"args": ["harness-mcp-v2"],
"env": {
"HARNESS_API_KEY": "pat.xxx.xxx.xxx"
}
}
}
}
LiteLLM
Add to your LiteLLM proxy config:
mcp_servers:
- name: harness
command: npx
args:
- harness-mcp-v2
env:
HARNESS_API_KEY: "pat.xxx.xxx.xxx"
Envoy AI Gateway
The server works with Envoy AI Gateway's MCP support via HTTP transport:
# Start the server in HTTP mode
HARNESS_API_KEY=pat.xxx.xxx.xxx npx harness-mcp-v2 http --port 8080
Then configure Envoy to route to http://localhost:8080/mcp as an upstream MCP backend.
Harness MCP questions
How do I add Harness MCP to Claude Code?
Run claude mcp add mcp-server -- npx -y harness-mcp-v2 in your terminal. Add --scope user to make it available in every project.
How do I add Harness MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does Harness MCP provide?
It exposes 12 tools, including resource_scope, harness_describe, harness_schema, harness_list, harness_get.
How do I install the Harness MCP server?
Run it with npx using your Harness API key, or install it globally with npm. Stdio is the default transport, and HTTP is available for remote deployments.
How many tools does the Harness MCP server expose?
It exposes 11 consolidated tools that dispatch to 273 Harness resource types through a registry-based system.
Does the Harness MCP server support OAuth?
Yes. HTTP transport can run in HarnessID OAuth mode using OAuth 2.1 Authorization Code with PKCE, and the hosted service uses Harness Platform OAuth.
Can it work across multiple Harness projects?
Yes, agents discover organizations and projects dynamically without hardcoded environment variables.
Is there a hosted version of the Harness MCP server?
Yes, if your Harness account has the hosted MCP service enabled, clients can connect to the managed endpoint instead of running the server locally.