Skip to main content
Glama
@agent-guardrail/mcp-server

@agent-guardrail/mcp-server

by albetsurya

AgentGuardrail Banner

AgentGuardrail

Universal AI Coding Guardrails — Keep your AI build on course.

Node.js TypeScript MCP SDK v2 License: MIT

Quick Start · Screenshots · Capabilities · Integrations · Architecture


Why AgentGuardrail?

AI coding assistants write code rapidly, but conversational vibe coding introduces four recurring engineering failures:

  1. Scope Drift — Agents eagerly add unapproved features (payment gateways, extra frameworks, refactors) mid-sprint without surfacing cost or timeline impact.

  2. Session Amnesia — Switching between Cursor, Claude Code, or Codex forces you to re-explain the product goal, stack decisions, and current blockers.

  3. Unverified "Done" Claims — Models frequently report tasks finished without running tests or linking verifiable evidence.

  4. Unclear Next Steps — Backlogs balloon into speculative lists instead of focusing on one deliverable slice at a time.

AgentGuardrail solves this by placing a deterministic, local-first guardrail layer between you and your coding agents. It exposes a token-efficient 6-tool MCP contract (guardrail_read, guardrail_project, guardrail_plan, guardrail_scope_guard, guardrail_verify, guardrail_handoff), 4 resources (guardrail://...), 3 workflow prompts, a terminal CLI (agent-guard), and portable Agent Skills backed by human-readable JSON state inside .agentguardrail/.

AgentGuardrail is a project workflow guardrail, not an autonomous coding agent or a universal execution security sandbox. MCP governs structured project state and verification evidence; preventing arbitrary host file writes or shell commands outside AgentGuardrail requires each coding host's native hooks and permissions.


Related MCP server: Agent NextUp

🎯 Five Core Capabilities

Capability

Purpose

Guardrail Enforcement

1. Project Compass

Captures product outcome, target users, constraints, and approved non-goals.

Rejects silent brief mutations until explicitly approved by a human.

2. Scope Guard

Evaluates new feature requests against the agreed MVP boundary.

Blocks direct scope expansion; forces a qualitative impact proposal (SCOPE-*) requiring explicit approval.

3. Next Action Engine

Calculates the highest-priority ready task inside the active milestone.

Respects task dependencies (with cycle detection) and prevents multi-task sprawl.

4. Verification Gate

Enforces acceptance criteria and distinguishes verification provenance (host_observed with exit code, human_confirmed, or agent_reported).

Completion tools reject missing proof (VERIFICATION_REQUIRED), validate exit codes, and support --require-trusted / require_trusted.

5. Context Handoff

Serializes decisions, modified files, blockers, and next actions.

Allows Claude Code, Codex, Cursor, Antigravity, and OpenCode to resume seamlessly with zero transcript dependency.


📸 Screenshots

Discovery, Scope Guard & Project Status

Catching unapproved scope creep mid-sprint and preserving explicit MVP boundaries from the terminal:

CLI Scope Guard and Status

Verification Gate & Cross-Agent Handoff

Blocking premature task completion until concrete test proof is recorded, then generating a resumable handoff snapshot:

Verification Gate and Cross-Agent Handoff


🚀 Quick Start

Prerequisites

  • Node.js 22.14+

Zero-Clone Usage (npx / pnpm dlx)

Run directly in any repository without cloning or building manually:

# Auto-detect AI hosts, install skills, and safely merge MCP config in one command
npx @agent-guardrail/cli setup

# Run interactive beginner-friendly project discovery
npx @agent-guardrail/cli init --interactive

# Or with pnpm dlx
pnpm dlx @agent-guardrail/cli init --interactive

# Check repository state & integrity
npx @agent-guardrail/cli status
npx @agent-guardrail/cli doctor

Configure your coding agent's MCP server using:

{
  "command": "npx",
  "args": ["-y", "@agent-guardrail/mcp-server"],
  "env": {
    "AGENT_GUARDRAIL_ROOT": "/ABSOLUTE/PATH/TO/TARGET/PROJECT"
  }
}

Local Source Setup (Contributors)

git clone https://github.com/albetsurya/agent-guardrail.git
cd agent-guardrail

corepack enable
pnpm install --frozen-lockfile
pnpm check
pnpm build
pnpm verify:release

🔌 Platform Integrations

AgentGuardrail ships a single shared MCP server (@agent-guardrail/mcp-server) over stdio alongside canonical Agent Skills (skills/) synchronized across five ecosystems:

AI Host

MCP Transport

Native Packaging & Skills

Config Template

Claude Code

stdio

.claude-plugin/plugin.json, .mcp.json, skills/

claude-code.mcp.json

OpenAI Codex

stdio

.codex-plugin/plugin.json, skills/

codex-config.toml

Cursor

stdio

plugin.json, mcp.json, skills/

cursor.mcp.json

Google Antigravity

stdio

.antigravity-plugin/plugin.json, mcp_config.json, rules/agent-guardrail.md, skills/

antigravity.mcp_config.json

OpenCode

stdio

opencode.json (mcp.servers), .opencode/skills/

opencode.json

To install canonical skills or configure MCP in a target project without cloning (core guardrail skills by default, or opt-in to the optional Anti-Slop quality skills anti-slop-code, anti-slop-copywriting, anti-slop-ui, and anti-slop-human):

# One-command interactive setup (auto-detects hosts + merges MCP config safely)
npx @agent-guardrail/cli setup

# One-command setup with lifecycle hooks (strict allowed_paths enforcement) + Anti-Slop skills
npx @agent-guardrail/cli setup --with-antislop --with-hooks --strict-hooks --yes

# Global user-home install or update across projects
npx @agent-guardrail/cli setup --global --with-antislop --update

# Or granular zero-clone commands
npx @agent-guardrail/cli inventory
npx @agent-guardrail/cli audit --fail-on-findings
npx @agent-guardrail/cli skills list
npx @agent-guardrail/cli skills install --target opencode --dry-run
npx @agent-guardrail/cli skills install --target claude-code --with-antislop
npx @agent-guardrail/cli skills remove --target claude-code
npx @agent-guardrail/cli mcp-config --target cursor

# Or install via native plugin / skills ecosystems (once published/hosted)
agy plugin install https://github.com/albetsurya/agent-guardrail
npx skills add albetsurya/agent-guardrail

# Or from a local repository checkout
node scripts/skills.mjs install --target claude-code --dest /PATH/TO/TARGET/PROJECT --with-antislop

🛡 Architecture & Security

  [ Claude Code ]   [ Codex ]   [ Cursor ]   [ Antigravity ]   [ OpenCode ]
         │              │            │               │               │
         └──────────────┴────────────┴───────┬───────┴───────────────┘
                                             │ stdio JSON-RPC (MCP SDK v2)
                                             ▼
    ┌────────────────────────────────────────────────────────────────────┐
    │  @agent-guardrail/mcp-server  &  @agent-guardrail/cli              │
    └────────────────────────────────┬───────────────────────────────────┘
                                     ▼
    ┌────────────────────────────────────────────────────────────────────┐
    │  @agent-guardrail/core (Deterministic Domain & Guardrail Engine)   │
    │  • Zod v4 strict validation & state machines                       │
    │  • Atomic temp-file writes + exclusive .write.lock (stale PID safe)│
    │  • Optimistic revision control (REVISION_CONFLICT)                 │
    │  • Symlink-escape prevention (root, directory, leaf file checks)   │
    │  • Corrupt JSON quarantine snapshots (.backups/)                   │
    └────────────────────────────────┬───────────────────────────────────┘
                                     ▼
                          .agentguardrail/ (Local JSON/MD)

Core Guarantees

  • Token-Efficient MCP Contract: Only 6 cohesive tools (~77% fewer tool definitions than naive 1:1 mappings) preserve LLM context window space alongside other MCP servers.

  • Zero Cloud & Zero Telemetry: 100% local-first execution; src/ contains zero network clients or arbitrary shell execution (child_process banned in core/server source via AST security tests).

  • Clean Packaging: Publishable workspace tarballs exclude test suites, .tsbuildinfo, .env, and runtime state.


📚 Documentation


📄 License

Distributed under the MIT License. See LICENSE for full details.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Project memory and scoping engine for AI coding agents. It gives any agent persistent project state, bounded work packages, and cross-session continuity.
      51 PyPI
      6
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to maintain project continuity through a file-based state hub with tasks, phases, and handoff snapshots. Provides MCP tools for reading and updating project state, with gatekeeping enforced via real-state evaluation and per-tool authorization.
      4
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables evidence-gated, multi-session AI coding runs with plan-build-ship state management, coordinating Claude Code and Codex native agents.
      20 npm
      MIT