pyscn

v1.33.2
io.github.ludo-technologies/pyscn Checked 3 hours ago Published 23 days ago

Python code analysis for AI agents: complexity, dead code, clones, coupling, and a health score.

Values you need

VariableWhat it is
PYSCN_CONFIGoptional Path to a .pyscn.toml configuration file. Defaults to the usual config discovery (.pyscn.toml, then pyproject.toml) starting from the analyzed directory.

PyPI (uvx) verified

Requires uv (https://docs.astral.sh/uv/)

Run in a terminal
claude mcp add pyscn -- uvx pyscn-mcp==1.33.2
Add to claude_desktop_config.json
{
  "mcpServers": {
    "pyscn": {
      "args": [
        "pyscn-mcp==1.33.2"
      ],
      "command": "uvx"
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "pyscn": {
      "args": [
        "pyscn-mcp==1.33.2"
      ],
      "command": "uvx"
    }
  }
}
Add to .vscode/mcp.json
{
  "servers": {
    "pyscn": {
      "args": [
        "pyscn-mcp==1.33.2"
      ],
      "command": "uvx",
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.pyscn]
command = "uvx"
args = ["pyscn-mcp==1.33.2"]

For AI agents

  1. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  2. Restart or reload the client so it starts the server.
  3. Verify: the server should expose these tools: analyze_code, check_cohesion, check_complexity, check_coupling, detect_clones, detect_di_antipatterns, find_dead_code, get_health_score.
  4. If it fails, check that the required runtime is installed (uv (https://docs.astral.sh/uv/)) and that the values above are set.

Machine-readable: install.md · manifest.json