{"schemaVersion":1,"id":"avc-87-pyscn","name":"pyscn","locale":"en","canonicalUrl":"https://base.akulich.dev/en/library/avc-87-pyscn/","officialUrl":"https://github.com/ludo-technologies/pyscn","isCatalog":false,"description":"A Python static analyzer that detects duplicates, complex functions, unreachable code, and architectural issues. Creates HTML/JSON reports and provides agent skills and an optional MCP server.","tasks":["Check Python code after AI generation","Find refactoring candidates and circular imports"],"categoryIds":["quality","skills","integrations"],"subcategoryIds":["quality.review","quality.performance","skills.development","integrations.code"],"tags":["Python","Static analysis","MCP"],"aliases":[],"platforms":[],"stack":["Python"],"compatibility":null,"pricing":"free","freeUsage":"The local CLI, skills, and pyscn-mcp are free under MIT and require no LLM/API for analysis itself.","paidUsage":"Polyscan GitHub App is a separate service: the README lists free weekly audit reports for public repositories. Check other workflows' terms separately. Commercial support, integrations, and consulting are available by contacting the developers; the README does not state their costs. An external AI agent may have its own costs.","license":"MIT for pyscn code: use, modification, and distribution are permitted with copyright and permission notices retained. Code is provided without warranties; the hosted App and commercial support have separate terms.","selectionGuide":{"purpose":"Check Python code after AI generation","chooseWhen":["Check Python code after AI generation","Find refactoring candidates and circular imports"],"considerInstead":[],"requirements":["Access to Python source files. Installation is documented through uv/pipx or a ready-made Go binary; the Intel Mac PyPI wheel was removed in v1.5.1, and the README suggests Homebrew or go install. MCP requires a compatible client and a path to pyscn-mcp/uvx."],"limitations":["Costs and limits of free use: Polyscan GitHub App is a separate service: the README lists free weekly audit reports for public repositories. Check other workflows' terms separately. Commercial support, integrations, and consulting are available by contacting the developers; the README does not state their costs. An external AI agent may have its own costs.","Terms of use: MIT for pyscn code: use, modification, and distribution are permitted with copyright and permission notices retained. Code is provided without warranties; the hosted App and commercial support have separate terms."],"faq":[{"question":"What can you use for free in pyscn?","answer":"The local CLI, skills, and pyscn-mcp are free under MIT and require no LLM/API for analysis itself."},{"question":"What additional costs might arise with pyscn?","answer":"Polyscan GitHub App is a separate service: the README lists free weekly audit reports for public repositories. Check other workflows' terms separately. Commercial support, integrations, and consulting are available by contacting the developers; the README does not state their costs. An external AI agent may have its own costs."},{"question":"What terms of use matter for pyscn?","answer":"MIT for pyscn code: use, modification, and distribution are permitted with copyright and permission notices retained. Code is provided without warranties; the hosted App and commercial support have separate terms."},{"question":"Which environment can you use pyscn in?","answer":"pyscn analyzes Python; HTML and JSON are report formats. The engine is built on Go and tree-sitter. For JavaScript/TypeScript, the README refers to other Polyscan analyzers; an HTML report does not mean analysis of HTML/CSS."},{"question":"How do you get started with pyscn?","answer":"For the task “Check Python code after AI generation,” submit a bounded section with its context and criteria for review. A possible first run: pyscn analyze src/ for an HTML report, or pyscn analyze --json --output - src/ for JSON processing. Assess findings by their impact; confirm the problem in the code or a reproducible example. Fix confirmed causes and repeat the same check on the changed result."},{"question":"What should you consider when choosing pyscn?","answer":"The skills support Codex, and MCP exposes the same analysis. Verify static findings before changing or deleting code."},{"question":"Is MCP required for pyscn?","answer":"The MCP server is an optional way to expose analysis to an agent. The CLI produces static reports; skills for coding environments and the Polyscan GitHub App are available separately."},{"question":"How can pyscn be used in CI?","answer":"pyscn check performs a pass/fail check with configurable thresholds, such as --max-complexity 15 and --max-cycles 0; --select chooses analyses. pyscn init creates .pyscn.toml. A possible process: first choose thresholds appropriate to the project, then add check to the pipeline and examine the reasons for each failure separately; a successful quality gate does not replace functional tests."},{"question":"Which architectural problems can pyscn detect?","answer":"The README describes circular imports, layer-rule violations with clean/layered/hexagonal/MVC presets, module communities, CBO coupling, and LCOM4 cohesion. These are structural metrics and candidates for investigation, not proof that every flagged module needs rewriting."},{"question":"How are MCP settings selected?","answer":"pyscn-mcp uses TOML settings. PYSCN_CONFIG specifies an explicit file; without it, discovery proceeds upward from the working directory, prioritizing .pyscn.toml over [tool.pyscn] in pyproject.toml. YAML/JSON and separate home/XDG paths are not searched. An invalid PYSCN_CONFIG does not cause analyze_code to silently switch to another file: this call reports a configuration error."}],"related":[],"sources":["https://github.com/ludo-technologies/pyscn","https://docs.codescan.dev/","https://raw.githubusercontent.com/ludo-technologies/pyscn/HEAD/README.md","https://raw.githubusercontent.com/ludo-technologies/pyscn/HEAD/LICENSE","https://docs.codescan.dev/pyscn/","https://raw.githubusercontent.com/ludo-technologies/pyscn/HEAD/mcp/README.md"]},"selectionCheckedAt":null,"applicationGuide":{"inputs":["A diff or a small section of code, and a description of the expected behavior.","The tech stack version and a reproducible example of the issue or a baseline measurement.","A Python project or source directory; analysis settings in .pyscn.toml or [tool.pyscn] in pyproject.toml. JavaScript/TypeScript are covered by other analyzers in the Polyscan family."],"steps":["For the task “Check Python code after AI generation,” submit a bounded section with its context and criteria for review. A possible first run: pyscn analyze src/ for an HTML report, or pyscn analyze --json --output - src/ for JSON processing.","Assess findings by impact; confirm each issue in the code or a reproducible example.","Fix confirmed causes and repeat the same check on the changed result."],"checks":["Findings identify a specific cause and consequence; unconfirmed assumptions are kept separate.","The improvement is measured or confirmed through behavior; recommendations match the project's version."],"goal":"Example workflow with pyscn: Check Python code after AI generation."},"sources":["https://github.com/ludo-technologies/pyscn","https://docs.codescan.dev/","https://raw.githubusercontent.com/ludo-technologies/pyscn/HEAD/README.md","https://raw.githubusercontent.com/ludo-technologies/pyscn/HEAD/LICENSE","https://docs.codescan.dev/pyscn/","https://raw.githubusercontent.com/ludo-technologies/pyscn/HEAD/mcp/README.md"],"checkedAt":"2026-10-03","reviewScope":"Purpose and published terms were reviewed against the cited primary sources. This product page does not confirm execution or testing in every environment.","relatedIds":[],"dataVersion":"cbbe7123b47a5ae80983","type":"Tool","kind":"tool","pricingNote":"The local CLI, skills, and pyscn-mcp are free under MIT and require no LLM/API for analysis itself. Polyscan GitHub App is a separate service: the README lists free weekly audit reports for public repositories. Check other workflows' terms separately. Commercial support, integrations, and consulting are available by contacting the developers; the README does not state their costs. An external AI agent may have its own costs.","notes":"The skills support Codex, and MCP exposes the same analysis. Verify static findings before changing or deleting code.","labeledSources":[{"url":"https://github.com/ludo-technologies/pyscn","label":"Source code"},{"url":"https://docs.codescan.dev/","label":"Documentation"},{"url":"https://raw.githubusercontent.com/ludo-technologies/pyscn/HEAD/README.md","label":"Official source"},{"url":"https://raw.githubusercontent.com/ludo-technologies/pyscn/HEAD/LICENSE","label":"Code license"},{"url":"https://docs.codescan.dev/pyscn/","label":"Python analyzer documentation"},{"url":"https://raw.githubusercontent.com/ludo-technologies/pyscn/HEAD/mcp/README.md","label":"MCP setup and analyses"}],"licenseGuides":[{"id":"mit","title":"MIT — permissive license","scope":null,"summary":"You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.","url":"https://opensource.org/license/mit"}],"entryIds":[],"composition":null}