argus MCP server
Commit Nov 16, 2026Analyzes Go code and PostgreSQL migrations to enforce database safety invariants and prevent production issues like SQL injection and connection leaks.
Also known as will2469/argus
- Stars
- 2
- Tools
- โ
- Downloads, 30 days
- โ
- Latest version
- โ
- Last commit
- Nov 16, 2026
- License
- MIT
What is argus MCP?
argus analyzes Go code and PostgreSQL migrations to enforce database safety invariants and prevent production issues like SQL injection and connection leaks.
Summary generated from the project's README
About argus MCP server
Developers building Go applications with PostgreSQL can use Argus to prevent critical database errors and security vulnerabilities. By combining Go AST control-flow analysis with the native PostgreSQL C query parser, this tool inspects both application code and SQL migrations to enforce thirty distinct production-grade invariants. It identifies issues like SQL injection, connection pool starvation, and N+1 query patterns that traditional linters often miss.
This MCP server allows AI coding agents such as Claude Desktop, Cursor, and VS Code Copilot to perform real-time database audits. Users can configure the server locally via a JSON configuration to enable tools like argus_scan for full audits or argus_check_migration for inspecting raw SQL snippets. For teams in highly regulated environments, a telemetry kill-switch is available to ensure all analysis remains private and air-gapped.
Written from the project's README. Every use case is checked against a quote from it.
Configuration
ARGUS_TELEMETRY
Automated checks
Ran Nov 14, 2026Full report โNot verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work ยท What to fix for more points
- Source repository linked and reachablewill2469/argus is public and reachablegithub.com/will2469/argus โPass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html โPass
- Commit or release in the last yearLast commit or release 2026-10-19github.com/will2469/argus โPass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubArgus: Production-Grade Go & PostgreSQL 18 Static Analyzer
Argus is an advanced compile-time static analyzer and pre-commit database safety linter for Go applications and PostgreSQL migrations. Built on top of the official Go analysis framework (go/analysis) and PostgreSQL's native C query parser (libpg_query via pg_query_go), Argus bridges the gap between Go application code and PostgreSQL engine internals.
It enforces 30 production-grade database invariants, eliminating SQL injections, N+1 query latency collapses, connection pool starvation, cross-tenant data leaks, and catastrophic production table locking during zero-downtime schema migrations. Complete specifications and remediation examples are available in the official Argus Wiki.
Why Argus?
Traditional linters only inspect Go syntax, while schema linters only look at migration syntax in isolation. Argus combines both worlds:
- Dual-Engine Precision: Analyzes Go AST control-flow, scopes, and taint tracking alongside native PostgreSQL C-parser SQL AST (
SelectStmt,FromClause,IndexStmt, etc.). - PostgreSQL 18.x Internals Awareness: Understands MVCC,
transaction_timeoutGUC, table lock modes (SHAREvsSHARE UPDATE EXCLUSIVE), and partition pruning. - Zero False-Positive Target: Built-in heuristics for idiomatic Go and
pgx/v5constructs (e.g.,COUNT(*),pgx.CollectRows, keyset pagination). - Dual Execution Modes: Runs seamlessly as a standard
go vettool or as a standalone CLI for CI/CD pipelines.
Quickstart
Installation
Linux & macOS (One-Line Installer)
curl -fsSL https://raw.githubusercontent.com/will2469/argus/main/install.sh | bash
Windows (PowerShell)
irm https://raw.githubusercontent.com/will2469/argus/main/install.ps1 | iex
Via Go Toolchain
go install github.com/will2469/argus/cmd/argus@latest
Or download pre-compiled binaries directly from GitHub Releases.
Basic Usage
# 1. Run static analysis across current directory and migrations
argus --dirs=. --migrations=migrations
# 2. Generate a comprehensive markdown audit report
argus --output=argus-report.md
# 3. Integrate directly into go vet
go vet -vettool=$(which argus) ./...
# 4. Self-update to the latest release
argus update # or: argus --update, argus -u
# 5. Uninstall Argus from system
argus uninstall # or: argus --uninstall
๐ค AI Agent Integration (MCP)
Argus ships with a built-in Model Context Protocol (MCP) server. AI coding agents like Cursor, Claude Desktop, VS Code Copilot, and Antigravity can automatically invoke Argus to audit database queries in real-time โ no manual tagging required.
Setup โ Add to your AI editor's MCP configuration:
{
"mcpServers": {
"argus": {
"command": "argus",
"args": ["mcp"]
}
}
}
Exposed Tools:
| Tool | Description |
|---|---|
argus_scan |
Full audit of Go source files and SQL migrations against all 30 rules |
argus_check_migration |
Instant safety check for raw SQL DDL/DML snippets |
argus_explain_rule |
Retrieve documentation and fix patterns for any rule (A01โA30) |
argus_report_issue |
Two-phase Human-in-the-Loop (HITL) reporter for false positives & feedback |
๐ก The
argus_scantool description instructs AI models to automatically invoke it after writing or modifying database queries โ no.cursorrulesor prompt engineering needed.
๐ Enterprise Privacy & Telemetry Kill-Switch
For corporate, banking, or air-gapped environments where outbound issue reporting must be unconditionally disabled, set telemetry: false in .argus.yaml or export ARGUS_TELEMETRY=false:
# .argus.yaml
version: "1"
options:
telemetry: false # Blocks all outbound issue submission
export ARGUS_TELEMETRY=false
๐ Detailed Guide: Read the full Argus MCP Server Specification & Architecture Wiki for HITL protocols, trust-mode security advisories, and client setup guides.
The Argus Rules Matrix (A01โA31)
๐ Full Documentation: Every rule is thoroughly documented in the Argus Wiki. Click on any rule code or identifier below to open its dedicated specification, failure modes, and code fix examples.
| Rule | Identifier | Severity | Category | Description |
|---|---|---|---|---|
A01 |
UNSAFE_SQL_CONCATENATION |
CRITICAL | Security (CWE-89) | Forbids raw string concatenation in queries; mandates $1, $2 bind parameters. |
A02 |
MISSING_DEFER_CLOSE |
HIGH | Reliability | Mandates defer rows.Close() immediately after query execution to prevent pool leaks. |
A03 |
UNBOUNDED_CONTEXT |
HIGH | Resilience | Prohibits raw context.Background() or context.TODO() in query calls. |
A04 |
UNSAFE_ORDER_BY |
HIGH | Security (CWE-89) | Dynamic ORDER BY / GROUP BY must be validated against compile-time static allowlists. |
A05 |
AUDIT_LOG_IMMUTABILITY |
CRITICAL | Compliance | Prohibits UPDATE, DELETE, TRUNCATE, MERGE, or DROP on append-only audit ledger tables. |
A06 |
RUNTIME_DDL |
CRITICAL | Security | Blocks DDL execution in application runtime code; runtime roles must be DML-only. |
A07 |
ERROR_LEAK |
HIGH | Privacy (CWE-200) | Forbids leaking raw database error messages or PII details to external clients. |
A08 |
TX_EXTERNAL_IO |
HIGH | Performance | Forbids blocking network/disk I/O (HTTP, gRPC, disk) inside active database transactions. |
A09 |
ADVISORY_LOCK |
HIGH | Concurrency | Mandates transaction-level advisory locks; forbids session locks in pooled connections. |
A10 |
ISOLATION_LEVEL |
HIGH | Integrity | Critical financial/inventory mutations must declare explicit Serializable or FOR UPDATE. |
A11 |
DESTRUCTIVE_MIGRATION |
CRITICAL | Zero-Downtime | Prohibits destructive DDL (DROP COLUMN, RENAME) in single releases without expand-contract. |
A12 |
TIMEOUT_CONFIG |
HIGH | Availability | Mandates 4-tier timeout settings (statement_timeout, lock_timeout, idle timeouts). |
A13 |
MISSING_DOWN_MIGRATION |
HIGH | Rollback Safety | Every .up.sql migration must have a non-empty, deterministic symmetric .down.sql. |
A14 |
FORBIDDEN_SELECT_STAR |
HIGH | Performance | Prohibits wildcard SELECT *; mandates explicit column projection to avoid TOAST bloat. |
A15 |
FORBIDDEN_DDL_APP_ROLE_GRANT |
CRITICAL | Security (CWE-250) | Prohibits granting DDL/ALL privileges or table ownership to application runtime roles. |
A16 |
MAX_CONNS_CONFIG |
HIGH | Scalability | Enforces mathematically bounded MaxConns on connection pools to prevent process thrashing. |
A17 |
FORBIDDEN_QUERY_IN_LOOP |
HIGH | Performance | Eliminates N+1 query patterns inside loops in favor of WHERE id = ANY($1) or pgx.Batch. |
A18 |
MISSING_ROWS_ERR_CHECK |
HIGH | Integrity (CWE-391) | Mandates rows.Err() check after rows.Next() loops to catch silent network truncations. |
A19 |
UNBOUNDED_QUERY_LIMIT |
HIGH | Resilience (CWE-400) | Queries on high-cardinality tables must have an explicit LIMIT or keyset pagination. |
A20 |
PARAM_LIMIT_65535 |
HIGH | Protocol Limits | Prevents exceeding PostgreSQL's 65,535 wire parameter ceiling; recommends pgx.CopyFrom. |
A21 |
UNBOUNDED_ROW_LOCK_BLOCKING |
HIGH | Concurrency | Queue queries (SELECT ... FOR UPDATE) must use SKIP LOCKED or NOWAIT. |
A22 |
SERIALIZATION_FAILURE_RETRY |
HIGH | Fault Tolerance | Serializable transactions must be wrapped in automated retry loops catching SQLSTATE 40001. |
A23 |
TRANSACTION_TIMEOUT_CONFIG |
HIGH | Modern PG17/18 | Enforces transaction_timeout cap on connection pools to prevent XID horizon freezing. |
A24 |
TENANT_ISOLATION_LEAK |
CRITICAL | Multi-Tenancy | Mandates explicit tenant predicates (WHERE tenant_id = $1) or verified RLS context. |
A25 |
EXPENSIVE_CPU_IN_TRANSACTION |
HIGH | Performance | Prohibits CPU-heavy tasks (bcrypt, argon2, RSA keygen, PDF rendering) inside transactions. |
A26 |
LIKE_WILDCARD_INJECTION |
HIGH | Security (CWE-89) | Mandates escaping wildcard characters (\, %, _) on user input bound to LIKE/ILIKE. |
A27 |
NON_CONCURRENT_INDEX_CREATION |
CRITICAL | Zero-Downtime | Indexes on existing tables must use CREATE INDEX CONCURRENTLY to avoid write lockouts. |
A28 |
TABLE_LOCKING_CONSTRAINT_ADDITION |
CRITICAL | Zero-Downtime | FK and CHECK constraints must use 2-phase NOT VALID followed by VALIDATE CONSTRAINT. |
A29 |
UNINDEXED_FOREIGN_KEY |
HIGH | Performance | Every foreign key on child tables must have a supporting B-tree index (anti-table scan). |
A30 |
TIMESTAMP_WITHOUT_TIMEZONE |
CRITICAL | Temporal Hygiene | Prohibits bare TIMESTAMP; mandates TIMESTAMPTZ (UTC-normalized) for temporal determinism. |
Suppressing Findings (Ignore Directives)
When a rule violation is deliberate and reviewed, suppress it with an inline directive:
// In Go code:
// argus:ignore ARGUS-A14 export worker requires full row dump
rows, err := pool.Query(ctx, "SELECT * FROM historical_archive")
-- In SQL migrations:
-- argus:ignore ARGUS-A29 static dictionary table with under 50 rows never deleted
status_code VARCHAR(20) REFERENCES ref_status(code)
Directives require an explanatory reason of at least two words.
Configuration (.argus.yaml)
Initialize a .argus.yaml file in your repository root to configure project-specific settings:
version: "1"
rules:
ARGUS-A14:
enabled: true
ARGUS-A16:
enabled: true
max_conns_limit: 50
ARGUS-A19:
enabled: true
default_max_limit: 1000
high_growth_tables:
- "orders"
- "audit_logs"
ARGUS-A24:
enabled: true
tenant_column: "tenant_id"
tenant_tables:
- "customers"
- "invoices"
GitHub Actions CI Integration
name: Database Safety Audit
on: [push, pull_request]
jobs:
argus:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Install Argus
run: go install github.com/will2469/argus/cmd/argus@latest
- name: Audit Go Packages & Migrations
run: argus --no-report --dirs=. --migrations=migrations
๐งช 1-SSOT Golden Corpus & The 4-Layer Quality Pyramid
Argus is built with zero tolerance for false positives and silent escapes. To ensure compiler-grade determinism, verification goes beyond simple file presence ("100% adoption") to guarantee semantic soundness, mutation resistance, and cross-rule isolation:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ THE 4-LAYER COMPILER-GRADE QUALITY GATES โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Layer 1: Golden Corpus Adoption (Structural Presence Gate) โ
โ โโโบ Verifies 1-SSOT directory structure, fixtures, and runner tests exist โ
โ โโโบ Gate: TestGoldenCorpus_AdoptionMatrix (Status: 100% File Presence) โ
โ โ
โ Layer 2: Golden Corpus Correctness (Semantic Execution Gate) โ
โ โโโบ Positive Gate: P1โP5+ trigger exact diagnostics on expected lines โ
โ โโโบ Negative Gate: N1โN5+ produce zero false positives on idioms/consts โ
โ โโโบ Adversarial Gate: A1โA7 / M1โM7 anti-obfuscation vectors caught โ
โ โโโบ Dual-Path Parity Gate: Analysis Driver (go vet) == Standalone CLI โ
โ โ
โ Layer 3: Mutation & Evasion Testing (Resilience Gate) โ
โ โโโบ Operator Inversion: AND โ OR, = โ !=, NOT, IS NOT NULL โ
โ โโโบ Identity & Scope Evasion: Method collision, unverified receivers โ
โ โโโบ Lexical Spoofing: Fake SQL comments (-- tenant_id = 1), string quotes โ
โ โโโบ Fail-Closed AST Invariant: Unparseable queries rejected, not bypassed โ
โ โโโบ Target: Mutation Kill Rate = 100% (Zero Surviving Mutants) โ
โ โ
โ Layer 4: Cross-Rule Regression & Interaction Matrix (Isolation Gate) โ
โ โโโบ Multi-checker concurrent execution (all 30 rules active concurrently) โ
โ โโโบ Shared infrastructure isolation (Zero cache poisoning in sqlparser) โ
โ โโโบ Directive scoping isolation (// argus:ignore-a24 does not mute a26) โ
โ โโโบ Whole-Program Golden Corpus (tests/golden/golden.go) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- 17-Pattern Corpus Matrix (Go AST): Evaluates Positive (
P1โP5), Negative (N1โN5with compiler whitelists), and Adversarial (A1โA7branching, reassignment, closures, generics, interface dispatch). - M1โM7 Adversarial Matrix (SQL Migration): Tests multi-statement batching, casing variations, quoted identifiers, schema qualifications, and non-leading index variants against native
libpg_queryC-AST trees. - Dual-Path Parity Invariant: Proves mathematically identical detections between the
go vetanalysis driver and standalone CLI runner.
๐ Deep Dive: Read the full Argus 1-SSOT Golden Corpus & Adversarial Testing Methodology in the wiki.
License
Argus is open-source software licensed under the MIT License.
argus MCP questions
What does Argus analyze?
It performs dual-engine analysis on Go application AST control-flow and native PostgreSQL C-parser SQL AST.
Can I use Argus in my CI/CD pipeline?
Yes, it can be run as a standalone CLI or integrated into your workflow as a standard go vet tool.
How can I disable telemetry for privacy?
You can disable outbound issue reporting by setting telemetry: false in your .argus.yaml file or by exporting the ARGUS_TELEMETRY=false environment variable.
Does it support PostgreSQL 18?
Yes, Argus is designed with awareness of PostgreSQL 18.x internals including MVCC and table lock modes.