Harness MCP Server
Give AI agents full access to the Harness platform through 11 consolidated tools and 139 resource types using the Model Context Protocol (MCP).
The Harness MCP Server is an open-source Model Context Protocol server that gives AI agents full access to the Harness platform. It uses a registry-based dispatch system that routes 11 consolidated tools (harness_list, harness_get, harness_create, and others) to 139 resource types across 30 toolsets, covering CI/CD, GitOps, Feature Management & Experimentation, Cloud Cost Management, Security Testing, Chaos Engineering, Internal Developer Portal, Software Supply Chain, and more.
Unlike MCP servers that map one tool per API endpoint (which degrades LLM tool-selection accuracy as tool count grows), this server keeps the tool count small and the schema footprint minimal. Agents discover organizations and projects dynamically, so multi-project workflows work out of the box without hardcoded environment variables. Twenty-seven pre-built prompt templates cover common workflows such as debugging failed pipelines, reviewing DORA metrics, triaging vulnerabilities, and optimizing cloud costs.
Source code: github.com/harness/mcp-server
npm package: harness-mcp-v2 on npm
What you will learn in this topic
By the end of this topic, you will be able to:
Configure your AI client by adding the server to Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, Gemini CLI, and Amazon Q Developer CLI with an API key.
Connect to the Harness-managed endpoint with OAuth instead of an API key.
Run the server with Docker, Kubernetes, MCP gateways, or HTTP transport in multi-user mode.
Elicitate risk-based auto-approve, and platform safeguards.
Troubleshoot common errors and interactive debugging with MCP Inspector.
Before you begin
Before you configure MCP server, ensure you have the following:
Harness API key: A personal access token (PAT) in the format
pat.<accountId>.<tokenId>.<secret>. The account ID is auto-extracted from PAT tokens. To create one, go to My Profile > API Keys > + New API Key, then create a Token. Go to Manage API Keys to review detailed instructions.Node.js: Required when you use
npxornpm install. This is not required for Docker.
Quick start
This set up does not require any installation. Run the server directly with npx command described below:
The server defaults to stdio transport (for Claude Desktop, Cursor, Windsurf, and similar clients). For remote or shared deployments, use http as described below:
Once the server runs, go to Configure your AI client to connect your editor or terminal.
Install with an alternative method
In this set up, use a global install or a source build when npx does not fit your environment.
Global install
Build from source
CLI usage
--port <number>
Port for HTTP transport (default: 3000, or PORT env var)
--help
Show help message and exit
--version
Print version and exit
How it works
The image below describes the flow of control from AI agent (such as Claude) to Harness REST API.

Tools are generic verbs (
harness_list,harness_get, and others) that accept aresource_typeparameter to route to the correct API endpoint.The Registry maps each
resource_typeto a declarativeResourceDefinitionspecifying the HTTP method, URL path, parameter mappings, and response extraction.Dispatch resolves the resource definition, builds the HTTP request, calls the Harness API, and extracts the relevant response data.
Toolset filtering controls which resource definitions load at startup.
Deep links are automatically appended to responses, providing direct Harness UI URLs.
Compact mode strips verbose metadata from list results to minimize token usage.
Next steps
Configure your AI client: Add the server to your editor or terminal.
Tools reference: Review the 11 tools and their parameters.
Model Context Protocol specification: Understand the underlying protocol.
Last updated
Was this helpful?