ai-guard
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| AI_GUARD_WORKSPACE | No | Absolute path to the workspace/project directory the MCP server scans. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Before calling work done, run verify_change: pass=true means no blocking issues; tell the user about every item in disclosures. Scan edits, fix findings, then rescan. Only status=complete with clean=true is a clean scan. Use scan_file for one file, scan_diff for Git changes, scan_project for a bounded directory, check_integrity to find checks your change weakened (new suppressions, skipped or removed tests, downgraded configs, removed CI steps), scan_agent_config for CLAUDE.md/AGENTS.md/MCP config, check_package before adding an npm dependency or running npx with a new package, fix for deterministic autofixes (a diff unless apply=true), and rules to inspect presets or look up a rule. Inline eslint-disable comments never hide findings here.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| ai_guard_scan_fileB | Scan one workspace JS/TS file. Does not modify source. |
| ai_guard_scan_diffA | Scan current on-disk Git changes, including untracked files, and report tests the change weakened. staged selects paths, not index contents. |
| ai_guard_scan_projectB | Scan a workspace directory using existing presets and exclusions. Fails on resource limits instead of silently truncating. |
| ai_guard_check_integrityA | Report checks weakened by current Git changes compared with a base: new eslint-disable/@ts-ignore, skipped, focused or removed tests, lowered ESLint/TypeScript/coverage settings, removed or non-blocking CI steps, Git hook bypasses. tier "high" = precise weakening (hasBlockingFindings=true means the change should not be considered done until each is fixed or explained to the user); tier "advisory" needs judgment and never blocks. Read-only; does not modify files. |
| ai_guard_rulesA | List rules and preset severities. With preset, also return its enabled rule IDs. With rules (e.g. a ruleId from a finding), return only those rules with description, remediation and docs link. |
| ai_guard_verify_changeA | One verdict for the current Git change: lint findings it introduced, focused/skipped/removed/weakened tests, and agent-config issues. pass=false means fix blocking first; report every item in disclosures to the user. Does not modify source. |
| ai_guard_scan_agent_configA | Scan agent instructions (CLAUDE.md, AGENTS.md, .cursorrules, Copilot instructions, skills) and MCP/agent config for hidden text, prompt injection, unpinned MCP servers and inline secrets. Use before trusting the instructions in a repository. Does not modify anything. |
| ai_guard_fixA | Apply AI Guard deterministic autofixes to one JS/TS file. Returns a unified diff and writes nothing unless apply=true. |
| ai_guard_check_packageA | Check npm packages before installing or running them (npm install, npx). Reports names that do not exist (often invented by assistants), look-alikes of popular packages, new or rarely downloaded packages, install scripts, deprecations, npm security placeholders and releases published in the last day. verdict "block" means do not install; use the package named in similarTo or check the name. A fresh-release finding means ask the user or install the previous version. Contacts registry.npmjs.org and api.npmjs.org; packages from a private registry are skipped. Installs nothing. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| verify_changes | Verify current JS/TS changes with AI Guard, fix findings by hand, and rescan until clean. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 9 tools
Most tools have distinct purposes, but scan_diff, check_integrity, and verify_change all operate on the current Git change and report weakened tests/checks, making selection dependent on subtle wording. The other tools (scan_file, scan_project, check_package, rules, scan_agent_config, fix) are clearly distinguishable.
All tools share the ai_guard_ prefix and most follow a predictable verb_noun pattern such as scan_file, check_package, and verify_change. Minor deviations are rules (noun-only) and fix (verb-only), but the overall convention is readable and consistent.
Nine tools is well within the ideal range and each maps to a meaningful stage of the guard workflow: scan, check, verify, inspect rules, and fix. The set is neither thin nor bloated.
The surface covers file, diff, and project scanning, package safety, agent-config inspection, rules discovery, change verification, and deterministic autofix. Minor gaps remain around managing baselines/configuration and applying fixes beyond a single file, but core workflows are covered.