What it does
🚀 Kill the Junior AI Era. 🤖 Level up AI code to automatically Principal standards. 🛡️ Quality Gate ✨
- Connects Runs on your computer
- Account or key Needs SONAR_TOKEN, SONAR_PROJECT_KEY
- Category Developer tools
Use together with
Skills that teach the AI this kind of work; they work alongside this one
andrej-karpathy-skills
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
Why it ranks here
Lists are ordered by a usage score (out of 100) built from these parts
| Popularity | 18/80 | GitHub stars or weekly downloads: the larger counts 60, the smaller 20 |
|---|---|---|
| Freshness | 7/12 | Full marks for a release or code change within 30 days |
| Still answering | 0/8 | The cloud endpoint answered at the last check |
| Usage score | 25/100 |
Quality: Passed 3/3 basic checks (shown, not used for ordering) · Momentum: No data yet (Used only on the Trending tab)
Install
Pick the AI app you use, then copy the settings.
Let your AI install it with one sentence
Please install AI Quality Gate. Follow https://mcp.popnx.com/i/mustafacagri-ai-quality-gate.md, show me the commands and wait for my OK before running them.Paste it into an AI that can work on your computer (such as Claude Code or Cursor). It reads our steps, shows you the commands and waits for your OK. No key, no sign-up. · See the full text your AI reads
Passed 3/3 checks · Runs on your computer · ✓ Commands checked Nov 14, 2026
First: which AI do you use?
Pick your app and the steps appear below.
Works with Claude, with some setup first
You need a AI Quality Gate key (create it on the maker’s site) · Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
Let AI install it
Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server AI Quality Gate for Claude on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "ai-quality-gate": { "command": "npx", "args": [ "-y", "ai-quality-gate" ], "env": { "SONAR_TOKEN": "your-value", "SONAR_PROJECT_KEY": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For SONAR_TOKEN, SONAR_PROJECT_KEY, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the AI Quality Gate tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Install Node.js (if you don’t have it)
Already installed? Check first · Open Terminal, type this command and press Enter
node -v- A version number such as v26.13.1 = installed, skip this step
- "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
How to open Terminal
Mac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed
Open the Node.js download page ↗
When it’s done, close Terminal, open it again and run the same command. You should see a version number:
node -vInstall once; it works for everything that needs Node.js
Sign up and create a AI Quality Gate key
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
How to get a key is in the maker’s README below
Open the Claude desktop app’s settings file
SettingsDeveloperEdit Config
Paste these settings and save the file
{ "mcpServers": { "ai-quality-gate": { "command": "npx", "args": [ "-y", "ai-quality-gate" ], "env": { "SONAR_TOKEN": "your-value", "SONAR_PROJECT_KEY": "your-value" } } } }Paste the key only into the app’s field, never into a chat or to anyone
Quit Claude and open it again
Try it
Use AI Quality Gate and tell me what you can do for me, then show me one thing✓ If Claude says it is using AI Quality Gate or shows a AI Quality Gate tool in the answer, you are connected
3 optional setting(s) (works without them)
The command above works without these. Add them only if you want to change something, following the maker’s description.
PROJECT_ROOTAbsolute path to the project root for analysis (auto-detected if omitted)SONAR_HOST_URLSonarQube server base URL (e.g., http://localhost:9000)ENABLE_I18N_RULESEnable stricter JSX literal checks for i18n projects (true/false)
Descriptions are as written by the maker.
Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version
ChatGPT cannot connect AI Quality Gate yet
AI Quality Gate runs on your computer, but ChatGPT can only connect servers that run on the web
What you can do instead
A · Use an app that can connect AI Quality Gate
- You need a AI Quality Gate key (create it on the maker’s site) · Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
- You need a AI Quality Gate key (create it on the maker’s site) · Install Node.js on your computer first (one time)
- You need a AI Quality Gate key (create it on the maker’s site) · Install Node.js on your computer first (one time)
- You need a AI Quality Gate key (create it on the maker’s site) · Install Node.js on your computer first (one time)
B · Others in Developer tools that work with ChatGPT
Picked from the most used in the same category, only ones that connect by address with no key
- Sentry✓ ChatGPT
- Compiler Explorer✓ ChatGPT
- GitDiagram✓ ChatGPT
Works with Claude Code, with some setup first
You need a AI Quality Gate key (create it on the maker’s site) · Install Node.js on your computer first (one time)
Let AI install it
Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server AI Quality Gate for Claude Code on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user ai-quality-gate --env SONAR_TOKEN=your-value --env SONAR_PROJECT_KEY=your-value -- npx -y ai-quality-gate 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For SONAR_TOKEN, SONAR_PROJECT_KEY, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the AI Quality Gate tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Install Node.js (if you don’t have it)
Already installed? Check first · Open Terminal, type this command and press Enter
node -v- A version number such as v26.13.1 = installed, skip this step
- "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
How to open Terminal
Mac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed
Open the Node.js download page ↗
When it’s done, close Terminal, open it again and run the same command. You should see a version number:
node -vInstall once; it works for everything that needs Node.js
Sign up and create a AI Quality Gate key
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
How to get a key is in the maker’s README below
Open Terminal
Mac: press Command+Space and type Terminal · Windows: open PowerShell
Paste this command and press Enter
claude mcp add --scope user ai-quality-gate --env SONAR_TOKEN=your-value --env SONAR_PROJECT_KEY=your-value -- npx -y ai-quality-gateReplace “your-value” with your key before pressing Enter
Paste the key only into the app’s field, never into a chat or to anyone
Type /mcp in Claude Code
You should see AI Quality Gate listed as connected
Try it
Use AI Quality Gate and tell me what you can do for me, then show me one thing✓ If Claude Code says it is using AI Quality Gate or shows a AI Quality Gate tool in the answer, you are connected
3 optional setting(s) (works without them)
The command above works without these. Add them only if you want to change something, following the maker’s description.
PROJECT_ROOTAbsolute path to the project root for analysis (auto-detected if omitted)SONAR_HOST_URLSonarQube server base URL (e.g., http://localhost:9000)ENABLE_I18N_RULESEnable stricter JSX literal checks for i18n projects (true/false)
Descriptions are as written by the maker.
Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Works with Cursor, with some setup first
You need a AI Quality Gate key (create it on the maker’s site) · Install Node.js on your computer first (one time)
Let AI install it
Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server AI Quality Gate for Cursor on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "ai-quality-gate": { "command": "npx", "args": [ "-y", "ai-quality-gate" ], "env": { "SONAR_TOKEN": "your-value", "SONAR_PROJECT_KEY": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For SONAR_TOKEN, SONAR_PROJECT_KEY, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the AI Quality Gate tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Install Node.js (if you don’t have it)
Already installed? Check first · Open Terminal, type this command and press Enter
node -v- A version number such as v26.13.1 = installed, skip this step
- "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
How to open Terminal
Mac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed
Open the Node.js download page ↗
When it’s done, close Terminal, open it again and run the same command. You should see a version number:
node -vInstall once; it works for everything that needs Node.js
Sign up and create a AI Quality Gate key
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
How to get a key is in the maker’s README below
Fill in your key
In the AI Quality Gate settings, SONAR_TOKEN, SONAR_PROJECT_KEY is empty; add your key and save
Paste the key only into the app’s field, never into a chat or to anyone
Open the AI chat in Cursor in Agent mode
Try it
Use AI Quality Gate and tell me what you can do for me, then show me one thing✓ If Cursor says it is using AI Quality Gate or shows a AI Quality Gate tool in the answer, you are connected
3 optional setting(s) (works without them)
The command above works without these. Add them only if you want to change something, following the maker’s description.
PROJECT_ROOTAbsolute path to the project root for analysis (auto-detected if omitted)SONAR_HOST_URLSonarQube server base URL (e.g., http://localhost:9000)ENABLE_I18N_RULESEnable stricter JSX literal checks for i18n projects (true/false)
Descriptions are as written by the maker.
Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Works with VS Code, with some setup first
You need a AI Quality Gate key (create it on the maker’s site) · Install Node.js on your computer first (one time)
Let AI install it
Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server AI Quality Gate for VS Code on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "ai-quality-gate": { "type": "stdio", "command": "npx", "args": [ "-y", "ai-quality-gate" ], "env": { "SONAR_TOKEN": "your-value", "SONAR_PROJECT_KEY": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For SONAR_TOKEN, SONAR_PROJECT_KEY, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the AI Quality Gate tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Install Node.js (if you don’t have it)
Already installed? Check first · Open Terminal, type this command and press Enter
node -v- A version number such as v26.13.1 = installed, skip this step
- "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
How to open Terminal
Mac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed
Open the Node.js download page ↗
When it’s done, close Terminal, open it again and run the same command. You should see a version number:
node -vInstall once; it works for everything that needs Node.js
Sign up and create a AI Quality Gate key
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
How to get a key is in the maker’s README below
Fill in your key
In the AI Quality Gate settings, SONAR_TOKEN, SONAR_PROJECT_KEY is empty; add your key and save
Paste the key only into the app’s field, never into a chat or to anyone
Open the AI chat in VS Code in Agent mode
Try it
Use AI Quality Gate and tell me what you can do for me, then show me one thing✓ If VS Code says it is using AI Quality Gate or shows a AI Quality Gate tool in the answer, you are connected
3 optional setting(s) (works without them)
The command above works without these. Add them only if you want to change something, following the maker’s description.
PROJECT_ROOTAbsolute path to the project root for analysis (auto-detected if omitted)SONAR_HOST_URLSonarQube server base URL (e.g., http://localhost:9000)ENABLE_I18N_RULESEnable stricter JSX literal checks for i18n projects (true/false)
Descriptions are as written by the maker.
Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version
For developers: Terminal commands and JSON settings
Installed on your computer
Claude Code
claude mcp add --scope user ai-quality-gate --env SONAR_TOKEN=your-value --env SONAR_PROJECT_KEY=your-value -- npx -y ai-quality-gateClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"ai-quality-gate": {
"command": "npx",
"args": [
"-y",
"ai-quality-gate"
],
"env": {
"SONAR_TOKEN": "your-value",
"SONAR_PROJECT_KEY": "your-value"
}
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"ai-quality-gate": {
"command": "npx",
"args": [
"-y",
"ai-quality-gate"
],
"env": {
"SONAR_TOKEN": "your-value",
"SONAR_PROJECT_KEY": "your-value"
}
}
}
}VS Code (mcp.json)
{
"servers": {
"ai-quality-gate": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"ai-quality-gate"
],
"env": {
"SONAR_TOKEN": "your-value",
"SONAR_PROJECT_KEY": "your-value"
}
}
}
}Values you fill in
PROJECT_ROOTenvAbsolute path to the project root for analysis (auto-detected if omitted)SONAR_HOST_URLenvSonarQube server base URL (e.g., http://localhost:9000)SONAR_TOKENsecret required envSonarQube authentication tokenSONAR_PROJECT_KEYsecret required envSonarQube project keyENABLE_I18N_RULESenvEnable stricter JSX literal checks for i18n projects (true/false)
Descriptions are as written by the maker.
These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.
At a glance
Which apps can use it
Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.
Run on your computer in
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
Related guides
What it can do
Runs on your computer; the tool list appears in your AI app after you install it.
Basic checksi
We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 19, 2026
- ✓ Pass
Maker matches the repo
The registry name was verified with the GitHub account mustafacagri, which owns the repo
- ✓ Pass
Still maintained
Code last changed 42 days ago
- ✓ Pass
Has a licence
Uses MIT
- – Not applicable
Endpoint responds
This one runs on your computer; there is no internet endpoint
- – Not applicable
Sign-in with OAuth
Runs on your computer and uses local settings instead
- … Not checked yet
No hidden instructions in tool descriptions
Runs on your computer; we can only read tool lists from internet endpoints
Published vulnerabilities (OSV.dev)
No entries on OSV.dev for ai-quality-gate@1.1.0
Checks only this package version, not every dependency · checked Nov 15, 2026
Makers: ask for a re-check or report wrong info
For makers: add a badge to your README
If you made this, paste this code into your README. The badge links back to this page.
[](https://mcp.popnx.com/en/servers/mustafacagri-ai-quality-gate)Discussion
Ask, share a tip or report that it does not work. Sorted by what people marked helpful.
No posts yet. Be the first to ask or share.
Posts here are written by users, not the PopNx team.
User reviews
No reviews yet
Compared with others in Developer toolsi
- More stars than 94% of the other 6103 servers in this category
- Published to the registry more recently than 44% of the other 6103 servers in this category
- Basic checks equal to or better than 99% of the other 6103 servers in this category
Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.
Common questions
Is AI Quality Gate safe?
It passed 3 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.
What keys or codes does it need?
You need to fill in: SONAR_TOKEN, SONAR_PROJECT_KEY
Does it run on my computer or in the cloud?
It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).
Is it still maintained?
The GitHub repo last changed 42 days ago, and the latest version (1.1.0) reached the registry 42 days ago.
Which apps can use it?
Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Node.js on your computer.
What can I use instead?
In the same category: GitDiagram, Appllama, Cloudflare MCP, Omnara, Repowise
Similar alternatives
Same category, other makers, commands already checked. Official ones first, then by stars.
Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi
GitDiagram
Architecture diagrams, explanations and Mermaid source for public GitHub repositories.
Appllama
Study screens, flows and paywalls from top-earning iOS apps, then build from what wins.
Cloudflare MCP
Cloudflare MCP servers
Omnara
Deploy durable AI agents with Omnara, an open-source managed-agent platform.
Repowise
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
| This one AI Quality Gate | GitDiagram | Appllama | Cloudflare MCP | Omnara | Repowise | |
|---|---|---|---|---|---|---|
| Runs where | Installs on your computer | Runs in the cloud, nothing to install | Runs in the cloud, nothing to install | Runs in the cloud, nothing to install | Runs in the cloud, nothing to install | Cloud or install on your computer |
| Needs a key | Yes | No | No | No | No | No |
| Add with + in Claude | No | No | No | Yes | No | No |
| Basic checks | 3/3 | 4/4 | 4/4 | 4/4 | 4/4 | 5/5 |
| License | MIT | MIT | MIT | Apache-2.0 | Apache-2.0 | AGPL-3.0 |
| Price | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry |
README from the maker
Open the README
Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.
AI Quality Gate
MCP Server for AI code quality automation.
What It Does
AI writes code → calls quality_fix → Server fixes what it can → Reports remaining issues to AI.
Hybrid Approach:
- Phase 1: ESLint + 627 rules + Prettier (~2-8s, always runs)
- Phase 2: SonarQube Server (~30-60s, optional)
Important: ESLint vs Prettier
| Tool | Source | Config |
|---|---|---|
| ESLint | Project's config (if exists) or MCP's embedded | .eslintrc.* / eslint.config.* / MCP embedded |
| Prettier | Project's own | Project's prettier.config.mjs |
ESLint rules are controlled by MCP for consistent quality gates.
Prettier uses project's config so formatting matches project preferences.
Phase 1 Rule Coverage:
| Plugin | Rules | Description |
|---|---|---|
| SonarJS | 201 | Security, bugs, code smells |
| Unicorn | 127 | Modern JS best practices |
| ESLint Core | 108 | JavaScript fundamentals |
| TypeScript-ESLint | 99 | TypeScript-specific rules |
| RegExp | 60 | Regex best practices |
| Import | 11 | Import/export rules |
| Promise | 10 | Async/await best practices |
| Node.js (n) | 9 | Node.js specific rules |
| Unused Imports | 2 | Auto-remove unused imports |
| Total | 627 |
Installation
Prerequisites
- Node.js 20.10+ or 21.1+ on your PATH (
node -v). - Cursor, Antigravity, OpenCode (or another MCP-capable editor) with MCP enabled.
Project root is auto-detected when PROJECT_ROOT is omitted: the server walks up from the MCP process working directory until it finds package.json or tsconfig.json. Set PROJECT_ROOT in env only to analyze a different tree than the inferred root.
MCP configuration (Cursor)
Open Settings → Tools & MCP → Edit (user mcp.json). Add one server block; the examples below match .cursor/mcp.json.example (JSONC with comments — if your editor rejects comments, copy the JSON blocks below only).
Server name vs tool name: The key under mcpServers (e.g. "ai-quality-gate") is only the label for that connection in Cursor. The MCP tool your agent calls is always quality_fix — that name is fixed by this package and is separate from the server key and from ai-quality-gate.
A) Recommended: npx (no global install)
Always runs the published package; good for teams and CI-like setups.
{
"mcpServers": { "ai-quality-gate": { "command": "npx", "args": ["-y", "ai-quality-gate"] } } }
B) Optional: global npm install
After npm i -g ai-quality-gate, the ai-quality-gate binary is on your PATH:
{
"mcpServers": { "ai-quality-gate": { "command": "ai-quality-gate", "args": [] } } }
C) SonarQube (Phase 2)
Requires a running SonarQube instance, sonar-scanner available (see SonarQube Setup), and all three variables below. Phase 1 still runs first.
{
"mcpServers": { "ai-quality-gate": { "command": "npx", "args": ["-y", "ai-quality-gate"], "env": { "SONAR_HOST_URL": "http://localhost:9000", "SONAR_TOKEN": "your_sonar_token", "SONAR_PROJECT_KEY": "your_project_key" } } } }
D) Optional environment variables (any server)
Add an "env" object when you need overrides. Merge order for config is defaults → `.quality-gate.yaml` / `.quality-gate.json` → environment variables.
| Variable | When to set |
|---|---|
QUALITY_GATE_CONFIG | Absolute path to a specific .quality-gate.yaml or .quality-gate.json (skips walking directories). |
PROJECT_ROOT | Force project root if auto-detection is wrong for your layout. |
SONAR_HOST_URL | SonarQube server URL (with Phase 2). |
SONAR_TOKEN | SonarQube token (with Phase 2). |
SONAR_PROJECT_KEY | SonarQube project key (with Phase 2). |
SONAR_SCANNER_PATH | Full path to sonar-scanner if not on PATH. |
PHASE1_TIMEOUT | Phase 1 timeout (ms), default 30000. |
PHASE2_TIMEOUT | Phase 2 timeout (ms), default 300000. |
ENABLE_I18N_RULES | true / false — stricter JSX literal checks for i18n projects. |
MCP configuration
Cursor, Antigravity, etc..
{
"mcpServers": { "ai-quality-gate": { "command": "npx", "args": ["-y", "ai-quality-gate"] } } }
(OpenCode)
Create or edit OpenCode config (typically ~/.config/opencode/opencode.json or project-level config):
{
"$schema": "https://opencode.ai/config.json", "mcp": { "ai-quality-gate": { "type": "local", "enabled": true, "command": ["npx", "-y", "ai-quality-gate"] } } }
Environment variables can be added under the server config if needed (see C) SonarQube (Phase 2) above).
Local development (this repository)
To dogfood or contribute:
- `yarn build` — generates
dist/server.js. - Point MCP at the built file (absolute paths):
{
"mcpServers": { "ai-quality-gate-dev": { "command": "node", "args": ["/ABSOLUTE/PATH/TO/ai-quality-gate/dist/server.js"] } } }
- Reload MCP. Use
env.PROJECT_ROOTonly if the repo you analyze differs from the inferred root.
2. Add AI Rule
Settings → Rules and Commands → Add Rule:
After every code change, before telling the user "done",
AI must call the quality_fix MCP tool. This is mandatory.
3. Use It
AI writes code → calls quality_fix → Fixes errors → "Done ✅"
CLI: interactive config (--setup)
The interactive wizard creates or updates .quality-gate.yaml without hand-editing: it walks you through project root, optional SonarQube (host URL + project key; token is not saved to disk — use SONAR_TOKEN in your environment), which Phase 1 tools to enable (ESLint, curly-brace / arrow AST fixers, Prettier, JSON validator), timeouts, and i18n rules. The generated file includes a fixers: block you can adjust later.
After yarn build (or install from npm), run from the target project (or any path under it):
node dist/server.js --setup
PROJECT_ROOT is inferred when unset (see MCP configuration). Use the same entrypoint as the MCP server (node dist/server.js or npx ai-quality-gate); only the --setup flag switches to wizard mode. Answer prompts in the terminal; on success you get a ready-to-use config next to your project root.
Other CLI modes: --check (read-only Phase 1), --fix (default behavior when using CLI quality run), --phase1-only, --phase2-only — see docs/DEVELOPMENT.md.
Optional: SonarQube Server (Phase 2)
Configure Sonar env in MCP as in [C) SonarQube (Phase 2)](#c-sonarqube-phase-2) above, or copy from .cursor/mcp.json.example. You need `sonar-scanner` on your machine for analysis (see below).
SonarQube Setup
Docker (Recommended)
# Start SonarQube
docker run -d --name sonarqube -p 9000:9000 sonarqube:community
First login: admin/admin → change password
http://localhost:9000
Docker Compose
# docker-compose.yml
version: '3' services: sonarqube: image: sonarqube:community ports:
- '9000:9000' volumes:
- sonarqube_data:/opt/sonarqube/data
- sonarqube_logs:/opt/sonarqube/logs
- sonarqube_extensions:/opt/sonarqube/extensions
volumes: sonarqube_data: sonarqube_logs: sonarqube_extensions:
docker-compose up -d
Creating SonarQube Token
- http://localhost:9000 → Login (admin)
- My Account → Security → Generate Tokens
- Select token type: Global Analysis Token
- Copy token → use as
SONAR_TOKEN
Installing sonar-scanner
| Platform | Method | Command |
|---|---|---|
| Windows | npm (global) | npm install -g sonarqube-scanner |
| Windows | Chocolatey | choco install sonar-scanner |
| macOS | npm (global) | npm install -g sonarqube-scanner |
| macOS | Homebrew | brew install sonar-scanner |
| Linux | npm (global) | npm install -g sonarqube-scanner |
| Docker | Container | docker run sonarsource/sonar-scanner-cli |
For custom path: SONAR_SCANNER_PATH env var
Configuration
Optional files (discovered by walking up from the inferred project root — same algorithm as package.json / tsconfig.json — or from PROJECT_ROOT when set): `.quality-gate.yaml` (preferred) or `.quality-gate.json`. Same fields as environment variables (camelCase); you may nest Sonar settings under sonar: { hostUrl, token, projectKey, scannerPath }.
Merge order: defaults → config file → environment variables (ENV wins on conflicts).
Set `QUALITY_GATE_CONFIG` to an explicit path to skip discovery.
Custom rules (customRules)
Optional line-based regex checks on lintable files (Phase 1). Each match is reported as an issue with rule set to custom: (and included in quality_fix remaining). Example:
customRules:
- id: no-console message: 'Console.log is not allowed' pattern: 'console\\.log\\(' severity: error
- id: no-debugger message: 'Debugger statement found' pattern: 'debugger' severity: warning
Patterns use JavaScript RegExp source (escape backslashes as in YAML strings). An invalid pattern is skipped, and says so in warnings.
JSON validator & i18n locale files
When `fixers.jsonValidator` is enabled and you pass JSON paths that match locale patterns (for example locales/en.json / locales/tr.json), the tool compares keys across those files.
- Syntax errors, invalid UTF-8 BOM, etc. → reported as
issuesand fail Phase 1 /quality_fixuntil fixed. - Missing or extra keys between locale files → collected as `i18nIssues` in the validator result and printed as warnings on stderr during Phase 1. They do not set
passed: falseand do not block the gate.
Treat i18nIssues as advisory unless you add your own CI check on top.
Environment Variables
All variables are optional unless you use Phase 2, which requires `SONAR_HOST_URL`, `SONAR_TOKEN`, and `SONAR_PROJECT_KEY` together.
| Variable | Description