mcp-kicad-sch-api: Command for Claude Code

.claude/commands/dev/run-tests.md

run-tests is a command for Claude Code from circuit-synth/mcp-kicad-sch-api. It costs 0 tokens per session (1,263 once invoked), scanned C, original, MIT.

A command for running the test suites of the MCP KiCAD Schematic API server. KiCAD is software for designing electronic circuit schematics, and MCP is the interface being tested.

In plain words
What is it for?
Use it to run quick, standard, integration, or code-coverage tests, with options for detailed output, dependency installation, and stopping after failures.
Why use it?
It provides repeatable checks for server behavior instead of relying on manual testing. Different suites trade testing depth for speed.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

This is circuit-synth/mcp-kicad-sch-api's own configuration. It tells Claude Code how to work on mcp-kicad-sch-api itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-kicad-sch-api configures →

Reuse

Borrowing it

Nothing to install: this file belongs to circuit-synth/mcp-kicad-sch-api. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/circuit-synth/mcp-kicad-sch-api/main/.claude/commands/dev/run-tests.md
Clone the repo
git clone --depth 1 https://github.com/circuit-synth/mcp-kicad-sch-api

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for run-tests

README.md
[![agentmods](https://agentmods.dev/badge/commands/circuit-synth/mcp-kicad-sch-api/run-tests.svg)](https://agentmods.dev/commands/circuit-synth/mcp-kicad-sch-api/run-tests)
Your own site
<a href="https://agentmods.dev/commands/circuit-synth/mcp-kicad-sch-api/run-tests"><img src="https://agentmods.dev/badge/commands/circuit-synth/mcp-kicad-sch-api/run-tests.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,263 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01263
Opus 5 $0.00000 $0.00632
Sonnet 5 $0.00000 $0.00253
Haiku 4.5 $0.00000 $0.00126

Measured 8d ago against content hash 33287b42621a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade C, and why

run-tests scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf .pytest_cache/ .coverage htmlcov/ test_*.kicad_sch 2>/dev/null || true
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • run-tests — 100% identical, 2 lines differ
.claude/commands/dev/run-tests.md · 214 lines

How it starts

The opening of the file, as written. The whole thing — 214 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test Runner Command - MCP KiCAD Schematic API

Usage

/run-tests [options]

Description

Orchestrates comprehensive testing for the MCP KiCAD Schematic API server, covering all MCP tools and KiCAD integration with professional test reporting.

Options

  • --suite=standard - Test suite: quick, standard, integration, coverage (default: standard)
  • --skip-install - Skip dependency reinstallation (faster for development)
  • --keep-outputs - Don't delete generated test files
  • --verbose - Show detailed output
  • --fail-fast=false - Stop on first failure (default: false)

Test Suites

🚀 Quick Suite (~5 seconds)

Fast development testing:

pytest tests/test_server.py -q

📋 Standard Suite - Default (~15 seconds)

Comprehensive MCP server functionality:

# Run all tests
pytest tests/ -v --tb=short

🔬 Integration Suite (~30 seconds)

Complete validation with real KiCAD files:

# Integration tests with kicad-sch-api
pytest tests/test_mcp_server_integration.py -v

# Test MCP tool workflows
pytest tests/ -v -k "integration"

📊 Coverage Suite (~20 seconds)

Detailed coverage analysis:

pytest tests/ --cov=mcp_kicad_sch_api --cov-report=term-missing --cov-report=html --cov-fail-under=80

Implementation

#!/bin/bash

# Parse arguments
SUITE="standard"
SKIP_INSTALL=false
KEEP_OUTPUTS=false
VERBOSE=false
FAIL_FAST=false

while [[ $# -gt 0 ]]; do
    case $1 in
        --suite=*)
            SUITE="${1#*=}"
            shift
            ;;
        --skip-install)
            SKIP_INSTALL=true
            shift
            ;;
        --verbose)
            VERBOSE=true
            shift
            ;;
        --fail-fast)
            FAIL_FAST=true
            shift
            ;;
        *)
            echo "Unknown option: $1"
            exit 1
            ;;
    esac
done

# Ensure we're in project root
if [[ ! -f "pyproject.toml" ]]; then
    echo "❌ Must run from mcp-kicad-sch-api root"
    exit 1
fi

# Install dependencies if needed
if [[ "$SKIP_INSTALL" == "false" ]]; then
    echo "📦 Installing dependencies..."
    pip install -e . --quiet
    pip install -e submodules/kicad-sch-api --quiet
    pip install pytest pytest-cov --quiet
fi

# Build pytest arguments
PYTEST_ARGS=""
[[ "$VERBOSE" == "true" ]] && PYTEST_ARGS="$PYTEST_ARGS -v"
[[ "$FAIL_FAST" == "true" ]] && PYTEST_ARGS="$PYTEST_ARGS -x"

# Execute test suite
case $SUITE in
    quick)
        echo "🚀 Running quick test suite..."
        pytest tests/test_server.py -q $PYTEST_ARGS
        ;;
        
    standard)
        echo "📋 Running standard test suite..."
        pytest tests/ --tb=short $PYTEST_ARGS
        ;;
        
    integration)
        echo "🔬 Running integration test suite..."
        
        # MCP server integration tests
        pytest tests/test_mcp_server_integration.py -v $PYTEST_ARGS || exit 1
        
        # All integration workflows
        pytest tests/ -v -k "integration" $PYTEST_ARGS
        ;;
        
    coverage)
        echo "📊 Running coverage analysis..."
        pytest tests/ --cov=mcp_kicad_sch_api --cov-report=term-missing --cov-report=html --cov-fail-under=70 $PYTEST_ARGS
        echo "📊 Coverage report: htmlcov/index.html"
        ;;
        
    *)
        echo "❌ Unknown suite: $SUITE"
        echo "Available suites: quick, standard, integration, coverage"
        exit 1
        ;;
esac

# Cleanup if requested
if [[ "$KEEP_OUTPUTS" == "false" ]]; then
    echo "🧹 Cleaning up test outputs..."
    rm -rf .pytest_cache/ .coverage htmlcov/ test_*.kicad_sch 2>/dev/null || true
fi

echo "✅ Test suite completed"

Read the full file on GitHub · 214 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 214 lines · 0 tokens per session scan C 33287b42621a

Subscribe to this mod's changes

run-tests is a command published in the GitHub repository circuit-synth/mcp-kicad-sch-api (20 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,263 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.