slugaudit-mcp
Stores and manages code audit data (projects, files, signatures, dependencies, findings) in a PostgreSQL database, enabling persistent import, status, and briefing operations.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@slugaudit-mcpGenerate a code audit briefing for my project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
slugaudit-mcp
A PostgreSQL-backed code audit system for AI-assisted code reviews. Extracts code signatures and import dependencies from source files using tree-sitter, builds a dependency graph, tracks changes between imports, and generates structured briefings for AI auditors.
Available as both a CLI tool (slugaudit-mcp) and an MCP server (slugaudit-mcp).
Quick Start
# 1. Install dependencies (system packages, Python deps, tree-sitter parsers)
bash setup.sh
# 2. Set up PostgreSQL connection
export PGHOST=localhost
export PGPORT=5432
export PGDATABASE=my_audit_db
export PGUSER=my_user
export PGPASSWORD=my_password
# 3. Import a project (schema auto-creates on first use!)
slugaudit-mcp import /path/to/your/project --project-name "My Project"
# 4. Check project status
slugaudit-mcp status --project "My Project"
# 5. Generate an AI audit briefing
slugaudit-mcp briefing --project "My Project" --output briefing.mdMCP Server Mode (Recommended for AI Assistants)
# Run the MCP server
python3 mcp_server.pyThen in your AI client (Claude Desktop, VS Code, Cursor, Codebuff, etc.), configure the MCP server:
{
"mcpServers": {
"slugaudit-mcp": {
"command": "python3",
"args": ["/path/to/slugaudit-mcp/mcp_server.py"],
"env": {
"PGHOST": "localhost",
"PGPORT": "5432",
"PGDATABASE": "my_audit_db",
"PGUSER": "my_user",
"PGPASSWORD": "my_password"
}
}
}
}Once configured, the AI can use these tools directly:
audit_import— Import a codebaseaudit_brief— Generate an audit briefingaudit_status— Show project statusaudit_changed— List changed filesaudit_list— List all projectsaudit_init_db— Manually initialize schema (usually auto-done)
Related MCP server: Code Expert MCP Server
Architecture
The system follows a layered architecture with clear separation of concerns:
[CLI / MCP] → [Services] → [Repositories] → [Infrastructure]
↓
[Languages] → [Source Files]Package | Role |
| Connection management, input validation, file I/O abstraction |
| Entity models: |
| Data access: |
| Application services: |
| Briefing assembly: data providers + Markdown formatters |
| 8 language extractors with shared |
Commands
Command | Description |
| Initialize the database schema (idempotent) |
| Scan a project, extract signatures/imports, build dependency graph |
| Show project overview (files, signatures, imports, edges, changes) |
| List files changed since last import |
| Generate structured Markdown briefing for AI audit |
| List all projects in the database |
Supported Languages
Language | Detection | Key Features |
Rust |
|
|
Python |
|
|
TypeScript |
|
|
Go |
| Functions, methods, structs, interfaces, imports |
Java |
| Classes, interfaces, enums, records, methods |
C |
| Functions, structs, unions, enums, |
C++ |
| Functions, classes, templates, namespaces |
Ruby |
| Methods, classes, modules, |
Key Concepts
Signature cache: Public API surface of each file stored as JSONB. Lets the AI understand a file's interface without reading its full source.
Dependency edges: File-to-file dependencies resolved from import statements. Enables blast radius computation.
Change detection: SHA-256 hash compared against
last_audited_hash. Only changed files become audit targets.Blast radius: Files that depend on changed files, computed from dependency edges.
Ghost context: Signatures of unchanged files provided for AI reference — reduces token usage by avoiding full source reads.
Configuration
Environment Variables
Variable | Required | Default |
| Yes | — |
| No | 5432 |
| Yes | — |
| Yes | — |
| Yes | — |
| No | — |
Connection String
Override env vars with --connection:
slugaudit-mcp import . --connection "postgresql://user:pass@host:5432/dbname?sslmode=require"Database Schema
All projects share one database. Each project's data is isolated via project_id foreign keys with ON DELETE CASCADE:
Table | Purpose |
| One row per project — the root entity |
| File metadata, hashes, signature cache (JSONB) |
| Import statements extracted from files |
| Resolved file-to-file dependency graph |
| Audit findings with severity, category, location |
| Architecture summaries and layer maps (reserved) |
| Audit configuration per project (reserved) |
| Individual audit execution tracking (reserved) |
| Files that may be stale due to changes (reserved) |
| Raw output from static analysis tools (reserved) |
| Failed ingestion attempts (reserved) |
Workflow
First-time audit
# 1. Import the baseline
slugaudit-mcp import /path/to/project --project-name "My Project"
# 2. Make edits to the codebase...
# 3. Re-import to sync
slugaudit-mcp import /path/to/project
# 4. Generate briefing for changed files
slugaudit-mcp briefing --project "My Project" --output briefing.md
# 5. Feed briefing.md to an AI for auditContinuous audit with MCP
Call
audit_importto scan the projectCall
audit_statusto verify the importAfter code changes, call
audit_importagain to syncCall
audit_briefto get the generated briefingThe AI returns findings directly in conversation
Adding a New Language
Create
languages/yourlang.pyextendingBaseExtractorImplement:
name(),source_extensions(),find_source_files(),extract_signatures(),extract_imports(),resolve_import(),hash_file()Register in
LANG_MAPinlanguages/__init__.pyInstall tree-sitter grammar:
pip install tree-sitter-yourlang
Testing
110 tests using unittest with mocking — no database required:
python3 -m pytest tests/ -v # preferred
python3 -m unittest tests # alternativeCode Quality
# Linting
ruff check .
# Type checking
mypy .
# Pre-commit hooks
pre-commit install
pre-commit run --all-filesConfigured tools: ruff (E/W/F/UP/S/B/C4 rules, line-length=100), mypy (strict mode), pre-commit (trailing-whitespace, end-of-file-fixer, check-yaml, ruff, mypy).
Requirements
Python 3.10+
PostgreSQL 15+ (uses UUID, JSONB,
gen_random_uuid())tree-sitter parsers for each supported language
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SlugThugLabs/SlugAuditTool-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server