Lazy Agentic AI Setup Prompt
Copy and paste this guided instruction prompt directly into Cursor Chat, Claude Code, or Windsurf. Your AI agent will automatically configure the MCP server and run the installation:
Please set up the Mustel static analysis MCP server in this workspace:
1. Run `pip install mustel` to install the linter core.
2. Locate or create the MCP configuration file for this editor environment.
3. Add a new server named "mustel" with command "mustel" and args ["serve"] under "mcpServers".
4. Confirm once the server is successfully registered.
Quick Start Guide
Install the Mustel Core
Mustel is distributed as a Python package. We recommend installing it globally using pip so it can be resolved globally by all IDE plugin instances.
pip install mustelBootstrap configurations & hooks
Generate git pre-commit hooks, IDE rule files (.cursorrules, .windsurfrules), and default prompt templates under the active project root directory.
mustel bootstrap Verify scan pipeline
Trigger a local incremental check to verify Ruff rules, Bandit patterns, and local caches are running smoothly. Mustel returns a clean, deduplicated schema JSON.
mustel review .IDE Integration Setup
Mustel exposes a Model Context Protocol (MCP) server so AI-powered editors can call it automatically. Below is the universal JSON configuration, followed by per-editor setup steps.
{ "mcpServers": { "mustel": { "command": "mustel", "args": ["serve"] } }}Cursor
.cursor/mcp.json- 1Open your project root.
- 2Create or edit .cursor/mcp.json.
- 3Paste the MCP JSON config shown below.
- 4Restart the Cursor editor.
Windsurf
~/.codeium/windsurf/mcp_config.json- 1Open a terminal.
- 2Navigate to ~/.codeium/windsurf/.
- 3Create or edit mcp_config.json.
- 4Paste the MCP JSON config shown below.
Claude Code
Terminal command- 1Open a terminal in your project.
- 2Run: claude mcp add mustel mustel serve
- 3The MCP server is now registered.
Claude Desktop
claude_desktop_config.json- 1Open Claude Desktop settings.
- 2Navigate to the MCP configuration file.
- 3Add the MCP JSON config shown below to the mcpServers object.
- 4Restart Claude Desktop.
claude mcp add mustel mustel serveCLI Reference
mustel review [PATH]
Runs static analysis on Python files. It acts as a save-trigger guardrail, scanning code in milliseconds.
| Flag | Description |
|---|---|
--file <PATH> | Target a single file (used primarily for IDE save triggers). |
--no-packages | Skips pip-audit dependency CVE checks for sub-30ms performance. |
--audit | Forces a deep security audit, checking Bandit patterns and dependency vulnerability databases. |
--pretty | Pretty-prints the schema-compliant JSON report. |
mustel env
Outputs a JSON snapshot of the local machine environment. Used by client IDE plugins to dynamically locate Python interpreters and resolve configuration paths.
| Flag | Description |
|---|---|
--pretty | Pretty-print the JSON environment details. |
mustel serve
Spawns the Model Context Protocol (MCP) server over standard I/O (stdin/stdout). Features shebang-aware EOF tracking to shut down automatically if the editor host crashes, preventing background zombie processes.
No additional flags.
mustel bootstrap
Registers configurations. Without flags, it installs shebang-aware git pre-commit hooks and generates prompt files (.cursorrules, .windsurfrules).
| Flag | Description |
|---|---|
--global | Configures MCP global settings for Cursor, Windsurf, Claude Code, and Claude Desktop. |
mustel map [PATH]
Generates a highly compressed structural blueprint of the repository. Traverses folders, AST-parses classes/methods, and serializes docstrings into an indented skeleton under 1,500 tokens (reducing initial onboarding token costs by 95%).
No additional flags.
Architecture & Internals
Under the hood, Mustel is composed of four tightly integrated subsystems. Each is designed for a single responsibility and communicates via schema-compliant JSON payloads.
Two-Tier Cache
mustel/cache.pyMustel's cache validates files by comparing mtime and size file stats. If both match, the cached result is returned instantly — this is Dev Mode (sub-30ms scans). When --audit is passed, cache validation is bypassed for deep dependency checks — this is Audit Mode.
AST Code Map
mustel/code_map.pyThe codebase mapper traverses the file tree, AST-parses Python files, and extracts class structures and method signatures. It serializes this data into a compressed indented skeleton that fits under 1,500 tokens, reducing prompt context overhead by 95%.
JSON Normalizer
mustel/normalizer.pyMultiple linting tools can report overlapping issues. The normalizer deduplicates these reports and maps findings from Ruff, Bandit, and pip-audit into a unified internal schema containing file, line, rule, and message.
MCP Server
mustel serveThe MCP server communicates over standard I/O (stdin/stdout) with the host editor. It implements shebang-aware EOF tracking— if the parent editor process crashes, Mustel detects the closed pipe and shuts itself down, preventing lingering "zombie" processes.
