Sponsored by Deepsite.site

Harness MCP Server

Created By
harness7 months ago
This is the official repo for the Harness MCP server
Content

Harness MCP Server

The Harness MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with Harness APIs, enabling advanced automation and interaction capabilities for developers and tools.

Components

Tools

The server implements several toolsets:

Pipelines Toolset

Toolset Name: pipelines

  • get_pipeline: Get details of a specific pipeline
  • list_pipelines: List pipelines in a repository
  • get_execution: Get details of a specific pipeline execution
  • list_executions: List pipeline executions
  • fetch_execution_url: Fetch the execution URL for a pipeline execution

Pull Requests Toolset

Toolset Name: pullrequests

  • get_pull_request: Get details of a specific pull request
  • list_pull_requests: List pull requests in a repository
  • get_pull_request_checks: Get status checks for a specific pull request
  • get_pull_request_activities: Get activities and comments for a specific pull request
  • create_pull_request: Create a new pull request

Repositories Toolset

Toolset Name: repositories

  • get_repository: Get details of a specific repository
  • list_repositories: List repositories

Registries Toolset

Toolset Name: registries

  • get_registry: Get details of a specific registry in Harness artifact registry
  • list_artifact_files: List files for a specific artifact version in a Harness artifact registry
  • list_artifact_versions: List artifact versions in a Harness artifact registry
  • list_artifacts: List artifacts in a Harness artifact registry
  • list_registries: List registries in Harness artifact registry

Logs Toolset

Toolset Name: logs

  • download_execution_logs: Download logs for a pipeline execution

Prerequisites

  1. You will need to have Go 1.23 or later installed on your system.
  2. A Harness API key for authentication.

Quickstart

Build from Source

  1. Clone the repository:
git clone https://github.com/harness/mcp-server.git
cd mcp-server
  1. Build the binary:
go build -o cmd/harness-mcp-server/harness-mcp-server ./cmd/harness-mcp-server
  1. Run the server:
HARNESS_API_KEY=your_api_key HARNESS_DEFAULT_ORG_ID=your_org_id HARNESS_DEFAULT_PROJECT_ID=your_project_id ./cmd/harness-mcp-server/harness-mcp-server stdio

Use Docker Image

Alternatively, you can use the pre-built Docker image:

docker run -i --rm \
  -e HARNESS_API_KEY=your_api_key \
  -e HARNESS_DEFAULT_ORG_ID=your_org_id \
  -e HARNESS_DEFAULT_PROJECT_ID=your_project_id \
  -e HARNESS_BASE_URL=your_base_url \
  harness/mcp-server stdio

Claude Desktop Configuration

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json

Server Configuration
{
  "mcpServers": {
    "harness": {
      "command": "/path/to/harness-mcp-server",
      "args": ["stdio"],
      "env": {
        "HARNESS_API_KEY": "<YOUR_API_KEY>",
        "HARNESS_DEFAULT_ORG_ID": "<YOUR_ORG_ID>",
        "HARNESS_DEFAULT_PROJECT_ID": "<YOUR_PROJECT_ID>"
      }
    }
  }
}

Usage with Claude Code

HARNESS_API_KEY=your_api_key HARNESS_ACCOUNT_ID=your_account_id HARNESS_ORG_ID=your_org_id HARNESS_PROJECT_ID=your_project_id ./cmd/harness-mcp-server/harness-mcp-server stdio

Usage with Windsurf

To use the Harness MCP Server with Windsurf:

  1. Add the server configuration to your Windsurf config file:

Using Local Binary

{
  "mcpServers": {
    "harness": {
      "command": "/path/to/harness-mcp-server",
      "args": ["stdio"],
      "env": {
        "HARNESS_API_KEY": "<YOUR_API_KEY>",
        "HARNESS_DEFAULT_ORG_ID": "<YOUR_ORG_ID>",
        "HARNESS_DEFAULT_PROJECT_ID": "<YOUR_PROJECT_ID>",
        "HARNESS_BASE_URL": "<YOUR_BASE_URL>"
      }
    }
  }
}

Using Docker Image

{
  "mcpServers": {
    "harness": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "HARNESS_API_KEY",
        "-e",
        "HARNESS_DEFAULT_ORG_ID",
        "-e",
        "HARNESS_DEFAULT_PROJECT_ID",
        "-e",
        "HARNESS_BASE_URL",
        "harness/mcp-server",
        "stdio"
      ],
      "env": {
        "HARNESS_API_KEY": "<YOUR_API_KEY>",
        "HARNESS_DEFAULT_ORG_ID": "<YOUR_ORG_ID>",
        "HARNESS_DEFAULT_PROJECT_ID": "<YOUR_PROJECT_ID>",
        "HARNESS_BASE_URL": "<YOUR_BASE_URL>"
      }
    }
  }
}

Usage with Amazon Q Developer CLI

To use the Harness MCP Server with Amazon Q Developer CLI:

  1. Add the server configuration to your Amazon Q config file at: ~/.aws/amazonq/mcp.json

Using Local Binary

{
  "mcpServers": {
    "harness": {
      "command": "/path/to/harness-mcp-server",
      "args": ["stdio"],
      "env": {
        "HARNESS_API_KEY": "<YOUR_API_KEY>",
        "HARNESS_DEFAULT_ORG_ID": "<YOUR_ORG_ID>",
        "HARNESS_DEFAULT_PROJECT_ID": "<YOUR_PROJECT_ID>",
        "HARNESS_BASE_URL": "<YOUR_BASE_URL>"
      }
    }
  }
}

Development

Command Line Arguments

The Harness MCP Server supports the following command line arguments:

  • --toolsets: Comma-separated list of tool groups to enable (default: "all")
  • --read-only: Run the server in read-only mode
  • --log-file: Path to log file for debugging
  • --log-level: Set the logging level (debug, info, warn, error)
  • --version: Show version information
  • --help: Show help message
  • --base-url: Base URL for Harness (default: "https://app.harness.io")

Environment Variables

Environment variables are prefixed with HARNESS_:

  • HARNESS_API_KEY: Harness API key (required) - Account ID is automatically extracted from the API key
  • HARNESS_DEFAULT_ORG_ID: Default Harness organization ID (optional, if not specified it would need to be passed in the request if it's required for that operation)
  • HARNESS_DEFAULT_PROJECT_ID: Default Harness project ID (optional, if not specified it would need to be passed in the request if it's required for that operation)
  • HARNESS_TOOLSETS: Comma-separated list of toolsets to enable (default: "all")
  • HARNESS_READ_ONLY: Set to "true" to run in read-only mode
  • HARNESS_LOG_FILE: Path to log file
  • HARNESS_LOG_LEVEL: Set the logging level (debug, info, warn, error)
  • HARNESS_BASE_URL: Base URL for Harness (default: "https://app.harness.io")

Authentication

The server uses a Harness API key for authentication. This can be set via the HARNESS_API_KEY environment variable.

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.

You can launch the MCP Inspector with this command:

npx @modelcontextprotocol/inspector /path/to/harness-mcp-server stdio

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Tavily Mcp
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Amap Maps高德地图官方 MCP Server
ChatWiseThe second fastest AI chatbot™
WindsurfThe new purpose-built IDE to harness magic
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
CursorThe AI Code Editor
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Playwright McpPlaywright MCP server
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
DeepChatYour AI Partner on Desktop
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Serper MCP ServerA Serper MCP Server