Skip to main content

komainu-mcp

Thin stdio MCP server for KomAInu: it speaks MCP to your editor and calls your hosted KomAInu HTTP API only. It does not connect to any database.

Prerequisites

  • uv installed (recommended), or another Python 3.11+ environment.
  • A running KomAInu API with /tools/* routes and (after migration) the mcp_access_token table.

Authentication

GET /tools/* requires Authorization: Bearer <token> where <token> is either:

  1. KomAInu MCP token — prefix kmcp_…, created from the web app (MCP page → Add to Cursor, or POST /mcp/tokens / POST /mcp/tokens/cursor-install with your normal Firebase ID token). Only a hash is stored server-side; you cannot impersonate another user by editing a UUID in config.
  2. Firebase ID token — same token the web app uses for API calls (short-lived; refresh as your session renews).

Environment variables

Variable Required Description
KOMAINU_API_BASE_URL Yes Base URL of the KomAInu API, e.g. https://YOUR-API-URL (no trailing slash).
KOMAINU_ACCESS_TOKEN Yes MCP token (kmcp_…) or Firebase ID token, sent as Authorization: Bearer ….
KOMAINU_TESTS_ROOT For pipeline tools Local root directory containing test files. Pipeline tools upload this entire folder to KomAInu before traceability/coverage jobs. The web app may show <YOUR-TEST-FOLDER-LOCAL-PATH> until you set a real path.

Local development against a machine-run API:

export KOMAINU_API_BASE_URL=http://127.0.0.1:8000
export KOMAINU_ACCESS_TOKEN=kmcp_your_secret_from_web_or_curl
export KOMAINU_TESTS_ROOT='<YOUR-TEST-FOLDER-LOCAL-PATH>'

Cursor

Cursor Settings → MCP (or your MCP JSON). Example:

{
  "mcpServers": {
    "komainu": {
      "command": "uvx",
      "args": ["komainu-mcp"],
      "env": {
        "KOMAINU_API_BASE_URL": "https://YOUR-API-URL",
        "KOMAINU_ACCESS_TOKEN": "kmcp_…",
        "KOMAINU_TESTS_ROOT": "<YOUR-TEST-FOLDER-LOCAL-PATH>"
      }
    }
  }
}

This runs the latest PyPI release, like the KomAInu web MCP page. Pin with komainu-mcp@<version> if you need a fixed one. If uvx is missing, install uv.

Claude Code

Claude Code MCP: prefer claude mcp add over hand-editing config.

From the KomAInu repo:

export KOMAINU_API_BASE_URL=https://YOUR-API-URL
export KOMAINU_ACCESS_TOKEN=kmcp_…
export KOMAINU_TESTS_ROOT='<YOUR-TEST-FOLDER-LOCAL-PATH>'
bash scripts/add-komainu-mcp-claude.sh

Override the PyPI pin if needed: export KOMAINU_MCP_SPEC=komainu-mcp@… (default: latest release).

All projects: CLAUDE_MCP_SCOPE=user bash scripts/add-komainu-mcp-claude.sh. Direct equivalent (same shape as Generate manual config on the web MCP page):

claude mcp add komainu --transport stdio \
  -e KOMAINU_API_BASE_URL='https://YOUR-API-URL' \
  -e KOMAINU_ACCESS_TOKEN='kmcp_…' \
  -e KOMAINU_TESTS_ROOT='<YOUR-TEST-FOLDER-LOCAL-PATH>' \
  -- uvx komainu-mcp

For user scope (all projects): add --scope user on the line after --transport stdio.

claude mcp list / claude mcp remove komainu to verify or replace.

Manual

  • Other MCP clients: same as Cursor — uvx, komainu-mcp@… (or komainu-mcp), same env.
  • uvx cache: not the project venv; refresh with uv cache clean komainu-mcp. See CLI below for uv tool / uv pip differences.

Bundled skills (MCP resources)

komainu-mcp ships orchestration guides as MCP resources — no extra download. Full documentation:

Entry URI / name Purpose
Resource komainu://skill/requirement-coverage-from-changes After code changes: scope git diff, pick affected requirements, approve pipeline work, write/fix tests from correction briefs
Resource komainu://skill/write-tests Write case-focused tests, run locally, triage red outcomes (product bug vs bad test)
Prompt cover_changes (optional base_ref) Same as the coverage-from-changes skill; slash command in Claude Code

Typical user request: “I changed a lot of code — help me cover the spec.” See cover-changes workflow.

Tools

Read-only: list_all_requirements, get_requirement_coverage, get_requirement_coverage_for_correction, get_coverage_summary.

Pipeline (require explicit user approval; each uploads KOMAINU_TESTS_ROOT first): run_requirement_analysis, run_requirement_mapping, rerun_requirement_coverage, start_requirement_coverage_rerun (background variant of rerun — returns a job_id immediately, track progress in the web app).

Local test folder sync

There are no separate sync_push_* MCP tools. Uploading the local test tree happens inside the pipeline tools above via POST /workspace/tests/sync (same behaviour as uploading the test folder on the KomAInu setup page). Configure KOMAINU_TESTS_ROOT to your local tests root.

CLI

komainu-mcp --help
komainu-mcp --version

Running komainu-mcp without arguments starts the stdio MCP server: it waits on stdin for your editor’s MCP client. In a bare terminal it looks “stuck” with no output — that is normal. Use --help to print usage without blocking.

If --help also appears to hang, you likely have an old komainu-mcp (no CLI flags). Upgrade: uv pip install -U 'komainu-mcp>=1.1.10' then try again.

Equivalent:

python -m komainu_mcp

uvx and uninstall: uvx does not install into your project venv; it uses uv’s cache. There is no uvx uninstall. To clear downloads for this package: uv cache clean komainu-mcp. Use uv tool uninstall komainu-mcp only if you installed via uv tool install.

Publishing a new version (maintainers, manual)

PyPI project name: komainu-mcp. One-time setup: create that project on pypi.org and generate an API token scoped to it (Account settings → API tokens).

For each release:

  1. Bump the version in komainu-mcp/pyproject.toml ([project].version). PyPI does not allow re-uploading the same version number.

  2. Build from the repository root (mono-repo):

    uv build --package komainu-mcp --out-dir komainu-mcp/dist --clear
    

    This writes the sdist and wheel under komainu-mcp/dist/.

  3. Upload to PyPI with your token (do not commit the token):

    UV_PUBLISH_TOKEN=pypi-xxxxxxxx uv publish komainu-mcp/dist/*
    

    Alternatively: uv publish -t pypi-xxxxxxxx komainu-mcp/dist/*.

  4. Verify on https://pypi.org/project/komainu-mcp/ and, if needed, test with uvx komainu-mcp@<new-version>.

If the upload fails because the version already exists, bump version again and repeat from step 2.

Metadata

Release files for komainu-mcp 1.1.27

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for komainu-mcp 1.1.27
File Size Uploaded Provenance
komainu_mcp-1.1.27.tar.gz 20.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for komainu-mcp 1.1.27
File Interpreter ABI Platform
komainu_mcp-1.1.27-py3-none-any.whl Python 3 none any Details

Total release size: 40.7 kB

Release files / komainu_mcp-1.1.27.tar.gz

Download URL komainu_mcp-1.1.27.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c7a662ad6686c34c4dddee4de62b12b915f3ba3744e9bc0c74d8788f2fd1014e
BLAKE2b-256 checksum
How to use checksums
ef1c2cf7de48ec3914af86e79b49f33846bbb73b594fb38b1a390edfb1f694d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / komainu_mcp-1.1.27-py3-none-any.whl

Download URL komainu_mcp-1.1.27-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9c14c7df1011dca54eba9e3542c8703445d3c06b6cd0fe3d7622e6a6a627de4
BLAKE2b-256 checksum
How to use checksums
b419a7e439372804aca66e5c92474e2d6eecd8fa7b529abb38859c31d56186c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for komainu-mcp 1.1.27

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page