
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A TypeScript MCP server for AI-powered code audits using local Ollama models, covering security, completeness, performance, quality, architecture, testing, and documentation.
MCP Code Audit Server is cataloged as an MCP server attributed to moikas-code. A TypeScript MCP server for AI-powered code audits using local Ollama models, covering security, completeness, performance, quality, architecture, testing, and documentation. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for MCP Code Audit Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Yes, Ollama is listed as a requirement and the server connects to it via a configurable host.
Yes, the priority parameter supports fast mode (security and completeness) or thorough mode covering all audit types.
README.md · 79400dfcb013 · Fetched 2026-11-13 09:09:41 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
AI-powered code auditing using local Ollama models with Model Context Protocol (MCP) integration
A comprehensive TypeScript MCP server that performs intelligent code audits for security, completeness, performance, quality, architecture, testing, and documentation using local AI models via Ollama.
# Install globally from npm
npm install -g @moikas/code-audit-mcp
# Run interactive setup (includes MCP configuration)
code-audit setup
# Or setup with automatic MCP configuration
code-audit setup --auto
# Start the MCP server
code-audit start
# Clone the repository
git clone <repository-url>
cd code-audit-mcp
# Install dependencies
npm install
# Build the package
npm run build
# Test locally
npm run test-local
.vscode/extensions.json for extensions)# Clone and enter directory
git clone https://github.com/warrengates/code-audit-mcp.git
cd code-audit-mcp
# Install dependencies (includes husky setup)
npm install
# Build the project
npm run build
# Run quality checks
npm run quality-check
# Test the setup
npm run test-local
This project uses Husky and lint-staged for automatic code quality checks:
Pre-commit hooks run automatically on git commit. To manually run quality checks:
# Run all quality checks
npm run quality-check
# Fix auto-fixable issues
npm run quality-fix
# Individual checks
npm run lint # ESLint check
npm run format:check # Prettier check
npm run type-check # TypeScript check
The setup script will:
If you prefer manual installation:
# Install dependencies
npm install
# Install essential models
ollama pull codellama:7b
ollama pull granite-code:8b
# Build the project
npm run build
# Test the server
npm run dev
# Interactive setup wizard
code-audit setup
# Start MCP server (foreground)
code-audit start
# Start as background daemon
code-audit start --daemon
# Stop running server
code-audit stop
# Check system health
code-audit health
# Manage AI models
code-audit models --list
code-audit models --pull codellama:7b
# Configuration management
code-audit config --show
code-audit config --set ollama.host=http://remote:11434
# MCP server management
code-audit mcp status
code-audit mcp configure
code-audit mcp remove
# Check for updates
code-audit update
# Development mode with hot reload
npm run dev
# Build TypeScript
npm run build
# Test package locally
npm run test-local
The setup wizard now automatically configures code-audit as an MCP server:
# Configure during setup
code-audit setup
# Or configure after installation
code-audit mcp configure
This will automatically add code-audit to:
~/Library/Application Support/Claude/claude_desktop_config.json~/.config/claude/mcp-settings.json.claude/mcp-settings.jsonIf you prefer manual configuration, add to your MCP configuration:
{
"mcpServers": {
"code-audit": {
"command": "code-audit",
"args": ["start", "--stdio"],
"env": {}
}
}
}
For more details, see:
audit_code - Main audit tool{
"name": "audit_code",
"arguments": {
"code": "function processPayment(amount) {\n const query = `SELECT * FROM users WHERE id = ${userId}`;\n // TODO: implement payment logic\n}",
"language": "javascript",
"auditType": "all",
"priority": "thorough",
"context": {
"framework": "express",
"environment": "production",
"performanceCritical": true,
"projectType": "api"
}
}
}
Parameters:
code (required): Code to auditlanguage (required): Programming languageauditType: security | completeness | performance | quality | architecture | testing | documentation | allpriority: fast (security + completeness only) | thorough (all audit types)context: Additional context for framework-specific analysismaxIssues: Limit number of issues returned (default: 50)health_check - Server health status{
"name": "health_check",
"arguments": {}
}
list_models - Available AI models{
"name": "list_models",
"arguments": {}
}
Create a configuration file or use environment variables:
const config = {
name: 'code-audit-mcp',
version: '1.0.0',
ollama: {
host: 'http://localhost:11434',
timeout: 30000,
retryAttempts: 3,
retryDelay: 1000,
},
auditors: {
security: {
enabled: true,
severity: ['critical', 'high', 'medium'],
rules: {
sql_injection: true,
xss_vulnerability: true,
hardcoded_secret: true,
},
},
performance: {
enabled: true,
severity: ['high', 'medium', 'low'],
thresholds: {
cyclomaticComplexity: 10,
nestingDepth: 4,
},
},
},
logging: {
level: 'info',
enableMetrics: true,
enableTracing: false,
},
};
Each auditor can be individually configured:
{
enabled: boolean; // Enable/disable auditor
severity: Severity[]; // Severity levels to include
rules: Record<string, boolean>; // Specific rules to enable/disable
thresholds: Record<string, number>; // Numeric thresholds
}
Configure model preferences for different scenarios:
// Performance-critical code
const performanceConfig = {
strategy: 'PerformanceModelSelectionStrategy', // Always prefer fast models
fallbackModels: ['codellama:7b', 'granite-code:8b'],
};
// Quality-focused analysis
const qualityConfig = {
strategy: 'QualityModelSelectionStrategy', // Always prefer accurate models
fallbackModels: ['deepseek-coder:33b', 'codellama:13b'],
};
# Essential models (~7GB)
ollama pull codellama:7b
ollama pull granite-code:8b
# Comprehensive setup (~30GB)
ollama pull codellama:13b
ollama pull deepseek-coder:6.7b
ollama pull starcoder2:7b
ollama pull qwen2.5-coder:7b
# Full setup (~80GB)
ollama pull deepseek-coder:33b
ollama pull starcoder2:15b
ollama pull llama3.1:8b
{
"requestId": "audit_12345",
"issues": [
{
"id": "sql_injection_2",
"location": { "line": 2, "column": 15 },
"severity": "critical",
"type": "sql_injection",
"category": "security",
"title": "SQL injection vulnerability in query construction",
"description": "Direct string interpolation in SQL query allows SQL injection attacks",
"suggestion": "Use parameterized queries or prepared statements",
"confidence": 0.95,
"fixable": true,
"ruleId": "SEC001",
"documentation": "OWASP Top 10: A03:2021 – Injection"
},
{
"id": "todo_3",
"location": { "line": 3 },
"severity": "medium",
"type": "todo_comment",
"category": "completeness",
"title": "TODO comment indicates incomplete implementation",
"description": "Found TODO comment: // TODO: implement payment logic",
"suggestion": "Implement the missing functionality or remove the TODO comment",
"confidence": 1.0,
"fixable": false,
"ruleId": "COMP001"
}
],
"summary": {
"total": 2,
"critical": 1,
"high": 0,
"medium": 1,
"low": 0,
"info": 0,
"byCategory": {
"security": 1,
"completeness": 1
}
},
"suggestions": {
"autoFixable": [
/* fixable issues */
],
"priorityFixes": [
/* critical/high severity */
],
"quickWins": [
/* low effort, high impact */
],
"technicalDebt": [
/* long-term improvements */
]
},
"metrics": {
"duration": 1250,
"modelResponseTime": 800,
"coverage": {
"linesAnalyzed": 15,
"functionsAnalyzed": 1,
"complexity": 3
}
}
}
{
"auditType": "all",
"priority": "fast" // Only security + completeness
}
{
"context": {
"framework": "react",
"environment": "production",
"performanceCritical": true,
"projectType": "web"
}
}
{
performance: {
maxConcurrentAudits: 3,
cacheEnabled: true,
cacheTtl: 300 // 5 minutes
}
}
This project includes comprehensive VS Code configuration for optimal development experience:
Install recommended extensions for the best experience:
# Install all recommended extensions
code --install-extension dbaeumer.vscode-eslint
code --install-extension esbenp.prettier-vscode
code --install-extension ms-vscode.vscode-typescript-next
code --install-extension usernamehw.errorlens
code --install-extension yoavbls.pretty-ts-errors
Or open VS Code and accept the workspace recommendations popup.
The .vscode/settings.json includes:
Use the included debug configurations:
Press F5 or use the Debug panel to start debugging.
code-audit-mcp/
├── src/
│ ├── server.ts # Main MCP server
│ ├── types.ts # TypeScript interfaces
│ ├── auditors/ # Audit implementations
│ │ ├── base.ts # Base auditor class
│ │ ├── security.ts # Security auditor
│ │ ├── completeness.ts # Completeness auditor
│ │ ├── performance.ts # Performance auditor
│ │ └── ...
│ ├── ollama/ # Ollama integration
│ │ ├── client.ts # HTTP client wrapper
│ │ ├── models.ts # Model configuration
│ │ └── prompts.ts # Audit prompts
│ └── utils/ # Utilities
│ ├── codeParser.ts # Code parsing
│ ├── complexity.ts # Complexity analysis
│ └── logger.ts # Logging utilities
├── cli/
│ └── setup.ts # Setup script
├── .vscode/ # VS Code configuration
│ ├── settings.json # Workspace settings
│ ├── extensions.json # Recommended extensions
│ └── launch.json # Debug configurations
├── .husky/ # Git hooks
│ └── pre-commit # Pre-commit checks
└── tests/ # Test suites
# Development
npm run dev # Start with hot reload
npm run build # Compile TypeScript
npm run lint # Run ESLint
npm run format # Format with Prettier
# Testing
npm test # Run test suite
npm run test:watch # Watch mode
npm run test:coverage # Coverage report
# Production
npm run start # Start production server
BaseAuditor:import { BaseAuditor } from './base.js';
export class CustomAuditor extends BaseAuditor {
constructor(config, ollamaClient, modelManager) {
super('custom', config, ollamaClient, modelManager);
}
// Override methods for custom logic
protected async postProcessIssues(rawIssues, request, language) {
// Custom post-processing
return super.postProcessIssues(rawIssues, request, language);
}
}
auditors/index.ts:import { CustomAuditor } from './custom.js';
export const auditorClasses = {
// ... existing auditors
custom: CustomAuditor,
};
const config = {
auditors: {
custom: {
enabled: true,
severity: ['high', 'medium'],
rules: {},
},
},
};
# Check if Ollama is running
ollama list
# Start Ollama service
ollama serve
# Check port availability
curl http://localhost:11434/api/tags
# List installed models
ollama list
# Install missing model
ollama pull codellama:7b
# Check model availability in server
curl -X POST http://localhost:11434/api/generate \
-H "Content-Type: application/json" \
-d '{"model": "codellama:7b", "prompt": "test"}'
# Clear build cache
rm -rf dist/
rm -rf node_modules/
npm install
# Check TypeScript configuration
npx tsc --noEmit
# Update dependencies
npm update
# Check available memory
free -h
# Use smaller models
ollama pull codellama:7b # Instead of codellama:34b
# Reduce concurrent audits
{
"performance": {
"maxConcurrentAudits": 1
}
}
// For CI/CD environments - prioritize speed
const ciConfig = {
strategy: 'PerformanceModelSelectionStrategy',
priority: 'fast',
};
// For code review - prioritize accuracy
const reviewConfig = {
strategy: 'QualityModelSelectionStrategy',
priority: 'thorough',
};
{
ollama: {
timeout: 60000, // Increase for large files
retryAttempts: 5, // More retries for reliability
healthCheckInterval: 30000 // More frequent health checks
},
performance: {
maxConcurrentAudits: 2, // Reduce for limited RAM
cacheEnabled: true, // Enable for repeated analysis
cacheTtl: 600 // 10-minute cache
}
}
interface AuditRequest {
code: string; // Required: Code to audit
language: string; // Required: Programming language
auditType: AuditType; // Optional: Default 'all'
file?: string; // Optional: File path for context
context?: AuditContext; // Optional: Additional context
priority?: 'fast' | 'thorough'; // Optional: Default 'thorough'
maxIssues?: number; // Optional: Default 50
includeFixSuggestions?: boolean; // Optional: Default true
}
interface AuditResult {
requestId: string;
issues: AuditIssue[];
summary: AuditSummary;
coverage: AuditCoverage;
suggestions: AuditSuggestions;
metrics: AuditMetrics;
model: string;
timestamp: string;
version: string;
}
| Code | Description | Resolution |
|---|---|---|
INVALID_REQUEST | Malformed request | Check required parameters |
CODE_TOO_LARGE | Code exceeds size limit | Split into smaller chunks |
LANGUAGE_NOT_SUPPORTED | Unsupported language | Use supported language |
NO_AVAILABLE_MODEL | No suitable model found | Install required models |
OLLAMA_UNAVAILABLE | Ollama service down | Start Ollama service |
MODEL_NOT_FOUND | Requested model missing | Pull model with ollama pull |
GENERATION_FAILED | AI generation failed | Check model health, retry |
AUDIT_FAILED | General audit failure | Check logs, verify configuration |
We welcome contributions! Please see our Contributing Guidelines for details.
# Fork and clone the repository
git clone https://github.com/your-username/code-audit-mcp.git
cd code-audit-mcp
# Install dependencies
npm install
# Run in development mode
npm run dev
# Run tests
npm test
# Submit a pull request
MIT License - see LICENSE for details.
Built with ❤️ for better code quality through AI-powered analysis
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for MCP Code Audit Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/code-audit-ollama)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.