Skip to main content
Glama

Mutmut MCP

mutmut でミューテーションテストを管理するための Model Context Protocol (MCP) サーバーです。このツールは、Python プロジェクトでミューテーションテストを実行し、結果を分析し、テストカバレッジを向上させるためのプログラムから利用できる API 群を提供します。

特徴

  • 任意の Python モジュールまたはパッケージに対してミューテーションテストセッションを実行する

  • ミューテーションテストの全体的な結果と生存ミュータントを表示する

  • テストカバレッジの改善が必要な領域を提案する

  • 特定の生存ミュータントまたはすべての生存ミュータントに対して mutmut を再実行する

  • mutmut キャッシュをクリーンアップする

  • 自動化と他の MCP ツールとの統合を目的として設計されている

Related MCP server: MCP Python Server

インストール

# Run directly from GitHub (no install needed)
uvx --from git+https://github.com/wdm0006/mutmut-mcp mutmut-mcp

# Or install from source
git clone https://github.com/wdm0006/mutmut-mcp
cd mutmut-mcp
uv sync
uv run mutmut_mcp.py

Smithery 経由でのインストール

Smithery 経由で Claude Desktop 用の mutmut-mcp を自動的にインストールするには:

npx -y @smithery/cli install @wdm0006/mutmut-mcp --client claude

MCP クライアント設定

{
  "mcpServers": {
    "mutmut": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/wdm0006/mutmut-mcp", "mutmut-mcp"]
    }
  }
}

API / ツール

以下のツールが利用できます:

  • run_mutmut(target, options="", venv_path=None, project_path=None) – ターゲットに対してミューテーションテストセッションを実行する

  • show_results(venv_path=None, project_path=None) – 全体的な結果を表示する

  • show_survivors(venv_path=None, project_path=None) – 生存ミューテーションを一覧表示し、テストがカバーしていないミュータント用のラベル付きセクションも表示する

  • rerun_mutmut_on_survivor(mutation_id=None, venv_path=None, project_path=None) – 特定の生存ミュータントまたはすべての生存ミュータントに対して mutmut を再実行する

  • clean_mutmut_cache(venv_path=None, project_path=None) – mutmut キャッシュをクリーンアップする

  • show_mutant(mutation_id, venv_path=None, project_path=None) – 特定のミュータントのコード差分と詳細を表示する

  • prioritize_survivors(venv_path=None, project_path=None) – 未カバーのミュータントと生存ミュータントを重要度の推定に基づいてランク付けする

project_path

すべてのツールはオプションの project_path を受け付けます。これは、プロジェクトの mutmut 設定(setup.cfg / pyproject.toml 内の [mutmut] source_paths=)、ソース、テスト、および mutmut の mutants/ 状態ディレクトリを含むディレクトリです。mutmut はそのディレクトリを作業ディレクトリとして実行され、clean_mutmut_cache はその内部の状態のみを削除します。

サーバーがプロジェクトディレクトリから起動されなかった場合(デスクトップ MCP クライアントや uvx では典型的)は、これを渡してください。省略した場合、ツールはサーバープロセスの作業ディレクトリにフォールバックするため、既存の呼び出しは従来どおり動作します。存在しないディレクトリを指す project_path を指定すると、mutmut を実行したり何かを削除したりせずにエラーを返します。

venv_path

venv_path は、プロジェクトの mutmut を含む仮想環境を指します(ツールは <venv>/bin/mutmut を使用し、Windows では <venv>\Scripts\mutmut.exe を使用します)。省略した場合、mutmut は PATH から取得されます。相対パスの venv_path は、両方指定されている場合に project_path を基準に解決されるため、一般的な .venv 形式が機能します:

{ "project_path": "/home/me/src/myproject", "venv_path": ".venv" }

ライセンス

このプロジェクトは MIT ライセンスの下でライセンスされています。詳細は LICENSE を参照してください。

Available Tools

7 tools
clean_mutmut_cacheB

Clean mutmut cache using the mutmut CLI (if available), otherwise remove .mutmut-cache file. Returns the plain text output or confirmation message.

Inputs: venv_path. Returns: result

prioritize_survivorsA

Prioritize surviving mutants by likely materiality, filtering out log/debug-only changes and ranking by potential impact. Returns a sorted list of survivors with reasons for prioritization.

Inputs: venv_path. Returns: object

rerun_mutmut_on_survivorB

Rerun mutmut on specific surviving mutations or all survivors after test updates using the mutmut CLI. Returns the plain text output.

Inputs: mutation_id, venv_path. Returns: result

run_mutmutA

Run a full mutation testing session with mutmut on the specified target.

This tool initiates mutation testing on the given module or package. You can provide additional mutmut options as needed. The output includes a summary of mutations tested, including counts of killed, survived, and timed-out mutations. If a virtual environment path is provided, mutmut will be run using the binaries from that environment to ensure compatibility with project-specific dependencies.

Args: target (str): The module or package to run mutation testing on. options (str): Additional command-line options for mutmut (e.g., '--use-coverage'). Defaults to empty. venv_path (Optional[str]): Path to the project's virtual environment to use for running mutmut. Defaults to None.

Returns: str: Summary of the mutation testing run, or error message if the run fails.

Inputs: target (required), options, venv_path. Returns: result

show_mutantB

Show the code diff and details for a specific mutant using mutmut show. Args: mutation_id (str): The ID of the mutant to show. venv_path (Optional[str]): Path to the virtual environment, if any. Returns: str: The output of 'mutmut show <mutation_id>'.

Inputs: mutation_id (required), venv_path. Returns: result

show_resultsC

Display overall results from the last mutmut run using the mutmut CLI. Returns the plain text output.

Inputs: venv_path. Returns: result

show_survivorsC

List details of surviving mutations from the last mutmut run using the mutmut CLI. Returns the plain text output.

Inputs: venv_path. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a distinct purpose: run_mutmut initiates testing, show_results displays overall results, show_survivors lists survivors, show_mutant shows specific mutant details, rerun_mutmut_on_survivor retests survivors, prioritize_survivors ranks survivors, and clean_mutmut_cache manages cache. There is no overlap or ambiguity in functionality.

    Naming Consistency5/5

    All tools follow a consistent snake_case naming pattern with clear verb_noun structures (e.g., run_mutmut, show_results, clean_mutmut_cache). The naming is predictable and readable throughout the set.

    Tool Count5/5

    With 7 tools, this server is well-scoped for mutation testing with mutmut. Each tool serves a specific role in the workflow, from running tests to analyzing results, without being overly sparse or bloated.

    Completeness5/5

    The tool set provides complete coverage for the mutmut domain: it includes core testing (run_mutmut), result inspection (show_results, show_survivors, show_mutant), survivor management (rerun_mutmut_on_survivor, prioritize_survivors), and maintenance (clean_mutmut_cache). There are no obvious gaps in the mutation testing lifecycle.

    Maintenance

    ActivityActive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      A Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.
      9
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A Python-based implementation of the Model Context Protocol that enables communication between a model context management server and client through a request-response architecture.
      -
    • F
      license
      A
      quality
      Not graded
      maintenance
      A Model Context Protocol server that allows LLMs to interact with Python environments, enabling code execution, file operations, package management, and development workflows.
      9
      -