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
High-performance, zero-bloat repository intelligence for AI coding agents.
Stop burning 80% of your AI agent's context window on repetitive file scans.
SlugAudit indexes your codebase once, verifies freshness in sub-milliseconds on every keystroke, and arms your AI agent with queryable SQL and Tree-sitter AST tools. Your agent spends zero tokens on file rediscovery and 100% of its context on deep reasoning.
⚡ The Problem: Why AI Code Audits Fail
When you ask an AI coding agent to inspect or audit a codebase, it typically resorts to brute force:
It lists directories and reads 40+ entire files looking for symbol definitions and call sites.
It burns 100,000+ context tokens before writing a single line of analysis.
As the context window fills up, the agent hits compaction, forgets earlier files, hallucinates stale paths, and enters paranoid re-validation loops.
Audit Metric | Without SlugAudit ❌ | With SlugAudit ⚡ |
Context Cost | 50,000–150,000+ tokens burned reading whole files | ~400 tokens (returns only relevant symbols & AST spans) |
Search Latency | 15–60 seconds of slow disk I/O & file reading | < 2 ms directly from SQLite WAL & Tree-sitter |
Freshness Guarantee | Stale caches; agent hallucinations on edited files | 100% Guaranteed Fresh: Synchronous atomic reconcile on every read |
Safety & Integrity | Script execution risks, unbounded write surfaces | Hardened Read-Only: |
Session Isolation | Old agent notes contaminate future runs | Zero Contamination: Session-scoped findings auto-purged on restart |
Related MCP server: Code Expert MCP Server
🏗️ How It Works
SlugAudit acts as an invisible, high-speed telemetry and evidence layer between your filesystem and your AI agent over the standard Model Context Protocol (MCP):
graph LR
subgraph Host ["Your Machine"]
Repo["Source Code"]
Watcher["File Watcher (inotify/kqueue)"]
end
subgraph SlugAudit ["SlugAudit MCP Engine"]
TS["Tree-Sitter AST & BLAKE3 Hasher"]
CAS["Atomic CAS Publishing"]
DB[("Disposable SQLite Index\n.planning/slugaudit/project.db")]
Guards["Read-Only Authorizer & Subquery Wrappers"]
end
subgraph Agent ["AI Coding Agent"]
Client["Claude Code · Cursor · Codex · Hermes · Windsurf · Bob · Grok"]
end
Repo --> Watcher
Repo --> TS
TS --> CAS --> DB
DB --> Guards --> ClientDiscovery & Hash: Respects
.gitignoreand.ignorerecursively, walks the repo in milliseconds, and hashes files with BLAKE3.Deep AST Extraction: Runs Tree-sitter across 300+ languages to index functions, methods, imports, call hierarchies, comments, and syntax diagnostics.
Atomic CAS Publish: Commits the entire index into an ephemeral SQLite database in
.planning/slugaudit/project.dbusing compare-and-swap (CAS) concurrency control.Sub-millisecond Reconcile: Background watcher detects file edits. Every tool call verifies freshness synchronously before returning results—zero chance of stale data.
Precise SQL & AST Tools: The AI agent queries exact facts (
files,evidence,revisions) without ever touching the disk.
🎯 The Division of Labor
SlugAudit gathers facts: indexes, extracts, synchronizes, and searches.
The AI does the audit: interprets evidence, spots logic bugs, judges security implications, and refactors code.
SlugAudit does not judge code, assign arbitrary "scores", or tell your AI what to think. It provides ground truth so your AI can do real engineering.
🚀 Quick Start
1. Fast Install
# One-line universal installer (Linux x86_64 or builds via cargo):
curl -fsSL https://raw.githubusercontent.com/SlugThugLabs/slugaudit/main/install.sh | bash
# Or build locally from source with Cargo:
cargo install --path .
# Or run the interactive setup menu:
slugaudit menu2. Connect Your AI Agent (One-Click)
SlugAudit automatically configures your favorite AI coding assistant:
slugaudit connect agy # Antigravity (agy mcp add)
slugaudit connect gemini # Gemini CLI (gemini mcp add)
slugaudit connect claude # Claude Code (~/.claude.json)
slugaudit connect cursor # Cursor IDE (~/.cursor/mcp.json)
slugaudit connect codex # Codex CLI (~/.codex/config.toml)
slugaudit connect hermes # Hermes Agent(Run slugaudit connect without arguments to auto-detect installed agents interactively from your terminal).
To disconnect: slugaudit disconnect <agent> or pick from slugaudit disconnect.
3. Ask Your Agent Anything
Start a normal session with your agent and ask:
"Audit our authentication flow. Are token expiration checks enforced on every endpoint?"
Your agent will call report, query, and structure in the background—answering with exact line ranges in milliseconds without flooding your context.
🔌 Supported AI Agents & Editors
AI Client / Editor | Setup Command / Config | Scope | Status |
Antigravity (agy) |
| Native CLI ( | ✅ Native |
Gemini CLI |
| Native CLI ( | ✅ Native |
Claude Code |
| Global ( | ✅ Native |
Cursor |
| Global ( | ✅ Native |
Windsurf |
| Global ( | ✅ Native |
Trae AI IDE |
| Global ( | ✅ Native |
OpenCode |
| User config ( | ✅ Native |
Hermes Agent |
| Global CLI ( | ✅ Native |
Codex |
| Global ( | ✅ Native |
GitHub Copilot CLI |
| Global CLI ( | ✅ Native |
Bob |
| Global ( | ✅ Native |
Grok |
| User Scope ( | ✅ Native |
Zed Editor |
| User settings ( | ✅ Native |
Pi / Oh My Pi |
| User config ( | ✅ Native |
1MCP / OpenHands |
| Native CLI | ✅ Native |
Other MCP Clients |
| JSON snippet for any client | ✅ Standard |
🛠️ The 7 Native MCP Tools
Tool | Capability | Example AI Query |
| High-level project shape, file counts, language distribution, and syntax diagnostics. |
|
| High-speed read-only SQL queries against the indexed repository. |
|
| Tree-sitter AST queries across 300+ languages (supports single-file or multi-file search with lean snippets). |
|
| Store AI-reviewed conclusions bound to the file content hash. | Auto-invalidates if the underlying source lines change. |
| Session-gated finding retrieval (prevents cross-session hallucination). | Read only findings created by the current agent. |
| Project enable/disable and cache management. |
|
| Real-time watcher status, sync latency ( | Operational snapshot without side effects. |
🎯 Context Optimization: Lean Results vs. Full Output
SlugAudit follows a "Results First, Full Code On-Demand" model to prevent burning the agent's context window while ensuring no data is ever hidden from an audit:
AST Pattern Search (
structure):Multi-File Search: Omit
fileto search across all files of a given language (optionally filtered bypattern, e.g."src/**/*.rs"). Defaults to lean 1-line preview snippets (full_text: false, max 120 bytes) with exactstart_line/end_lineand column coordinates.Single-File Search: Specify
fileto inspect a targeted file. Defaults to full AST code blocks (full_text: true, up to 1 MiB / 1,000,000 bytes).Explicit Control: The agent can pass
"full_text": falsefor compact coordinate-only sweeps across any scope, or"full_text": trueto pull complete code blocks.
SQL Queries (
query):Selective Projection: The agent queries only what it needs (e.g.
SELECT path, line_number FROM evidence WHERE ...) to stay lean, orSELECT contentwhen full source text is required.Paging with
next_offset: Results are capped at 500 rows and up to 256 MiB+ per page (dynamically scaled to host RAM). Whentruncated: true,next_offsetis provided so the agent can page through the entire dataset without context overflow.
🎛️ Profiles & Adaptive Host Memory
SlugAudit never imposes artificial barriers on codebases. Following the design standards of CodeQL and Semgrep, it dynamically scales resource limits to match the host hardware:
Adaptive(Default): Automatically detects physical and available host RAM (/proc/meminfoon Linux,sysctlon macOS). Dynamically scales import caches and per-file caps (up to 1 GiB single-file limit, half of available RAM for total project imports).Audit: Deep audit mode for massive enterprise repos (256 MiB per-file cap, 32 GiB total import budget, 60s execution budgets).Lean: Lightweight mode for resource-constrained environments (32 MiB per-file cap, 2 GiB total import budget, 10s execution budgets).
How to Configure:
In-Repo Project Config: Add
.planning/slugaudit/config.jsonto the audited repository:{ "profile": "audit" }MCP Tool Control: Agents can select or change profiles on the fly:
{ "name": "project_control", "arguments": { "action": "on", "profile": "audit" } }Environment Overrides: Set
SLUGAUDIT_PROFILE=auditor tune granular variables (e.g.SLUGAUDIT_MAX_FILE_BYTES=536870912).
⚡ Performance Benchmarks
Measured on standard development hardware (AMD Ryzen 9 / Linux kernel 6.x):
Operation | Benchmark / Metric | Latency / RSS |
Repository Discovery | Walk & BLAKE3 hash 200 files | 4.2 ms |
Cold Tree-Sitter AST Parse | Full syntax extraction (Rust grammar) | 370 µs |
SQL Query Latency | General query + subquery authorizer | < 1.0 ms |
Incremental Reconcile | Hot reload dirty file on keystroke | < 8.0 ms |
Memory Footprint | Peak RSS during heavy repository sync | 26.9 MiB |
Code Safety | Crate-wide | 0 unsafe blocks |
📖 Query Cookbook & Recipes
Ready-to-run queries for AI agents and security auditors in examples/queries/:
Auth Attack Surface: Map all authentication, token, and session endpoints in < 2ms.
Find Unhandled Panics: Pinpoint crash-prone
.unwrap(),.expect(), andpanic!()calls.Syntax Diagnostics: Extract parser errors and syntax issues without running a compiler.
Rust AST Matcher: Tree-sitter query matching exact function shapes and parameter blocks.
Product boundary
The single end-user product is the slugaudit binary. Users install and
configure it with their AI agent, and the binary operates on the user's own
projects.
For each enabled user project, SlugAudit owns only this derived-data directory:
<user-project>/.planning/slugaudit/project.dbThe surrounding .planning/ directory belongs to the user's project workflow.
Its other files are ordinary user project data and may be indexed normally.
SlugAudit excludes its own .planning/slugaudit/ directory from discovery.
The database is disposable derived data — delete it and any tool call rebuilds it from source.
Repository scope
See DEVELOPMENT_SCOPE.md for the distinction between this repository's development materials and the runtime behavior of SlugAudit inside a user's project.
Repository Structure & The .planning/ Directory
All architectural blueprints, design decisions, and runtime index data live inside .planning/:
Source of Truth:
.planning/ARCHITECTURE.mdis the canonical, authoritative source of truth for the codebase. It details the complete module map, data flow, process lifecycle, security boundaries, and the 10 core architectural invariants governing SlugAudit.Design & Planning History:
.planning/archive/preserves historical planning records, architectural decision logs, and dependency inventories.Disposable Runtime Cache:
.planning/slugaudit/project.dbhouses the SQLite index and evidence tables. This is derived data that SlugAudit automatically creates and synchronizes—it can be deleted at any time and any tool call will rebuild it from source.
Keeping these artifacts organized inside .planning/ keeps the repository root uncluttered while providing both human developers and AI coding agents a dedicated, structured home for all architecture and design documentation.
Documentation
Architecture — the authoritative architectural specification (module map, data flow, security model, design FAQ)
Connection guides — agent-specific setup for Bob, Claude Code, Grok, and Codex
Archive — historical planning docs, decision log, dependency inventory
Development
Requires Rust 1.97.1+ (edition 2024) on Linux or macOS. Run the same gates CI uses:
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --lib --bins --tests --all-features
cargo run --quiet --bin check_source_limits --locked
cargo run --quiet --bin check_docs_drift --locked
cargo run --quiet --bin check_no_duplicates --locked#![forbid(unsafe_code)] is enforced crate-wide. Zero unsafe in src/.
Structured Logging
Diagnostics log to stderr with ANSI colors disabled by default. For automated log aggregators (e.g. Datadog, Grafana Loki, CloudWatch), set:
export SLUGAUDIT_LOG_FORMAT=jsonAll stderr events will be formatted as single-line JSON while stdout remains strictly JSON-RPC.
License
SlugAudit is free to use — including for your own commercial software.
Use it to develop, audit, test, and maintain whatever you build, and you may
sell the software you create with it. Software you make using SlugAudit (and
the results it produces) does not become subject to SlugAudit's license just
because the tool was used.
The only thing you need to contact us about (admin@slugthuglabs.dev) is
distributing SlugAudit itself — for example embedding, bundling,
redistributing, sublicensing, or selling the tool as part of another product
or service. That includes a company wanting to make SlugAudit a branded part
of something they sell — we'd love to talk. Internal team and dev use is
always free.
See the complete LICENSE for the binding terms.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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.
Related MCP Connectors
Ground-truth code graph for your codebase: exact callers, callees, symbols & dependencies.
AI-powered codebase analysis — call graphs, security, dead code, complexity. 150+ tools.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Related MCP Servers
- FlicenseCqualityDmaintenanceEnables AI assistants to analyze codebases through semantic search, call graph generation, and function metadata extraction. Provides real-time code analysis with persistent vector storage for understanding complex code structures and relationships.136-
- AlicenseAqualityDmaintenanceAnalyzes codebases from local directories, GitHub, and Azure DevOps, providing intelligent context to AI coding assistants through repository structure, critical files, and semantic maps.144MIT
- AlicenseNot gradedqualityCmaintenanceTransforms codebases into structural knowledge graphs for AI agents and developers, providing precise architectural awareness and dependency mapping.54MIT
- AlicenseAqualityDmaintenanceIntelligent code indexing and analysis for Large Language Models, enabling advanced search, file analysis, and real-time monitoring of codebases.12MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/slugaudit'
If you have feedback or need assistance with the MCP directory API, please join our Discord server