ABS Core v4.1.0
Guides

MCP Security Gateway

Configure ABS Core as a security proxy for the Model Context Protocol -- enforcement modes, policy hot-reload, and production deployment.

MCP Security Gateway

ABS Core operates as a transparent security proxy for MCP (Model Context Protocol) tool calls. Every request passes through the governance pipeline before reaching the target tool server.


How It Works

  AI Client (Claude, Cursor, etc.)
         |
         | MCP stdio
         v
  +-------------------+
  | ABS Core Gateway  |  <-- Intercepts here
  |                   |
  | OID -> HASH ->    |
  | ENGINE -> LEDGER  |
  +-------------------+
         |
         | MCP stdio (if ALLOW)
         v
  Target MCP Server (filesystem, database, API)

The gateway sits between the MCP client and the MCP server. It reads every tools/call request, evaluates it, and either forwards it (ALLOW) or blocks it (DENY) with a governance reason.


Configuration

Basic Setup

{
  "mcpServers": {
    "governed-filesystem": {
      "command": "npx",
      "args": ["@abscore/mcp-gateway", "watch", "--target", "npx @modelcontextprotocol/server-filesystem /allowed/path"]
    }
  }
}

Policy File

The gateway loads policies from .abs/policy.json:

{
  "version": "4.1.0",
  "enforcement_mode": "FULL",
  "deny_tools": ["rm", "sudo", "eval", "exec"],
  "escalate_tools": ["db.write", "api.external"],
  "allow_tools": ["db.read", "file.read"],
  "deny_models": [],
  "arg_restrictions": {
    "db.query": {
      "blocked_patterns": ["DROP", "DELETE", "TRUNCATE", "ALTER"]
    },
    "file.write": {
      "blocked_patterns": ["/etc/", "/usr/", "~/.ssh/"]
    }
  }
}

Enforcement Modes

ModeBehaviorUse Case
FULLDENY blocks execution. Active license required.Production
AUDIT_ONLYAll calls pass through. Decisions recorded but not enforced.Evaluation / expired license
STRICTDENY on any unrecognized tool. Explicit allowlist required.High-security environments

The enforcement mode is recorded in every SovereignAuditRecord via the license_status field:

{
  "license_status": "FULL",
  "decision": "DENY",
  "reason": "Tool 'rm' is in deny_tools list"
}

Decision Flow

For every intercepted tools/call:

  1. Parse -- Extract tool name, arguments, and caller identity
  2. OID Verify -- Validate Ed25519 signature (if agent is registered)
  3. Policy Match -- Check deny_tools, then escalate_tools, then allow_tools
  4. Arg Restrict -- Scan arguments against blocked_patterns
  5. Decide -- ALLOW, DENY, or ESCALATE
  6. Record -- Append to hash chain with SHA-256 block hash
  7. Sign -- Generate Ed25519 crypto receipt
  8. Forward or Block -- Execute or return governance error

Total latency: < 0.015ms (P99).


Hot-Reload

Policy changes are detected automatically:

# Edit the policy while the gateway is running
vim .abs/policy.json

# Gateway logs:
# [ABS CORE] Policy reloaded: .abs/policy.json (3 deny, 2 escalate, 2 allow)

No restart required. The new policy applies to the next tool call.


Monitoring

# Real-time status
npx @abscore/mcp-gateway status

# Export audit trail
npx @abscore/mcp-gateway export --format jsonl --output audit.jsonl

# Verify chain integrity
npx @abscore/mcp-gateway verify

Production Deployment

Systemd Service

[Unit]
Description=ABS Core MCP Governance Gateway
After=network.target

[Service]
Type=simple
User=abs-core
ExecStart=/usr/local/bin/npx @abscore/mcp-gateway watch
Restart=always
RestartSec=5
Environment=ABS_POLICY_PATH=/etc/abs-core/policy.json
Environment=ABS_KEY_DIR=/etc/abs-core/keys

[Install]
WantedBy=multi-user.target

Docker

FROM node:22-slim
WORKDIR /app
RUN npx @abscore/mcp-gateway init
COPY policy.json .abs/policy.json
CMD ["npx", "@abscore/mcp-gateway", "watch"]

On this page