Integrations¶
CytoScnPy integrates with your development workflow via editor extensions, a language server, and the Model Context Protocol (MCP).
VS Code Extension¶
Get real-time feedback while you code.
Installation¶
- Search for "CytoScnPy" in the VS Code Marketplace.
- Install the extension.
Commands¶
Access via Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
| Command | Description |
|---|---|
CytoScnPy: Analyze Current File | Trigger analysis for the active file. |
CytoScnPy: Analyze Workspace | Analyze all Python files in the workspace. |
CytoScnPy: Calculate Cyclomatic Complexity (cc) | Show complexity metrics for current file. |
CytoScnPy: Calculate Halstead Metrics (hal) | Show Halstead metrics for current file. |
CytoScnPy: Calculate Maintainability Index (mi) | Show MI scores for current file. |
CytoScnPy: Calculate Raw Metrics (raw) | Show LOC, SLOC, and other raw metrics. |
Configuration¶
Customize behavior in VS Code Settings (Ctrl+,):
| cytoscnpy.analysisMode | workspace | Analysis mode: workspace (accurate) or file (fast). | | cytoscnpy.enableSecretsScan | false | Enable scanning for keys/tokens. | | cytoscnpy.enableDangerScan | false | Enable dangerous code patterns scanning. | | cytoscnpy.enableQualityScan | false | Enable code quality metrics scanning. | | cytoscnpy.enableCloneScan | false | Enable clone detection scanning. | | cytoscnpy.confidenceThreshold | 0 | Min confidence (0-100). 0 shows all findings. | | cytoscnpy.excludeFolders | [] | Folders to exclude from analysis. | | cytoscnpy.includeFolders | [] | Folders to force-include in analysis. | | cytoscnpy.includeTests | false | Include test files in analysis. | | cytoscnpy.includeIpynb | false | Include Jupyter Notebooks (.ipynb files). | | cytoscnpy.maxComplexity | 10 | Maximum allowed Cyclomatic Complexity. | | cytoscnpy.minMaintainabilityIndex | 40 | Minimum Maintainability Index. | | cytoscnpy.maxNesting | 3 | Maximum allowed nesting depth. | | cytoscnpy.maxArguments | 5 | Maximum allowed function arguments. | | cytoscnpy.maxLines | 50 | Maximum allowed function lines. | | cytoscnpy.path | "" | Custom path to CLI executable. |
Zed Extension¶
The Zed extension shows CytoScnPy findings as diagnostics in Python files, with quick fixes that remove unused code (one finding, every finding of a kind, or all dead code in the file) or add # noqa comments. It runs the language server below, which it downloads from the latest GitHub release. Like the VS Code extension, it analyzes each project in the workspace folder when you open a Python file, each time you save one and when files change on disk, so code used from another file is not reported as unused. It also offers the VS Code commands (analyze, and the cc, hal, mi and raw metrics) as code actions, shows progress in the status bar, and registers the MCP server as a context server for Zed's agent.
The project's pyproject.toml or .cytoscnpy.toml decides which checks run. The VS Code settings, without the cytoscnpy. prefix, override them in Zed's settings.json, and so does a binary you installed yourself:
{
"lsp": {
"cytoscnpy": {
"settings": { "enableSecretsScan": true, "maxComplexity": 12 },
"binary": { "path": "/usr/local/bin/cytoscnpy", "arguments": ["lsp"] }
}
}
}
See the extension README for troubleshooting.
Language Server (Other Editors)¶
cytoscnpy lsp is a Language Server Protocol server over stdio, so any editor with an LSP client can show CytoScnPy diagnostics and quick fixes. It behaves like the Zed extension: analysis of each project in the client's workspace folders on open, save and file changes (or of the file alone with {"analysisMode": "file"}, and whenever the file is outside every workspace folder), configuration from the project, the VS Code settings (without the cytoscnpy. prefix) from the initialization options or the cytoscnpy workspace configuration section, and the VS Code commands as LSP commands and source code actions. It is part of the standalone CLI binary; the Python package's cytoscnpy command cannot run it.
Neovim (0.11+):
vim.lsp.config("cytoscnpy", {
cmd = { "cytoscnpy", "lsp" },
filetypes = { "python" },
root_markers = { "pyproject.toml", ".cytoscnpy.toml", ".git" },
init_options = { args = { "--secrets", "--danger" } },
})
vim.lsp.enable("cytoscnpy")
Helix (languages.toml; language-servers replaces the default list, so keep the servers you already use):
[language-server.cytoscnpy]
command = "cytoscnpy"
args = ["lsp"]
[[language]]
name = "python"
language-servers = ["pylsp", "cytoscnpy"]
MCP Server (AI Assistants)¶
Enable AI assistants (Claude, Cursor, Copilot) to use CytoScnPy tools.
Note: HTTP/SSE transport is planned for future releases to enable remote analysis. See Roadmap for details.
Important: The MCP server is available in the standalone CLI binary (install script or
cytoscnpy-clibuild). The Pythoncytoscnpypackage does not runmcp-server.
GitHub Copilot¶
The VS Code extension automatically registers the MCP server. Just ask Copilot:
"Run a security scan on this file"
Manual Setup (Claude/Cursor)¶
If not using VS Code, run the server manually using the standalone CLI:
Claude Desktop Config:
{
"mcpServers": {
"cytoscnpy": {
"command": "cytoscnpy",
"args": ["mcp-server", "--root", "/absolute/path/to/project"]
}
}
}
Replace /absolute/path/to/project with the directory the server may analyze. Omit --root only when the client starts the server from that project directory.
Available Tools¶
When connected, CytoScnPy exposes the following tools to Claude/Copilot:
| Tool | Description |
|---|---|
analyze_path | Full analysis on files/directories. (Secrets, Danger, Quality, Taint) |
analyze_code | Analyze a code snippet directly. |
quick_scan | Fast security scan (Secrets & Dangerous patterns). |
cyclomatic_complexity | Calculate complexity metrics for a path. |
maintainability_index | Calculate MI scores (0-100) for a path. |
Configuration¶
Claude Desktop¶
Add to claude_desktop_config.json:
GitHub Copilot (VS Code)¶
Automatically enabled when the VS Code Extension is installed. No extra config needed.
CI/CD Integrations¶
CytoScnPy supports a wide variety of CI/CD environments through structured output formats (JSON, GitLab, SARIF, GitHub Annotations).
GitHub Action¶
The easiest way to integrate CytoScnPy into GitHub Actions is via the official action:
- name: Run CytoScnPy Analysis
uses: djinn-soul/CytoScnPy@v1
with:
args: "--secrets --danger --quality"
Action Inputs:
| Input | Description | Default |
|---|---|---|
path | Path(s) to analyze | . |
args | Additional arguments (e.g., --secrets) | |
version | Version of cytoscnpy to install | latest |
python-version | Version of Python to set up | 3.13 |
Other CI/CD Formats¶
For detailed setup guides and examples for:
- GitLab Code Quality
- GitHub Actions Annotations
- SARIF Security Dashboards
- JUnit Test Reports
See the CI/CD Integration Guide in our User Guide.