An AI-powered, Project-Aware coding assistant MCP server built with Gemini 2.0 Flash and UV.
Plug it into Antigravity or Claude Desktop and get a full AI engineering team: debugging, reviewing, testing, deploying, and securing your code — all autonomously.
DevGuardian v2 is no longer a single script. It is a multi-agent autonomous engineering ecosystem:
- 🧠 Project DNA Awareness — Before writing a single line of code, DevGuardian reads your
README,pyproject.toml, full file tree, and import graph. It generates code that fits your architecture. - 🤖 Agent Swarm — A 3-agent pipeline (Coder → Tester → Reviewer) that builds features autonomously, finds bugs, and returns production-ready code.
- 🧪 TDD Auto-Pilot — Generates pytest tests, runs them, reads failures, fixes the source code, and loops until green.
- 🌐 GitHub PR Reviewer — Connects to live GitHub PRs, reads the diffs, and posts a structured expert review.
- 🐳 DevOps Generator — Produces a production-grade
Dockerfile,docker-compose.yml, and GitHub Actionsci.ymlby reading your project stack. - 🏗️ God-Mode Mass Refactoring — Applies a single instruction across every Python file in the project simultaneously.
- 🛡️ Pre-Push Security Gate — Actively blocks accidental pushes of API keys, tokens, and passwords.
| Tool | Description |
|---|---|
🤖 agent_swarm |
3-Agent Pipeline: Coder → Tester → Reviewer. Builds features, audits for bugs, returns production-ready code. |
🚀 autonomous_engineer |
Stateful LangGraph Agent: Plans, executes tools in loops, verifies work, and self-corrects. |
| Tool | Description |
|---|---|
debug_error |
Analyze errors & stack traces; get root cause + fix with project context |
explain_code |
Understand what any code does in plain English |
review_code |
Full project-aware codebase review: bugs, security, performance, style |
generate_code |
Generate clean code tailored to your project's architecture |
improve_code |
Refactor and improve existing code consistently |
| Tool | Description |
|---|---|
🧪 test_and_fix |
TDD Auto-Pilot: generates pytest tests, runs them, fixes source until tests pass |
🌐 review_pull_request |
GitHub PR Reviewer: fetches PR diffs from GitHub & performs AI code review |
| Tool | Description |
|---|---|
🐳 dockerize |
Auto-generates Dockerfile + docker-compose.yml for your project |
🚀 generate_ci |
Auto-generates .github/workflows/ci.yml (linting, testing, Docker) |
| Tool | Description |
|---|---|
🏗️ mass_refactor |
God-Mode: applies one instruction across ALL Python files simultaneously |
| Tool | Description |
|---|---|
🛂 validate_env |
Validates .env file format safely — never exposes secret values |
🔍 security_scan |
Scans repo for 20+ credential types + missing .gitignore rules |
| Tool | Description |
|---|---|
⭐ smart_commit |
AI reads your diff → writes commit message → scans for leaks → commits! |
git_status |
Show working tree status |
git_add |
Stage files for commit |
git_commit |
Commit with a custom message |
git_push |
Push to remote (Protected by Security Gate) |
git_pull |
Pull from remote |
git_log |
View commit history |
git_diff |
Show staged or unstaged diffs |
git_branch |
List all branches |
git_checkout |
Switch or create branches |
git_stash |
Stash / unstash changes |
git_reset |
Reset HEAD (soft, mixed, hard) |
git_remote |
List configured remotes |
- UV installed
- Python 3.10+
- Git installed
- A Gemini API Key (free)
cd DevGuardian
uv venv
uv pip install -e .copy .env.example .env
# Open .env and paste your Gemini API key
# Optionally add GITHUB_TOKEN for private repo PR reviewsuv run devguardianYou should see no errors — the server waits for MCP connections on stdio.
Add to your .gemini/settings.json:
{
"mcpServers": {
"devguardian": {
"command": "uv",
"args": ["--directory", "C:\\Users\\ASUS\\OneDrive\\Desktop\\DevGuardian", "run", "devguardian"],
"env": {
"GEMINI_API_KEY": "your_key_here",
"GITHUB_TOKEN": "your_github_token_here"
}
}
}
}Add to %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"devguardian": {
"command": "uv",
"args": ["--directory", "C:\\Users\\ASUS\\OneDrive\\Desktop\\DevGuardian", "run", "devguardian"],
"env": {
"GEMINI_API_KEY": "your_key_here"
}
}
}
}"DevGuardian, use the agent swarm to create a rate-limiting utility for our API."
→ Coder writes aRateLimiterclass, Tester finds 5 edge cases, Reviewer incorporates all fixes and returns the final production-ready file.
"Run test_and_fix on
devguardian/tools/debugger.py"
→ DevGuardian writes pytest tests, runs them, reads the failures, patches the source, and loops until all tests go green.
"Review PR #42 in myorg/myrepo"
→ DevGuardian fetches the diff from GitHub and gives you a structured review: Bugs, Security, Performance, Style, and a final verdict.
"Dockerize this project."
→ DevGuardian reads your stack frompyproject.toml, generates a multi-stageDockerfileanddocker-compose.yml, and writes them to your project root.
"Add type hints to all function signatures in the project."
→ DevGuardian scans every.pyfile, rewrites functions that need type hints, and reports all 14 files it modified.
"Push my changes to main."
→ DevGuardian scans all staged files. If it findsapi_key = "AIzaSy..."hardcoded anywhere, it BLOCKS the push and tells you exactly which file and line contains the secret.
DevGuardian/
├── .env.example ← Copy to .env, add your API key
├── .gitignore ← Comprehensive security-focused rules
├── pyproject.toml ← UV project config (dependencies)
├── Dockerfile ← 🐳 Auto-generated production container
├── docker-compose.yml ← 🐳 Auto-generated service orchestration
├── README.md
├── tests/
│ └── test_debugger.py ← 🧪 TDD Auto-Pilot generated tests
├── .github/
│ └── workflows/
│ └── ci.yml ← 🚀 Auto-generated GitHub Actions CI/CD
└── devguardian/
├── server.py ← Robust MCP server (27 tools, logging, error handling)
├── agents/
│ ├── engineer.py ← Single stateful LangGraph agent
│ └── swarm.py ← 🤖 3-Agent Swarm (Coder + Tester + Reviewer)
├── tools/
│ ├── debugger.py ← debug_error
│ ├── code_helper.py ← explain, review, generate, improve
│ ├── git_ops.py ← Full git suite + ⭐ smart_commit
│ ├── tdd.py ← 🧪 TDD Auto-Pilot
│ ├── github_review.py ← 🌐 GitHub PR Reviewer
│ ├── infra.py ← 🐳 Dockerfile + CI/CD generator
│ └── mass_refactor.py ← 🏗️ God-Mode mass refactoring
└── utils/
├── gemini_client.py ← Gemini 2.0 Flash wrapper (lazy init)
├── file_reader.py ← 🧠 Project DNA Context Builder
├── security.py ← 🛡️ Pre-push secret gate & .env validator
└── memory.py ← Threading & Agent state management
- Anti-Leak Shield:
security.pydetects 20+ credential types (AWS, GitHub, OpenAI, Google, Stripe, Slack…) before anygit pushorsmart_commit. - Smart Detection: Only flags hardcoded quoted values — never false-positives on
os.getenv()calls. .envSafety:validate_envreviews your.envfile format — shows keys but never exposes values.- Local Execution: Your code never leaves your machine except for Gemini API calls.
# Build and run DevGuardian in a container
docker compose up --buildBuilt with ❤️ by Karan using Gemini 2.0 Flash + LangGraph + MCP SDK + UV