Harness MCP Server 2.0
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
An MCP (Model Context Protocol) server that gives AI agents full access to the Harness.io platform through 11 consolidated tools and 261 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, 261 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.** 42 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:
1. Log in to your Harness account
2. Go to **My Profile** → **API Keys** → **+ New API Key**
3. Create a new **Token** under the API key — this generates a PAT or SAT in the format . . .
4. 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:
Or configure the API key in your AI client (see Client Configuration below).
> **Note:** The account ID is auto-extracted from PAT and SAT tokens (pat. ... or sat. ...), so HARNESS_ACCOUNT_ID is only needed for API keys without an embedded account segment.
Option 2: Global Install
Option 3: Build from Source
For development or customization:
Anthropic MCP Directory bundle
The MCPB bundle manifest lives in mcp-directory/, and the 512×512 bundle icon is tracked at 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:
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- .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
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 |
| --------- | --------- | ---------------------------------------------------------------- |