MCP server for Python analysis with RUFF and VULTURE
## Code Analyzer MCP Server: Static Code Analysis Engine The **Code Analyzer MCP Server** provides comprehensive static code analysis within Google Antigravity, enabling automated detection of bugs, security vulnerabilities, and code quality issues through AI-powered analysis. ### Why Code Analyzer MCP? - **Multi-Language Analysis**: Analyze code in Python, JavaScript, TypeScript, Go, Java, and many more languages - **Security Scanning**: Detect OWASP vulnerabilities, hardcoded secrets, and security anti-patterns - **Code Metrics**: Calculate complexity, maintainability, and other quality metrics automatically - **Custom Rules**: Define project-specific analysis rules for domain-specific requirements - **IDE Integration**: Get real-time feedback as you write code with inline issue highlighting ### Key Features #### 1. Code Analysis ```python from anthropic import Anthropic client = Anthropic() response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Analyze the src/ directory for code quality issues and security vulnerabilities" }] ) ``` #### 2. Metrics Calculation ```python # Calculate code metrics response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Calculate cyclomatic complexity for all functions and identify those exceeding threshold" }] ) ``` #### 3. Security Scanning ```python # Scan for security issues response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Scan codebase for SQL injection, XSS, and other OWASP Top 10 vulnerabilities" }] ) ``` #### 4. Pattern Detection ```python # Find code patterns response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Find all instances of deprecated API usage and suggest modern alternatives" }] ) ``` ### Configuration ```json { "mcpServers": { "code-analyzer": { "command": "npx", "args": ["-y", "@anthropic/mcp-server-code-analyzer"], "env": { "ANALYZER_RULES_PATH": ".analyzer-rules.json", "ANALYZER_SEVERITY_THRESHOLD": "warning" } } } } ``` ### Use Cases **Code Review Automation**: Pre-screen code changes for common issues before human review. **Security Compliance**: Ensure code meets security standards required for compliance certifications. **Technical Debt Assessment**: Identify and quantify code quality issues for prioritization. **Onboarding**: Help new developers understand code quality standards through automated feedback. The Code Analyzer MCP Server brings automated code quality enforcement to your workflow, catching issues early and maintaining high standards consistently.
{
"mcpServers": {
"code-analyzer": {
"mcpServers": {
"code-analyzer": {
"args": [
"mcp-server-analyzer"
],
"command": "uvx"
}
}
}
}
}