whatisgithub

What is detect-harness?

sairaph/detect-harness — explained in plain English

Analysis updated 2026-07-26

1GoAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A tool that helps developers add their app's configuration to AI coding assistants like Cursor or Claude Desktop. It detects which assistants are installed and writes the correct config files for each one.

Mindmap

mindmap
  root((repo))
    What it does
      Detects installed AI assistants
      Generates correct config files
      Preserves existing settings
    Supported assistants
      Claude Desktop and Code
      Cursor and VS Code
      Many others like Zed and Cline
    Tech stack
      Go library and CLI
      Node Python Rust wrappers
      JSON protocol for wrappers
    Safety features
      Rejects invalid configs
      Uses lock files
      Reports partial failures
    Use cases
      Add MCP server support
      Configure multiple assistants
      Support non-Go languages

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Let users of your dev tool automatically install it as an MCP server in their preferred AI assistant.

USE CASE 2

Generate and apply configuration files across 13 different AI coding assistants from a single definition.

USE CASE 3

Use the library from Node.js, Python, or Rust projects via typed wrappers.

USE CASE 4

Safely update AI assistant configs while preserving existing comments and unrelated settings.

What is it built with?

GoNode.jsPythonRust

How does it compare?

sairaph/detect-harnessadvayc/wrappedaegrail/aegrail-engine
Stars111
LanguageGoGoGo
Setup difficultymoderateeasyhard
Complexity3/52/55/5
Audiencedevelopergeneralops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires understanding MCP server definitions and may need building companion binaries for non-Go language wrappers.

So what is it?

detect-harness is a Go library and command-line tool that helps developers add MCP (Model Context Protocol) server installation support to their applications. MCP is a protocol that lets AI coding assistants connect to external tools and services. The problem this project solves is that different AI coding assistants, such as Claude Desktop, Cursor, VS Code, and others, each store their server configurations in different locations and formats. detect-harness handles the work of finding which assistants are installed on a machine and generating the correct configuration for each one. The core idea is that a developer defines their server once, using a simple structure with a name, command, arguments, and environment variables. The library then detects which AI assistants are present, generates a plan showing what configuration changes will be made, and applies those changes safely. The developer's own application controls how selections are presented to the user, while detect-harness handles detection, config generation, conflict handling, and writing files safely. The project supports 13 different AI coding assistants, including Claude Desktop, Claude Code, Cursor, Codex CLI, Gemini CLI, Windsurf, Zed, Cline, Roo Code, Amazon Q, Continue, OpenCode, and VS Code. Each assistant uses a different configuration format: some use plain JSON, others use JSON with comments, TOML, or YAML. The library produces the correct format for each one while preserving existing settings and comments that are unrelated to the server being added. Beyond the Go library, the project provides typed wrappers for Node.js, Python, and Rust. These wrappers communicate with a companion binary through a simple JSON protocol, reading one request and writing one response. This means developers working in those languages can use the same detection and configuration capabilities without rewriting the logic. Safety is a major focus. The library rejects invalid configurations, oversized files, duplicate keys, and symbolic links before writing anything. It uses temporary files with restrictive permissions, rechecks plans immediately before applying them, and uses lock files to prevent concurrent edits. If something goes wrong during a multi-assistant update, partial results are reported rather than hiding failures. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Using the detect-harness Go library, write code to define an MCP server named 'my-tool' with a command and arguments, then detect installed AI assistants and print the config plan.
Prompt 2
I have a Node.js app. Show me how to use the detect-harness Node wrapper to install an MCP server config into Cursor and Claude Desktop.
Prompt 3
Write a script using detect-harness that defines a server with environment variables, generates a plan for all detected assistants, and applies the changes safely.
Prompt 4
Explain how to use detect-harness to add MCP server installation support to my existing CLI tool, including how to let the user pick which assistants to configure.

Frequently asked questions

What is detect-harness?

A tool that helps developers add their app's configuration to AI coding assistants like Cursor or Claude Desktop. It detects which assistants are installed and writes the correct config files for each one.

What language is detect-harness written in?

Mainly Go. The stack also includes Go, Node.js, Python.

How hard is detect-harness to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is detect-harness for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.