Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计提醒

harness-mcpharness MCP 命令行

Agent Skill

harness-mcp 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

367

周安装

15

GitHub Stars

11

下载量

119
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:harness-mcp(harness MCP 命令行)
来源仓库:https://github.com/lobbi-docs/claude
仓库路径:skills/harness-mcp
安装命令:
npx skills add https://github.com/lobbi-docs/claude --skill harness-mcp
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lobbi-docs/claude --skill harness-mcp

简介

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。

  • 适合围绕代码变更、仓库状态进行整理和分析。harness-mcp 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 通过 GitHub 安装,可结合来源仓库进一步验证用法。
  • 安装前需确认权限范围和维护状态,避免触发不必要操作。
  • 建议核实是否会执行命令或读写文件后再使用。

SKILL.md

Harness MCP Skill

AI-powered CD operations, Git repository and pull request management via Harness MCP Server.

Prerequisites

Environment Variables

export HARNESS_API_KEY="your-api-key"
export HARNESS_DEFAULT_ORG_ID="your-org-id"
export HARNESS_DEFAULT_PROJECT_ID="your-project-id"
export HARNESS_BASE_URL="https://app.harness.io"
export HARNESS_ACCOUNT_ID="your-account-id"

API Token Generation

  1. Navigate to Account Settings > API Keys in Harness UI
  2. Click + API Key
  3. Set permissions (minimum: pipeline execution, connector management)
  4. Store securely

MCP Server Configuration

Claude Code

{
  "mcpServers": {
    "harness": {
      "command": "npx",
      "args": ["-y", "@anthropic-ai/mcp-harness"],
      "env": {
        "HARNESS_API_KEY": "${HARNESS_API_KEY}",
        "HARNESS_DEFAULT_ORG_ID": "${HARNESS_DEFAULT_ORG_ID}",
        "HARNESS_DEFAULT_PROJECT_ID": "${HARNESS_DEFAULT_PROJECT_ID}",
        "HARNESS_BASE_URL": "${HARNESS_BASE_URL}"
      }
    }
  }
}

Docker

docker run -e HARNESS_API_KEY=$HARNESS_API_KEY \
           -e HARNESS_DEFAULT_ORG_ID=$HARNESS_DEFAULT_ORG_ID \
           -e HARNESS_DEFAULT_PROJECT_ID=$HARNESS_DEFAULT_PROJECT_ID \
           harness/mcp-server:latest

Available MCP Tools

CategoryToolPurpose
Connectorsharness_get_connector, harness_list_connectors, harness_get_connector_catalogueManage connectors
Pipelinesharness_list_pipelines, harness_get_pipeline, harness_trigger_pipelinePipeline operations
Executionsharness_get_execution, harness_list_executions, harness_get_execution_urlTrack executions
Dashboardsharness_list_dashboards, harness_get_dashboardDashboard data
Reposharness_get_repository, harness_list_repositoriesRepository management
Pull Requestsharness_get_pull_request, harness_list_pull_requests, harness_create_pull_request, harness_get_pull_request_checks, harness_get_pull_request_activitiesPR operations

Git & Pull Request Workflows

List Repositories

repos = harness_list_repositories(
    org_id="${HARNESS_ORG_ID}",
    project_id="${HARNESS_PROJECT_ID}"
)

Create Pull Request

pr = harness_create_pull_request(
    repo_id="my-application",
    title="PROJ-123: Feature title",
    source_branch="feature/PROJ-123",
    target_branch="main",
    description="## Summary\nImplements feature.\n## Jira\n[PROJ-123](https://company.atlassian.net/browse/PROJ-123)"
)

Get PR Activities (Comments, Reviews)

activities = harness_get_pull_request_activities(repo_id="my-app", pr_number=42)
for activity in activities:
    if activity.type == "comment":
        print(f"Comment by {activity.author} at {activity.file_path}:{activity.line_number}")
    elif activity.type == "review":
        print(f"Review by {activity.author}: {activity.state}")

Sync PR Comments to Jira

activities = harness_get_pull_request_activities(repo_id="my-app", pr_number=42)
review_summary = []
for activity in activities:
    if activity.type == "review":
        review_summary.append(f"- **{activity.author}**: {activity.state}")

jira_add_comment(issue_key="PROJ-123",
    body=f"## PR Review\n**PR:** [#{42}]({pr.url})\n**Status:** {pr.state}\n\n" + "\n".join(review_summary))

PR-to-Jira Status Mapping

pr_sync:
  enabled: true
  jira_key_patterns:
    - title: "^([A-Z]+-\\d+)"
    - branch: "feature/([A-Z]+-\\d+)"
  transitions:
    pr_created: { transition: "In Review", comment: "PR created: {pr_url}" }
    pr_approved: { transition: "Approved", comment: "PR approved by {approver}" }
    pr_merged: { transition: "Done", comment: "PR merged to {target_branch}" }
  fields:
    pr_url: "customfield_10200"
    pr_status: "customfield_10201"
    reviewers: "customfield_10202"

Jira Connector Setup

Create Connector

connector:
  name: jira-connector
  identifier: jira_connector
  type: Jira
  spec:
    jiraUrl: https://your-company.atlassian.net
    auth:
      type: UsernamePassword
      spec:
        username: your.email@company.com
        passwordRef: jira_api_token
    delegateSelectors:
      - delegate-name

Required Scopes: read:jira-user, read:jira-work, write:jira-work

Jira Create Step in Pipeline

- step:
    name: Create Jira Issue
    type: JiraCreate
    spec:
      connectorRef: jira_connector
      projectKey: PROJ
      issueType: Task
      fields:
        - name: Summary
          value: "Deployment: <+pipeline.name> - <+pipeline.sequenceId>"
        - name: Priority
          value: Medium

Jira Update Step

- step:
    name: Update Jira Issue
    type: JiraUpdate
    spec:
      connectorRef: jira_connector
      issueKey: <+pipeline.variables.jiraIssueKey>
      fields:
        - name: Status
          value: Done
      transitionTo:
        transitionName: Done
        status: Done

Jira Approval Step

- step:
    name: Jira Approval
    type: JiraApproval
    spec:
      connectorRef: jira_connector
      issueKey: <+pipeline.variables.jiraIssueKey>
      approvalCriteria:
        matchAnyCondition: true
        conditions:
          - key: Status
            operator: equals
            value: Approved

Integration with Jira Orchestrator

Configuration

harness:
  account:
    account_id: "${HARNESS_ACCOUNT_ID}"
    org_id: "${HARNESS_ORG_ID}"
    project_id: "${HARNESS_PROJECT_ID}"
  api:
    base_url: "https://app.harness.io"
    api_key: "${HARNESS_API_KEY}"
  mcp:
    enabled: true
    tools:
      - harness_get_connector
      - harness_list_pipelines
      - harness_get_execution
  jira_connector_ref: "jira_connector"
  sync:
    auto_create_issues: true
    auto_transition: true
    environments:
      dev: "In Development"
      staging: "In QA"
      prod: "Released"

MCP Tool Usage

connector = harness_get_connector(connector_id="jira_connector", org_id="default", project_id="my_project")
executions = harness_list_executions(pipeline_id="deploy_pipeline", limit=10)
execution = harness_get_execution(execution_id="abc123", org_id="default", project_id="my_project")

REST API for PR Operations

Base URL

HARNESS_CODE_API="${HARNESS_BASE_URL}/code/api/v1"

Authentication

curl -H "x-api-key: ${HARNESS_API_KEY}" \
     -H "Content-Type: application/json" \
     "${HARNESS_CODE_API}/repos/{repo-ref}/pullreq/{pr-number}/comments"

Key Endpoints

OperationMethodEndpoint
Create CommentPOST/v1/repos/{repo}/pullreq/{pr}/comments
Create Code CommentPOST/v1/repos/{repo}/pullreq/{pr}/comments (with path, line_start, line_end)
Submit ReviewPOST/v1/repos/{repo}/pullreq/{pr}/reviews
Add ReviewerPOST/v1/repos/{repo}/pullreq/{pr}/reviewers
Merge PRPOST/v1/repos/{repo}/pullreq/{pr}/merge

Create General Comment

curl -X POST "${HARNESS_CODE_API}/repos/${REPO}/pullreq/${PR}/comments" \
  -H "x-api-key: ${HARNESS_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"text": "Great work!"}'

Create Code Comment

curl -X POST "${HARNESS_CODE_API}/repos/${REPO}/pullreq/${PR}/comments" \
  -H "x-api-key: ${HARNESS_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Consider adding null check",
    "path": "src/auth.ts",
    "line_start": 42,
    "line_end": 45,
    "line_start_new": true,
    "line_end_new": true
  }'

Submit Review

curl -X POST "${HARNESS_CODE_API}/repos/${REPO}/pullreq/${PR}/reviews" \
  -H "x-api-key: ${HARNESS_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"commit_sha": "abc123", "decision": "approved"}'

Decision Values: approved, changereq, reviewed

Merge PR

curl -X POST "${HARNESS_CODE_API}/repos/${REPO}/pullreq/${PR}/merge" \
  -H "x-api-key: ${HARNESS_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "squash",
    "source_sha": "abc123",
    "title": "feat: Add auth",
    "delete_source_branch": true
  }'

Merge Methods: merge, squash, rebase, fast-forward

Bash Helper Functions

export HARNESS_CODE_API="${HARNESS_BASE_URL:-https://app.harness.io}/code/api/v1"

harness_pr_comment() {
  local repo="$1" pr="$2" text="$3"
  curl -s -X POST "${HARNESS_CODE_API}/repos/${repo}/pullreq/${pr}/comments" \
    -H "x-api-key: ${HARNESS_API_KEY}" \
    -H "Content-Type: application/json" \
    -d "{\"text\": \"${text}\"}"
}

harness_pr_approve() {
  local repo="$1" pr="$2" commit_sha="$3"
  curl -s -X POST "${HARNESS_CODE_API}/repos/${repo}/pullreq/${pr}/reviews" \
    -H "x-api-key: ${HARNESS_API_KEY}" \
    -H "Content-Type: application/json" \
    -d "{\"commit_sha\": \"${commit_sha}\", \"decision\": \"approved\"}"
}

harness_pr_merge() {
  local repo="$1" pr="$2" method="${3:-squash}" source_sha="$4" title="$5"
  curl -s -X POST "${HARNESS_CODE_API}/repos/${repo}/pullreq/${pr}/merge" \
    -H "x-api-key: ${HARNESS_API_KEY}" \
    -H "Content-Type: application/json" \
    -d "{\"method\": \"${method}\", \"source_sha\": \"${source_sha}\", \"title\": \"${title}\", \"delete_source_branch\": true}"
}

Python Client

import requests, os
from typing import Optional, Literal

class HarnessCodeAPI:
    def __init__(self, api_key: str = None, base_url: str = None):
        self.api_key = api_key or os.environ.get("HARNESS_API_KEY")
        self.base_url = base_url or os.environ.get("HARNESS_BASE_URL", "https://app.harness.io")
        self.api_url = f"{self.base_url}/code/api/v1"
        self.headers = {"x-api-key": self.api_key, "Content-Type": "application/json"}

    def create_comment(self, repo: str, pr_number: int, text: str, path: Optional[str] = None,
                      line_start: Optional[int] = None, line_end: Optional[int] = None,
                      parent_id: Optional[int] = None) -> dict:
        url = f"{self.api_url}/repos/{repo}/pullreq/{pr_number}/comments"
        data = {"text": text}
        if parent_id:
            data["parent_id"] = parent_id
        elif path and line_start:
            data.update({"path": path, "line_start": line_start, "line_end": line_end or line_start,
                        "line_start_new": True, "line_end_new": True})
        return requests.post(url, headers=self.headers, json=data).json()

    def submit_review(self, repo: str, pr_number: int, commit_sha: str,
                     decision: Literal["approved", "changereq", "reviewed"]) -> dict:
        url = f"{self.api_url}/repos/{repo}/pullreq/{pr_number}/reviews"
        data = {"commit_sha": commit_sha, "decision": decision}
        return requests.post(url, headers=self.headers, json=data).json()

    def approve(self, repo: str, pr_number: int, commit_sha: str) -> dict:
        return self.submit_review(repo, pr_number, commit_sha, "approved")

    def merge(self, repo: str, pr_number: int, source_sha: str,
             method: Literal["merge", "squash", "rebase", "fast-forward"] = "squash",
             title: Optional[str] = None, delete_source_branch: bool = True,
             dry_run: bool = False) -> dict:
        url = f"{self.api_url}/repos/{repo}/pullreq/{pr_number}/merge"
        data = {"method": method, "source_sha": source_sha, "delete_source_branch": delete_source_branch, "dry_run": dry_run}
        if title:
            data["title"] = title
        return requests.post(url, headers=self.headers, json=data).json()

Multi-Repository Workspace Support

Configuration

harness:
  workspace:
    repositories:
      - identifier: frontend-app
        path: ./frontend
        jira_project: FRONT
      - identifier: backend-api
        path: ./backend
        jira_project: BACK
    auto_create_repos: true
    default_branch: main
  review:
    cross_repo_review: true
  jira:
    sync_enabled: true
    aggregate_prs: true

Python API

from lib.harness_code_api import HarnessCodeAPI

client = HarnessCodeAPI()
repos = client.setup_workspace_repos([
    {"identifier": "frontend", "path": "./frontend"},
    {"identifier": "backend", "path": "./backend"}
])
prs = client.get_workspace_prs(repo_identifiers=["frontend", "backend"], state="open", jira_key="PROJ-123")

Repository Creation

Python

repo = client.create_repository(
    identifier="my-service",
    description="User management service",
    default_branch="main",
    is_public=False,
    readme=True,
    license="MIT"
)

REST API

OperationMethodEndpoint
List ReposGET/v1/repos
Get RepoGET/v1/repos/{repo}
Create RepoPOST/v1/repos
Update RepoPATCH/v1/repos/{repo}
Delete RepoDELETE/v1/repos/{repo}

Confluence Documentation Integration

Auto-Documentation

from lib.confluence_doc_linker import ConfluenceDocLinker

linker = ConfluenceDocLinker()
docs = linker.ensure_issue_docs("PROJ-123")
linker.link_readme_to_confluence(readme_path="./README.md", jira_key="PROJ-123")

Configuration

documentation:
  confluence:
    base_url: "${CONFLUENCE_BASE_URL}"
    space_key: "ENG"
  auto_create:
    enabled: true
    on_work_start: true
  readme:
    auto_update: true

Troubleshooting

IssueSolution
Invalid API KeyRegenerate in Harness UI
Network timeoutCheck delegate connectivity
Permission deniedVerify API key permissions
Jira unreachableCheck firewall/proxy

Debug Logging

export HARNESS_LOG_LEVEL=debug
export MCP_DEBUG=true

Best Practices

  1. Use Harness Secrets for credentials
  2. Select delegates with direct Jira network access
  3. Configure error handling with retries
  4. Enable logging for all operations
  5. Scope API tokens to minimum permissions

Related Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.23%
按下载量换算43

Claude

33.57%
按下载量换算40

Cursor

17.22%
按下载量换算20

Gemini CLI

9.95%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills