lmstudio-auditor
✨ 主な機能
ゼロコストのローカルクリティック: クラウドトークンを消費せずに、LM Studio 経由でローカル GPU に重いコードレビューの反復処理をオフロードします。
サブミリ秒の AST センチネル: GPU サイクルを無駄にする前に、構文エラーや危険なランタイム呼び出し(
eval、exec、os.system、subprocess)を検出します。決定論的コントラクト: 構造化された出力(
APPROVEDとREJECTED、および具体的な行フィードバック)を強制し、エージェントが人間の介入なしにコードを自動的にリファクタリングできるようにします。デュアルデータシンク(DPO フライホイール):
SQLite(
audit_history.db): 所要時間、カテゴリ、メトリクスを追跡します。監査ごとの JSON(
audit_logs/): 個々の監査レコードを保存し、拒否/承認のペアから DPO / ファインチューニング用データセットを簡単に構築できます。
Related MCP server: tar-engine
🚀 クイックスタート
1. 前提条件
Python 3.10+
OpenAI 互換のローカルサーバー(
http://localhost:1234/v1)を実行している LM StudioAntigravity または MCP 互換のクライアント
インストール
# 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. MCP サーバーの登録
Antigravity の MCP 設定ファイルを開きます:
Windows:
%USERPROFILE%\.gemini\config\mcp_config.jsonmacOS / Linux:
~/.gemini/config/mcp_config.json
mcpServers 内にサーバー定義を追加します:
{
"mcpServers": {
"lmstudio-auditor": {
"command": "D:\\Hucdeline\\.venv\\Scripts\\python.exe",
"args": ["D:\\Hucdeline\\auditor_bridge.py"]
}
}
}注:
D:\\Hucdelineを実際のプロジェクトディレクトリのパスに置き換えてください。
4. LM Studio の設定
LM Studio を開き、命令チューニング済みのコーディングモデル(例:
Qwen-2.5-Coder、DeepSeek-Coder、Llama-3)をロードします。Local Server(Developer)タブに移動します。
ポートを
...(e.g.,1234)に設定し、Start Server をクリックします。
🤖 エージェントループの設定(カスタムルール / スキル)
Antigravity エージェント(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.LM Studio の設定 LM Studio を開き、命令チューニング済みのコーディングモデル(例:Qwen-2.5-Coder、DeepSeek-Coder、Llama-3)をロードします。
Local Server タブに移動します。
ポートを xxxx に設定し、Start Server をクリックします。
🤖 エージェントループの設定(カスタムルール / スキル)
Antigravity エージェント(mcp-studio-loop)に次のルールを追加します:
Markdown
必須の MCP コード監査プロトコル
コードを生成またはリファクタリングするたびに、audit_submission ツールを必ず呼び出してください:
引数:
task_goal、output_content、strict_rulesSTATUS == "REJECTED" の場合:
ACTIONABLE_FEEDBACKを読み、コードをリファクタリングして再送信します。STATUS == "APPROVED" の場合:最終的な解決策をユーザーに出力します。
最大再試行回数:ループを抜けるまでに 5 回。 🧪 テスト 同梱の Pytest スイートを実行して、AST チェック、SQLite マイグレーション、モックレスポンスを検証します:
Bash pytest test_auditor.py -v
📸 実際の監査の動作例(使用例 / 利用例)
以下は、MCP Local Auditor が最適化されていないコードパスを実用的なフィードバック付きで拒否し、コーディングエージェントに自己修復と再検証を促す例です:
使用例:テストが通ったら、"lmstudio-auditor" ツールを使用して、変更した各ファイルを 1 つずつ監査します。
💖 サポートと寄付 このプロジェクトが API コストを節約し、ローカル LLM ワークフローの効率化に役立ったなら、開発のサポートを検討してください:
Ko-fi:https://ko-fi.com/xtanthaix
GitHub Sponsors:このリポジトリの Sponsor ボタンをクリックしてください
📄 ライセンス 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.
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