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

.claude/commands/dev/publish-pypi.md

publish-pypi is a command for Claude Code from circuit-synth/mcp-kicad-sch-api. It costs 0 tokens per session (1,788 once invoked), scanned A, original, MIT.

A command for building and publishing the MCP KiCAD Schematic API package to PyPI, Python’s package distribution service.

In plain words
What is it for?
Use it to publish a release, choose an automatic or explicit version, upload to Test PyPI, build without uploading, skip tests, or bypass confirmations.
Why use it?
It packages the server for installation with pip and provides controls for versioning, testing, dry runs, and test releases.

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/publish-pypi.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 publish-pypi

README.md
[![agentmods](https://agentmods.dev/badge/commands/circuit-synth/mcp-kicad-sch-api/publish-pypi/github.svg)](https://agentmods.dev/commands/circuit-synth/mcp-kicad-sch-api/publish-pypi)
Your own site
<a href="https://agentmods.dev/commands/circuit-synth/mcp-kicad-sch-api/publish-pypi"><img src="https://agentmods.dev/badge/commands/circuit-synth/mcp-kicad-sch-api/publish-pypi/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for publish-pypi

Your own site · 80×15
<a href="https://agentmods.dev/commands/circuit-synth/mcp-kicad-sch-api/publish-pypi"><img src="https://agentmods.dev/badge/commands/circuit-synth/mcp-kicad-sch-api/publish-pypi.svg" alt="Reviewed on agentmods" width="80" 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,788 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.01788
Opus 5 $0.00000 $0.00894
Sonnet 5 $0.00000 $0.00358
Haiku 4.5 $0.00000 $0.00179

Measured 12d ago against content hash 0fb83f01d1a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

publish-pypi scanned grade A with 0 findings 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 12d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/commands/dev/publish-pypi.md · 229 lines

How it starts

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

Publish to PyPI - MCP KiCAD Schematic API

Usage

/publish-pypi [options]

Description

Builds and publishes the MCP KiCAD Schematic API server package to PyPI, making it available for installation via pip install mcp-kicad-sch-api.

Options

  • --version=auto - Version increment: auto, patch, minor, major, or specific version (e.g., 1.2.3)
  • --test-pypi - Upload to Test PyPI instead of production
  • --dry-run - Build package but don't upload
  • --skip-tests - Skip running tests before publishing
  • --force - Bypass confirmation prompts

Implementation

#!/bin/bash

# Parse arguments
VERSION="auto"
TEST_PYPI=false
DRY_RUN=false
SKIP_TESTS=false
FORCE=false

while [[ $# -gt 0 ]]; do
    case $1 in
        --version=*)
            VERSION="${1#*=}"
            shift
            ;;
        --test-pypi)
            TEST_PYPI=true
            shift
            ;;
        --dry-run)
            DRY_RUN=true
            shift
            ;;
        --skip-tests)
            SKIP_TESTS=true
            shift
            ;;
        --force)
            FORCE=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

# Get current version
CURRENT_VERSION=$(grep 'version = ' pyproject.toml | sed 's/.*version = "\(.*\)".*/\1/')
echo "📋 Current version: $CURRENT_VERSION"

# Calculate new version
if [[ "$VERSION" == "auto" ]]; then
    # Auto-increment patch version
    IFS='.' read -ra ADDR <<< "$CURRENT_VERSION"
    MAJOR="${ADDR[0]}"
    MINOR="${ADDR[1]}"
    PATCH="${ADDR[2]}"
    NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
elif [[ "$VERSION" == "patch" ]]; then
    IFS='.' read -ra ADDR <<< "$CURRENT_VERSION"
    MAJOR="${ADDR[0]}"
    MINOR="${ADDR[1]}"
    PATCH="${ADDR[2]}"
    NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
elif [[ "$VERSION" == "minor" ]]; then
    IFS='.' read -ra ADDR <<< "$CURRENT_VERSION"
    MAJOR="${ADDR[0]}"
    MINOR="${ADDR[1]}"
    NEW_VERSION="$MAJOR.$((MINOR + 1)).0"
elif [[ "$VERSION" == "major" ]]; then
    IFS='.' read -ra ADDR <<< "$CURRENT_VERSION"
    MAJOR="${ADDR[0]}"
    NEW_VERSION="$((MAJOR + 1)).0.0"
else
    NEW_VERSION="$VERSION"
fi

echo "🚀 Publishing version: $NEW_VERSION"

# Confirmation
if [[ "$FORCE" == "false" ]]; then
    read -p "Continue with version $NEW_VERSION? (y/N) " -n 1 -r
    echo
    if [[ ! $REPLY =~ ^[Yy]$ ]]; then
        echo "❌ Cancelled"
        exit 1
    fi
fi

# Run tests first
if [[ "$SKIP_TESTS" == "false" ]]; then
    echo "🧪 Running tests..."
    pytest tests/ -v || { echo "❌ Tests failed"; exit 1; }
    echo "✅ Tests passed"
fi

# Update version in files
echo "📝 Updating version to $NEW_VERSION..."
sed -i.bak "s/version = \".*\"/version = \"$NEW_VERSION\"/" pyproject.toml
sed -i.bak "s/__version__ = \".*\"/__version__ = \"$NEW_VERSION\"/" src/mcp_kicad_sch_api/__init__.py

# Clean up backup files
rm -f pyproject.toml.bak src/mcp_kicad_sch_api/__init__.py.bak

# Build package
echo "📦 Building package..."
python -m build || { echo "❌ Build failed"; exit 1; }

# Validate package
echo "✅ Validating package..."
python -m twine check dist/mcp_kicad_sch_api-$NEW_VERSION* || { echo "❌ Package validation failed"; exit 1; }

if [[ "$DRY_RUN" == "true" ]]; then
    echo "🏁 Dry run completed. Package built but not uploaded."
    echo "📦 Built: dist/mcp_kicad_sch_api-$NEW_VERSION*"
    exit 0
fi

# Upload to PyPI
if [[ "$TEST_PYPI" == "true" ]]; then
    echo "🚀 Uploading to Test PyPI..."
    python -m twine upload --repository testpypi dist/mcp_kicad_sch_api-$NEW_VERSION*
    echo "✅ Uploaded to Test PyPI: https://test.pypi.org/project/mcp-kicad-sch-api/$NEW_VERSION/"
else
    echo "🚀 Uploading to PyPI..."
    python -m twine upload dist/mcp_kicad_sch_api-$NEW_VERSION*
    echo "✅ Uploaded to PyPI: https://pypi.org/project/mcp-kicad-sch-api/$NEW_VERSION/"
fi

# Create git tag
echo "🏷️ Creating git tag..."
git add pyproject.toml src/mcp_kicad_sch_api/__init__.py
git commit -m "Release version $NEW_VERSION"
git tag "v$NEW_VERSION"
git push origin main --tags

echo "🎉 Release $NEW_VERSION completed successfully!"
echo "📦 Install with: pip install --upgrade mcp-kicad-sch-api"

Read the full file on GitHub · 229 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. 12d ago First seen · 229 lines · 0 tokens per session scan A 0fb83f01d1a0

Subscribe to this mod's changes

publish-pypi 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,788 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.