An MCP (Model Context Protocol) server for the Harness Software Delivery Platform API. Enables AI assistants like Claude to interact with your Harness account — managing pipelines, executions, secrets, feature flags, cloud costs, and more.
git clone <this-repo>
cd harness-mcp
npm install
npm run buildCopy .env.example to .env and fill in your credentials:
cp .env.example .env| Variable | Required | Description |
|---|---|---|
HARNESS_API_KEY |
Yes | API key from Harness Account Settings → API Keys |
HARNESS_ACCOUNT_ID |
Yes | Account ID from Harness Account Settings → Overview |
HARNESS_BASE_URL |
No | Defaults to https://app.harness.io |
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"harness": {
"command": "node",
"args": ["D:/15_MCPs/harness-mcp/dist/index.js"],
"env": {
"HARNESS_API_KEY": "your-api-key-here",
"HARNESS_ACCOUNT_ID": "your-account-id-here",
"HARNESS_BASE_URL": "https://app.harness.io"
}
}
}
}Add to your Claude Code settings (.claude/settings.json):
{
"mcpServers": {
"harness": {
"command": "node",
"args": ["D:/15_MCPs/harness-mcp/dist/index.js"],
"env": {
"HARNESS_API_KEY": "your-api-key-here",
"HARNESS_ACCOUNT_ID": "your-account-id-here"
}
}
}
}Harness uses a three-level scope hierarchy: Account → Organization → Project.
- Account-level operations (e.g., listing orgs) require only
HARNESS_ACCOUNT_ID - Org-level operations require
orgparameter - Project-level operations require both
organdprojectparameters
Most pipeline, service, and environment operations are project-scoped. Secrets and connectors can exist at any scope level.
| Tool | Description | Scope |
|---|---|---|
harness_list_orgs |
List organizations in the account | Account |
harness_list_projects |
List projects within an organization | Org |
harness_list_pipelines |
List pipelines in a project | Project |
harness_get_pipeline |
Get pipeline YAML and details | Project |
harness_execute_pipeline |
Trigger a pipeline execution | Project |
harness_get_execution_status |
Poll execution status by ID | Project |
harness_list_executions |
List execution history with status filter | Project |
harness_create_secret |
Create a text secret | Any |
harness_get_secret |
Get secret metadata (not the value) | Any |
harness_list_secrets |
List secrets at a scope | Any |
harness_list_services |
List services in a project | Project |
harness_list_environments |
List environments in a project | Project |
| Tool | Description | Scope |
|---|---|---|
harness_list_connectors |
List connectors (cloud, repo, registry) | Any |
harness_test_connector |
Test connector connectivity | Any |
harness_create_pipeline |
Create pipeline from YAML | Project |
harness_update_pipeline |
Update pipeline YAML | Project |
harness_delete_pipeline |
Delete a pipeline (irreversible) | Project |
harness_list_templates |
List reusable templates | Any |
harness_list_feature_flags |
List feature flags | Project |
harness_toggle_feature_flag |
Toggle flag on/off in an environment | Project |
harness_list_triggers |
List pipeline triggers | Project |
harness_create_trigger |
Create a trigger from YAML | Project |
| Tool | Description | Scope |
|---|---|---|
harness_list_cost_anomalies |
List CCM cost anomalies | Account |
harness_get_budget_status |
Get budget utilization and forecast | Account |
harness_list_recommendations |
List cost optimization recommendations | Account |
harness_list_security_issues |
List STO security vulnerabilities | Project |
harness_list_security_scans |
List STO scan results | Project |
"List all pipelines in org 'default' project 'my-app'"
Calls harness_list_pipelines with org: "default", project: "my-app".
Expected response shape:
## Pipelines in default/my-app (5 total, Page 1)
- **Build and Deploy** (`build_and_deploy`)
Status: Success | Last run: 2026-04-12T15:30:00.000Z
Stages: Build, Deploy_Dev, Deploy_Prod
"Execute the 'build_and_deploy' pipeline in default/my-app"
Calls harness_execute_pipeline with org: "default", project: "my-app", pipeline: "build_and_deploy".
Expected response shape:
## Pipeline Execution Started
Pipeline: build_and_deploy
Execution ID: `abc123-def456-...`
Status: Queued
Use `harness_get_execution_status` with this execution ID to poll for completion.
- API keys are loaded from environment variables only — never hardcoded or logged
- Secret values are never returned in tool output (Harness API enforces this)
- All string parameters are sanitized before URL interpolation
- Retry logic handles 429 (rate limit) and 5xx errors with exponential backoff
This server uses both Harness API generations:
/v1/— Newer Beta API (used for orgs, projects)/ng/api/— Next-gen API with broader coverage (used for most operations)/pipeline/api/— Pipeline-specific endpoints/cf/admin/— Feature Flags API/ccm/api/— Cloud Cost Management API/sto/api/— Security Testing Orchestration API
Full best practices documentation is available in the docs/ directory:
- Getting Started — Install, configure, first request
- Scope and Navigation — Account → Org → Project hierarchy
- Workflow Patterns — Multi-tool sequences for common tasks
- Security Best Practices — API keys, RBAC, secret handling
- Error Handling — Troubleshooting and debugging
- Tool Reference — All 27 tools with full parameter details
- Architecture — Design decisions and contributor guide