lmstudio-auditor
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., "@lmstudio-auditorAudit this Python code for dangerous calls and approve or fix it."
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.
โจ Key Features
Zero-Cost Local Critic: Offload heavy code review iterations to your local GPU via LM Studio without spending cloud tokens.
Sub-Millisecond AST Sentinel: Catches syntax errors and dangerous runtime calls (
eval,exec,os.system,subprocess) before wasting GPU cycles.Deterministic Contract: Enforces structured outputs (
APPROVEDvsREJECTEDwith specific line feedback) so the agent automatically refactors code without human intervention.Dual Data Sink (DPO Flywheel):
SQLite (
audit_history.db): Tracks duration, categories, and metrics.Per-Audit JSON (
audit_logs/): Stores individual audit records to easily build DPO / Fine-tuning datasets from paired rejected/approved attempts.
Related MCP server: tar-engine
๐ Quick Start
1. Prerequisites
Python 3.10+
LM Studio running an OpenAI-compatible Local Server (
http://localhost:1234/v1)Antigravity or any MCP-compatible client
Installation
# Clone the repository
git clone [https://github.com/xTanThaix/mcp-local-auditor.git](https://github.com/xTanThaix/mcp-local-auditor.git)
cd mcp-local-auditor
# Set up virtual environment
python -m venv .venv
# Activate virtual environment
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt3. Register MCP Server
Open your Antigravity MCP config file:
Windows:
%USERPROFILE%\.gemini\config\mcp_config.jsonmacOS / Linux:
~/.gemini/config/mcp_config.json
Add the server definition inside mcpServers:
{
"mcpServers": {
"lmstudio-auditor": {
"command": "D:\\Hucdeline\\.venv\\Scripts\\python.exe",
"args": ["D:\\Hucdeline\\auditor_bridge.py"]
}
}
}Note: Replace
D:\\Hucdelinewith your actual project directory path.
4. Configure LM Studio
Open LM Studio and load any instruction-tuned coding model (e.g.,
Qwen-2.5-Coder,DeepSeek-Coder,Llama-3).Go to the Local Server (Developer) tab.
Set Port to
...(e.g.,1234)and click Start Server.
๐ค Agent Loop Setup (Custom Rule / Skill)
Add the following rule to your Antigravity Agent (mcp-studio-loop):
# Mandatory MCP Code Audit Protocol
Every time code is generated or refactored, you MUST invoke the `audit_submission` tool:
- Arguments: `task_goal`, `output_content`, `strict_rules`
- If STATUS == "REJECTED": Read `ACTIONABLE_FEEDBACK`, refactor the code, and re-submit.
- If STATUS == "APPROVED": Output the final solution to the user.
- Maximum retry limit: 5 attempts before breaking loop.Configure LM Studio Open LM Studio and load any instruction-tuned coding model (e.g., Qwen-2.5-Coder, DeepSeek-Coder, Llama-3).
Go to the Local Server tab.
Set Port to xxxx and click Start Server.
๐ค Agent Loop Setup (Custom Rule / Skill) Add the following rule to your Antigravity Agent (mcp-studio-loop):
Markdown
Mandatory MCP Code Audit Protocol
Every time code is generated or refactored, you MUST invoke the audit_submission tool:
Arguments:
task_goal,output_content,strict_rulesIf STATUS == "REJECTED": Read
ACTIONABLE_FEEDBACK, refactor the code, and re-submit.If STATUS == "APPROVED": Output the final solution to the user.
Maximum retry limit: 5 attempts before breaking loop. ๐งช Testing Run the included Pytest suite to verify AST checks, SQLite migrations, and mock responses:
Bash pytest test_auditor.py -v
๐ธ Real-World Audit in Action (Example Usage / Usage Example)
Here is an example of MCP Local Auditor rejecting an unoptimized code path with actionable feedback, prompting the coding agent to self-heal and re-verify:
Example Usage: After the tests pass, audit each modified file one by one using the "lmstudio-auditor" tool.
๐ Support & Donations If this project saved you API costs and helped streamline your local LLM workflow, consider supporting development:
Ko-fi: https://ko-fi.com/xtanthaix
GitHub Sponsors: Click the Sponsor button on this repository
๐ License MIT License. Free for open-source and commercial use.
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 Servers
- AlicenseCqualityBmaintenanceCaptures code modifications via AST analysis, generates reusable rules, and injects them into AI agent context with version audit and token-budgeted rule retrieval.2810Apache 2.0
- AlicenseNot gradedqualityAmaintenanceAudits AI agent skills for safety using static, semantic, adversarial, and supply-chain analysis, providing scores and risk flags. Can be run via CLI, CI, or as an MCP tool from Claude Code, Cursor, and Codex.2Apache 2.0
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to scan code for security vulnerabilities before execution, supporting Python and JavaScript/TypeScript with deterministic AST-based analysis and optional Solana micropayments.
- AlicenseAqualityBmaintenanceEnforces AST-based architectural guardrails on AI-generated code, blocking writes that violate maintainability, security, or complexity rules and prompting immediate refactoring.2MIT
Related MCP Connectors
Deterministic AI code review, with an audit record. Governance inside the agent loop.
Lints + auto-fixes how AI coding agents discover any new product. 24 rules, 6 tools, score 0-100.
Agentic code review, no signup to try: reality gates + frontier-model review, with veto.
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/xTanTHaix/mcp-local-auditor'
If you have feedback or need assistance with the MCP directory API, please join our Discord server