aegisgate-mcp
Officialπ‘οΈ AegisGate MCP
Secure MCP server framework β 23 layers of defense, zero dependencies.
A hardened, zero-dependency MCP server written in pure Go. Build your MCP server on a foundation that has security built in from line one β not bolted on after a breach.
Apache 2.0 Β· 23 security layers Β· 91 regex patterns + CharCNN-BiLSTM (v13) ML detection Β· Zero CVEs Β· Zero external module dependencies
Quick Start Β· Security Layers Β· RBAC Β· Architecture Β· Protocol Β· Docs Β· Releases
β If AegisGate MCP helps you secure your AI agents, please consider β starring this repo. It helps others discover it.
AegisGate Securityβ’ is a trademark of AegisGate Security, LLC, filed with the USPTO. "AegisGate MCP" is an unregistered product name. See Trademark below.
Why AegisGate MCP?
38% of MCP servers have no authentication. 590+ security advisories. 3 critical CVEs in the official MCP SDKs in 6 months β including CVSS 9.8 remote code execution and the "Mother of All AI Supply Chains" flaw affecting 150M+ downloads.
The official MCP SDKs give you the protocol. They don't give you security. No authentication. No audit logging. No threat detection. No rate limiting. No RBAC. Every server built on a bare SDK starts with a blank security posture and it's on you to build it β or skip it, as 38% of servers do.
AegisGate MCP is the secure alternative. Build your MCP server on a foundation that has security built in from line one β not bolted on after a breach.
Official MCP SDKs | AegisGate MCP | |
Authentication | β Bring your own | β Bearer tokens + API keys + lockout |
Authorization | β Nothing | β 4-tier RBAC with per-tool permissions |
Audit logging | β Nothing | β Tamper-evident SHA-256 hash chain |
Threat detection | β Nothing | β 91 regex patterns + neural ML (<1ms) |
Supply chain risk | β npm/PyPI deps | β Zero dependencies (Go stdlib only) |
CVEs | 3 critical in 6 months | Zero. Ever. |
License | MIT | Apache 2.0 |
23 security layers. 91 regex patterns. Zero dependencies. Zero CVEs. Apache 2.0.
Need proxy mode, OAuth, SIEM, or compliance frameworks? See When to Upgrade to AegisGate Platform below β or explore AegisGate Rampart for local AI API proxy protection.
Related MCP server: Waygate MCP
Overview
AegisGate MCP is a hardened, zero-dependency MCP server written in pure Go. It sits between AI agents and the tools they call, applying 23 layers of defense to every request β from authentication and RBAC to neural threat detection and chain analysis.
Standard MCP servers assume a trusted local environment. In production β whether that's a cloud SaaS platform, an enterprise data pipeline, or an air-gapped plant network β agents may execute commands, query databases, or interact with critical systems. A single unauthorized or malicious tool call can cause data exfiltration, process disruption, or worse. AegisGate MCP wraps every tool call in defense-in-depth, all with zero external module dependencies so it can run air-gapped.
Version | 1.6.0 |
License | Apache-2.0 |
Go version | 1.26+ |
Module deps | Zero (no |
Docker image | ML: |
Architectures | amd64, arm64 |
ML model | CharCNN-BiLSTM v13, 1.6M params, <1ms CPU inference |
Tests | 611 unit/integration + 32 load/stress = 643 total, 14 benchmarks, 3 fuzz targets, 92.0% coverage (non-CGO) / 91.9% (CGO) |
Quick Start
Build
go build -o mcp-server ./cmd/mcp-serverRun
# Basic TCP server on :8081
./mcp-server
# With authentication and audit logging
./mcp-server --token my-secret --audit /var/log/mcp-audit.json
# With demo tools (ping, system_info, echo)
./mcp-server --demo
# stdio mode for local MCP clients (Claude Desktop, Cursor)
./mcp-server --transport stdio --demo
# Streamable HTTP mode (MCP 2025-06-18)
./mcp-server --transport http --addr :8081 --demo
# TLS + mutual TLS
./mcp-server --tls --tls-cert server.pem --tls-key server.key --tls-client-ca ca.pem
# Config file + health endpoint
./mcp-server --config /etc/mcp/config.json --health-addr :8082Docker
# Build and run (ML-enabled, ~127 MB, 0 CVEs)
docker build --target ml -t aegisgate-mcp .
docker run -p 8081:8081 aegisgate-mcp --demo
# With authentication and audit logging
docker run -p 8081:8081 \
-e MCP_AUTH_TOKEN=your-secret-token \
-e MCP_DEMO_TOOLS=true \
aegisgate-mcp
# Distroless heuristic-only build (~10 MB, 0 CVEs, zero OS packages)
docker build --build-arg CGO_ENABLED=0 --target lite -t aegisgate-mcp:lite .
docker run -p 8081:8081 aegisgate-mcp:lite --demoThe ML image uses debian:bookworm-slim with libgnutls30 purged (shared
libraries and dpkg metadata removed), eliminating all 6 Trivy CVEs while
keeping the glibc and ONNX Runtime dependencies required for neural
inference. The lite image is true distroless
(gcr.io/distroless/static-debian12:nonroot) β zero OS packages, zero
CVEs, ~10 MB. Both targets include a built-in --health-check flag for
Docker HEALTHCHECK (no wget/curl needed). Multi-arch builds support
both linux/amd64 and linux/arm64.
ML Threat Detection (L3)
AegisGate MCP includes the same CharCNN-BiLSTM v13 neural model used by AegisGate Platform and Rampart β vendored with zero external module dependencies. The model provides:
Semantic attack detection β catches prompt injection and jailbreak attempts that bypass regex pattern matching
Evasion resistance β detects obfuscation techniques (leetspeak, Unicode homoglyphs, character transposition, vowel deletion, word reversal)
Two-tier blocking β scores β₯0.95 block independently; scores 0.50β0.94 block only if L1 (regex) or L2 (input scanner) corroboration is present
Shadow mode β log predictions without blocking (for calibration)
Heuristic fallback β when CGO is unavailable, heuristic scoring provides baseline detection without ONNX
Flag | Env Var | Default | Description |
|
|
| Enable neural threat detection |
|
|
| Log predictions but never block |
|
|
| Threat score threshold (0.0β1.0) |
|
|
| Path to ONNX model file |
Library Usage
AegisGate MCP can be embedded as a Go library:
package main
import (
"context"
"log"
mcp "github.com/aegisgatesecurity/aegisgate-mcp"
)
func main() {
cfg := mcp.DefaultServerConfig()
cfg.AuthToken = "my-secret-token"
cfg.AuditLogPath = "/var/log/mcp-audit.json"
cfg.RateLimitRPM = 120
cfg.ScanResponses = true
server, err := mcp.NewSecuredMCPServer(cfg)
if err != nil {
log.Fatal(err)
}
// Register a custom tool
// Note: tools are automatically scanned for prompt-injection poisoning
// at registration time. If the description or inputSchema contains
// malicious patterns, RegisterTool returns *ToolPoisoningError.
server.RegisterTool("my_tool", "Does something useful", 40, map[string]interface{}{
"type": "object",
"properties": map[string]interface{}{
"param1": map[string]interface{}{"type": "string"},
},
"required": []interface{}{"param1"},
})
server.RegisterToolHandler("my_tool", func(ctx context.Context, params map[string]interface{}) (interface{}, error) {
return "result", nil
})
// Register a resource (MCP resources/list, resources/read)
server.RegisterResource("config://app/info", "App Info", "App config as JSON", "application/json",
func(ctx context.Context, uri string) (*mcp.ResourceContent, error) {
return &mcp.ResourceContent{URI: uri, Text: `{"version":"1.0"}`, MimeType: "application/json"}, nil
})
// Register a prompt (MCP prompts/list, prompts/get)
server.RegisterPrompt("code_review", "Generate a code review prompt",
[]mcp.PromptArgument{{Name: "filename", Required: true}},
func(ctx context.Context, args map[string]string) (*mcp.GetPromptResult, error) {
return &mcp.GetPromptResult{
Messages: []mcp.PromptMessage{{Role: "user", Content: "Review " + args["filename"]}},
}, nil
})
// Load built-in policy rules
server.LoadDefaultPolicies()
// Start the server
if err := server.Start(context.Background()); err != nil {
log.Fatal(err)
}
defer server.Stop()
}See examples/simple-server/ for a complete working example that registers a tool, resource, and prompt.
ML Model Hot-Swap
Reload the neural threat detection model at runtime without restarting the server:
// Swap to a new ONNX model file (verifies SHA-256 hash)
err := server.ReloadMLModel("/path/to/new_model.onnx")
if err != nil {
log.Printf("model reload failed: %v", err)
}Tool Poisoning Detection
All tools registered via RegisterTool() are automatically scanned for prompt injection in their descriptions and inputSchema. To scan manually:
err := server.ScanToolForPoisoning("my_tool", description, inputSchema)
if err != nil {
// err is *ToolPoisoningError β do not register this tool
}Security Layers
AegisGate MCP applies 23 security layers to every request, in order:
# | Layer | Description | Source |
1 | Authentication | Bearer token + API key, constant-time comparison, automatic lockout on repeated failures |
|
2 | Signature Verification | ECDSA P-256 anti-forgery β verifies message signatures against trusted public keys |
|
3 | Session Management | 256-bit cryptographically random session IDs, expiry, anti-hijacking checks |
|
4 | RBAC | 4-tier role hierarchy (restricted β standard β privileged β admin), per-tool permissions |
|
5 | Policy Engine | Allow/deny rules with conditions, priorities, time windows, and parameter patterns |
|
6 | Guardrails | Per-session tool call limits and rate limiting |
|
7 | Chain Analysis | Detects privilege escalation, data exfiltration chains, and repeated dangerous tool calls |
|
8 | Token Bucket Rate Limiting | Sliding-window rate limiting with token bucket algorithm (RPM + burst capacity) |
|
9 | Input Scanning | Scans tool parameters for prompt injection before execution (~79 patterns) |
|
10 | Response Scanning | Scans tool responses for PII, secrets, XSS, and prompt injection (~79 detection patterns) |
|
11 | Secret Redaction | Scrubs sensitive data (PII, secrets) from responses before returning to the client |
|
12 | Tool Execution Timeout | Configurable per-call timeout prevents hanging or runaway tools |
|
13 | STDIO Validation | Shell injection prevention via allowlist + blocklist for stdio transport commands |
|
14 | Audit Logging | All MCP actions logged to file + in-memory, queryable for compliance, tamper-evident hash chain |
|
15 | TLS / mTLS Transport | Encrypted TCP connections with optional mutual TLS |
|
16 | stdio Transport | Standard MCP client transport for Claude Desktop, Cursor, and other local integrations |
|
17 | Health Endpoint | HTTP |
|
18 | Parameter Validation | Required fields checked against each tool's |
|
19 | Neural Threat Detection (L3) | CharCNN-BiLSTM v13 model scores semantic attacks and evasion variants that regex misses. Two-tier blocking: β₯0.95 blocks independently, 0.50β0.94 requires L1/L2 corroboration |
|
20 | Heuristic Evasion Detection | Detects transposition, vowel deletion, word reversal, leetspeak, encoding, splitting, and zero-width character obfuscation |
|
21 | NFKC Unicode Normalization | Maps Unicode compatibility characters to canonical forms before scanning β defeats homoglyph and ligature attacks (full-width |
|
22 | Tool Poisoning Detection | Scans tool descriptions and |
|
23 | Evasion Detection (L2.5) | 15 regex patterns detecting encoding (base64, URL, unicode, HTML entities), splitting (zero-width chars, interleaving), obfuscation (leet speak, padding, markup), and semantic evasion (role-play framing, instruction override). Score β₯ 0.8 blocks independently; β₯ 0.3 logs warning. Runs between L1 regex and L3 neural detection |
|
Detection Pattern Categories (91 patterns)
AegisGate MCP scans all tool parameters and responses with 91 regex patterns across 8 categories:
Category | Patterns | Examples |
Prompt Injection | 13 | Ignore-previous-instructions, role-play escalation, delimiter injection, base64 payloads |
Dangerous Functions | 28 | eval(), exec(), os.system(), subprocess(shell=True), pickle.loads(), child_process.exec() |
Credentials | 7 | AWS keys, GitHub PATs, JWT tokens, RSA private keys, generic API keys |
PII | 5 | SSN, email, credit cards (Visa, Mastercard, Amex) |
RAG Attacks | 9 | Vector store injection, RAG smuggling, retrieval bypass, embedding poisoning |
Prompt Leakage | 7 | System prompt disclosure, meta-instruction references, tool list disclosure |
XSS | 3 | Script tags, SVG onload, image onerror |
Compliance/OT | 9 | OWASP LLM01/02/06, OPC UA, Modbus, DNP3, network addresses |
Configuration Priority
Configuration is resolved in order of highest to lowest priority:
CLI flags β override everything
Environment variables β override config file
JSON config file (
--config) β overrides built-in defaultsBuilt-in defaults
CLI Flags
All CLI flags have environment variable equivalents:
Flag | Env Var | Default | Description |
|
|
| Listen address (TCP mode) |
|
|
| Transport mode: |
|
| (empty) | Bearer token for authentication |
|
| (empty) | Audit log file path |
|
|
| Max concurrent sessions |
|
|
| Max concurrent TCP connections (-1 = unlimited) |
|
|
| Rate limit (requests/min) |
|
|
| Tool execution timeout (seconds) |
|
|
| Enable response scanning |
|
|
| Block responses containing PII |
|
|
| Block responses containing secrets |
|
|
| Block responses containing XSS |
|
|
| Block responses containing prompt injection |
|
|
| Enable secret/PII redaction |
|
|
| Redact PII from responses |
|
|
| Redact secrets from responses |
|
|
| Redaction placeholder text |
|
|
| Enable TLS transport |
|
| (empty) | Server certificate file (PEM) |
|
| (empty) | Server private key file (PEM) |
|
| (empty) | CA bundle for client certs (enables mTLS) |
|
|
| Minimum TLS version: |
|
| (empty) | Health endpoint listen address (empty = disabled) |
|
| (empty) | JSON config file path |
|
|
| Register demo tools (ping, system_info, echo) |
|
|
| Enable neural threat detection (L3, requires CGO build) |
|
|
| ML shadow mode: log predictions but never block |
|
|
| ML threat score threshold (0.0β1.0) |
|
|
| Path to ONNX model file |
JSON Config File
{
"address": ":8081",
"auth_token": "my-secret-token",
"audit_log_path": "/var/log/mcp-audit.json",
"max_sessions": 100,
"max_connections": 1000,
"rate_limit_rpm": 120,
"exec_timeout_seconds": 30,
"scan_responses": true,
"block_on_pii": true,
"block_on_secrets": true,
"block_on_xss": true,
"block_on_prompt_inject": true,
"redact_enabled": true,
"redact_pii": true,
"redact_secrets": true,
"redact_placeholder": "[REDACTED]",
"tls_enabled": true,
"tls_cert_file": "/etc/ssl/mcp/server.pem",
"tls_key_file": "/etc/ssl/mcp/server.key",
"tls_client_ca_file": "/etc/ssl/mcp/ca.pem",
"tls_min_version": "1.3",
"demo_tools": true
}Transport Modes
Mode | Flag | Description |
|
| TCP listener, supports TLS/mTLS encryption for network deployments |
|
| Standard MCP stdin/stdout transport for local clients (Claude Desktop, Cursor) |
|
| Streamable HTTP (MCP 2025-06-18) β POST JSON-RPC to |
Health Endpoints
When --health-addr is set, a separate HTTP listener provides observability endpoints:
Endpoint | Method | Description |
|
| Liveness probe β returns |
|
| Readiness probe β returns |
|
| Server statistics as JSON (sessions, rate limits, tool calls, |
RBAC Roles
AegisGate MCP enforces a 4-tier role hierarchy. Roles are ordered: restricted < standard < privileged < admin.
Role | Level | Access | Example Tools |
| 0 | Read-only tools only |
|
| 1 | Read + low-risk write |
|
| 2 | Everything except high-risk execution | All tools except |
| 3 | All tools, no restrictions | All registered tools |
Role comparison uses AgentRole.AtLeast() β a privileged agent can access any tool that requires standard or restricted, but not tools that require admin.
Policy Engine
The Policy Engine evaluates allow/deny rules before any tool executes. Rules support:
Tool name matching β exact names and wildcard patterns
Agent role conditions β apply rules only to specific roles
Risk score thresholds β trigger on
RiskAbovevaluesPriorities β higher-priority rules evaluated first
Time windows β restrict tools to specific time ranges
Parameter patterns β match against tool call parameters
Actions β allow, deny (with reason), log level, risk modifiers
Built-in Policy Rules
Loaded via LoadDefaultPolicies():
Rule ID | Priority | Action | Condition | Description |
| 100 | Deny | Tool names: | Shell commands require admin role |
| 90 | Deny | Tool names: | File deletion requires privileged or admin role |
| 80 | Deny | Tool names: | Network operations not allowed for restricted agents |
| 50 | Allow + Alert | Risk score > 70 | Flags high-risk operations for audit logging |
Custom rules can be added programmatically:
server.AddPolicyRule(mcp.PolicyRule{
ID: "block-after-hours",
Name: "Block Dangerous Tools After Hours",
Description: "No high-risk tools outside business hours",
Condition: mcp.RuleCondition{
ToolNames: []string{"shell_command", "file_delete"},
TimeWindow: &mcp.TimeWindow{
Start: "08:00",
End: "18:00",
},
},
Action: mcp.RuleAction{
Allow: false,
DenyReason: "High-risk tools only available during business hours",
LogLevel: "warn",
},
Priority: 75,
Enabled: true,
})Chain Analysis
The Chain Analyzer tracks sequences of tool calls within a session (rolling window of 20 calls) and flags suspicious patterns:
Detection | Flag | Trigger |
Privilege Escalation |
| Low-risk tool call followed by a high-risk tool ( |
Data Exfiltration |
| Read of sensitive data ( |
Repeated Dangerous Tools |
| 3+ high-risk tool calls within the analysis window |
When any flag is raised, the chain risk is set to High and the event is logged at WARN level with the session ID, flags, and call count.
AegisGate MCP supports ECDSA P-256 message signing to prevent request forgery and tampering.
Clients sign the canonical JSON of each request (with Signature and KeyID fields zeroed out)
and include the signature in the request header.
Server Setup
server, _ := mcp.NewSecuredMCPServer(cfg)
// Register a trusted client public key (SEC1 encoded)
server.AddTrustedKey("agent-001", clientPubKeySEC1)Client Signing (example)
import (
"crypto/ecdsa"
"crypto/sha256"
"crypto/rand"
"encoding/hex"
)
func signRequest(privKey *ecdsa.PrivateKey, canonicalJSON []byte) string {
hash := sha256.Sum256(canonicalJSON)
sig, _ := ecdsa.SignASN1(rand.Reader, privKey, hash[:])
return hex.EncodeToString(sig)
}The server verifies the signature using ecdsa.VerifyASN1 against the trusted public key.
If no KeyID or Signature is present, verification is skipped β allowing interoperability
with unsigned clients while enforcing signatures for clients that provide them.
Test Coverage
Category | Tests | Coverage |
Unit + integration (non-CGO) | 611 | 92.0% |
Unit + integration (CGO + ML) | 611 | 91.9% |
Load / stress / burst / crush / chaos (build tag: | 32 | β |
Benchmarks | 14 | β |
Fuzz targets | 3 | β |
Race detector | β Clean | β |
Running Tests
# Non-CGO test suite (heuristic-only, no ONNX)
CGO_ENABLED=0 go test ./... -count=1 -timeout 120s
# CGO test suite (full ML, requires libonnxruntime.so)
CGO_ENABLED=1 CGO_LDFLAGS="-L$(pwd)/lib/amd64 -lonnxruntime" go test ./... -count=1 -timeout 120s
# With race detector (CGO only β -race requires CGO)
CGO_ENABLED=1 CGO_LDFLAGS="-L$(pwd)/lib/amd64 -lonnxruntime" go test -race -count=1 -timeout 300s ./...
# Load/stress/burst/crush/chaos tests (behind build tag)
go test -tags=load -count=1 -timeout 600s -v ./...
# Benchmarks (regression tracking)
go test -bench=. -benchmem -benchtime=5s ./...
# Fuzz testing (run for 60 seconds per target)
go test -fuzz=FuzzHandleRequest -fuzztime=60s ./...Performance Characteristics
Validated via the k6-style load test suite (//go:build load):
Core Performance
Metric | Value | Test |
Sustained throughput | 14,427 req/sec |
|
p50 latency (100 concurrent) | 34 ms |
|
p99 latency (100 concurrent) | 46 ms |
|
Connection churn rate | 2,662 conn/sec |
|
Goroutine leaks (10s soak) | 0 |
|
Graceful shutdown under load | 1.6 ms |
|
k6-Style Stress / Burst / Crush Results
Metric | Value | Test |
Stress ramp-up (500 conns) | 100% success, p99=65ms, 738 rps |
|
Burst request spike (1000 reqs) | 12,710 req/sec |
|
Burst recovery | 0.99Γ baseline (instant) |
|
Crush beyond MaxConnections | Enforced + server responsive |
|
Goroutine leak (500 churn) | Ξ=0 |
|
FD leak (500 churn, 5 rounds) | Ξ=1 |
|
Graceful shutdown under load | 1.6ms (50 active generators) |
|
HTTP concurrent (50 clients) | 2,290 rps, p99=16ms |
|
HTTP sustained (20Γ30 pings) | 0 goroutine leaks |
|
Cross-transport latency | HTTP 0.62Γ TCP |
|
Chaos random drops (30%) | Server survived all |
|
Malformed flood (500 mixed) | Server survived all |
|
AegisGate MCP has zero external module dependencies. The go.mod file contains
no require directives. All third-party code (ONNX Runtime bindings, Unicode
normalization, ML model) is vendored into internal/, lib/, and models/.
module github.com/aegisgatesecurity/aegisgate-mcp
go 1.26.9
// Zero external module dependencies (no `require` directives).
// All third-party code is vendored into internal/ β see NOTICE for details.Vendored components (see NOTICE for full attribution):
Component | License | Location |
onnxruntime_go (Go bindings) | MIT |
|
libonnxruntime.so (Microsoft) | MIT |
|
golang.org/x/text (Unicode norm) | BSD-3-Clause |
|
CharCNN-BiLSTM v13 model | Apache-2.0 |
|
Why this matters:
Air-gapped deployment β no
go mod downloadneeded, no supply chain riskNo transitive dependencies β nothing to audit beyond vendored code
Reproducible builds β the binary is identical across builds
Minimal attack surface β all third-party code is visible and auditable
Fast compilation β no dependency resolution overhead
Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AegisGate MCP Server β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β TCP Mode: β
β ββββββββββββ ββββββββββββββββ βββββββββββββ ββββββββββββββββ β
β β TCP βββββΆβ Auth βββββΆβ GuardrailsβββββΆβ Response β β
β β Client β β Middleware β β (Rate + β β Scan β β
β β β β (Token + β β Chain) β β (PII/Secrets β β
β β (TLS/ β β Signature + β β β β /XSS/Inject)β β
β β mTLS) β β Session) β β β β β β
β ββββββββββββ ββββββββββββββββ βββββββββββββ ββββββββ¬ββββββββ β
β β β
β βΌ β
β stdio Mode: ββββββββββββββββββββββββ β
β ββββββββββββ (same security chain, β Request Handler β β
β β stdin / β stdin/stdout instead β ββββββββββββββββββ β β
β β stdout β of TCP) β β RBAC Check β β β
β ββββββββββββ β ββββββββββββββββββ€ β β
β β β Policy Engine β β β
β β ββββββββββββββββββ€ β β
β β β Param Validateβ β β
β β ββββββββββββββββββ€ β β
β β β Tool Registry β β β
β β β + Exec Timeoutβ β β
β β ββββββββββββββββββ β β
β ββββββββββββββββββββββββ β
β β
β Health Endpoint (separate HTTP listener): β
β ββββββββββββββββββββββββββββββββββββββββββ β
β β GET /healthz β liveness β β
β β GET /readyz β readiness β β
β β GET /stats β server statistics β β
β ββββββββββββββββββββββββββββββββββββββββββ β
β β
β Audit Log: all MCP actions β file + in-memory (queryable) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββRequest flow:
TCP Client connects (optionally over TLS/mTLS) or stdio sends JSON-RPC via stdin
Auth Middleware validates bearer token/API key (constant-time), verifies ECDSA signature, creates/validates session
Guardrails enforce rate limits, session limits, and run chain analysis
Response Scan (pre-execution parameter validation happens in handler)
Request Handler checks RBAC permissions, evaluates Policy Engine rules, validates required parameters against
inputSchema, executes tool with timeoutResponse Scan (post-execution) scans tool output for PII, secrets, XSS, prompt injection; redacts if enabled
Audit Log records the complete action chain
MCP Protocol Support
AegisGate MCP implements the following JSON-RPC methods (MCP Protocol 2025-06-18):
Method | Type | Description |
| Request | Parses |
| Notification | Handled silently β no response sent (per MCP spec) |
| Notification | Client-initiated cancellation β logged, no response sent |
| Server-initiated | Sent when tools are added or removed |
| Server-initiated | Sent when resources are added or removed |
| Server-initiated | Sent when a subscribed resource's content changes |
| Server-initiated | Sent when prompts are added or removed |
| Request | Returns registered tools with descriptions and |
| Request | Executes a tool after passing all security layers |
| Request | Returns registered resources (URIs, names, descriptions). Supports cursor-based pagination |
| Request | Reads a resource by URI β calls the registered |
| Request | Returns registered URI templates for parameterized resources |
| Request | Subscribes the session to resource update notifications for a URI |
| Request | Removes a resource subscription |
| Request | Returns registered prompts (names, descriptions, arguments). Supports cursor-based pagination |
| Request | Gets a prompt by name with optional arguments β calls the registered |
| Request | Health check β returns empty success response |
Streamable HTTP session management (v1.2.2+):
POST /mcpwithinitializeβ response includesMcp-Session-IdheaderPOST /mcpwith subsequent requests β must includeMcp-Session-IdheaderDELETE /mcpwithMcp-Session-Idheader β terminates session (204 No Content)Sessions expire after 30 minutes of inactivity
AegisGate MCP serves any environment where AI agents interact with tools β from cloud SaaS platforms to enterprise data pipelines to OT/ICS plant networks. The same 21 security layers apply regardless of deployment context.
General Deployments
Cloud SaaS β protect user-facing AI features from prompt injection and data exfiltration
Enterprise data access β enforce RBAC and audit logging on agent-driven database queries
CI/CD automation β restrict what AI-assisted pipelines can execute
Air-gapped networks β zero dependencies means the server runs with no internet access
OT/ICS Environments
In an OT/ICS environment, AegisGate MCP sits between AI agents and critical infrastructure tools:
AI Agent (Claude, Cursor, custom)
β
βΌ
ββββββββββββββββββββ
β AegisGate MCP β β 23 security layers
β (TLS/mTLS) β
ββββββββββ¬ββββββββββ
β
ββββββΌβββββ¬βββββ¬βββββ
βΌ βΌ βΌ βΌ βΌ
SCADA PLC Hist Tag Log
Read Status Query DB AnalyzerTypical deployment scenarios:
Read-only monitoring agent β
restrictedrole, can query SCADA status and historian data but cannot issue commandsMaintenance agent β
standardrole, can read files and search code during troubleshootingOperations agent β
privilegedrole, can interact with most tools but cannot execute shell commandsAdmin agent β
adminrole, full access for authorized maintenance windows
Security features particularly relevant to OT/ICS:
TLS/mTLS encrypts all traffic on the plant network
Time-window policies restrict high-risk tools to maintenance windows
Chain analysis detects if an agent reads sensitive process data then attempts an external network write (exfiltration)
Audit logging provides a complete chain of custody for compliance (NERC CIP, IEC 62443)
Air-gapped operation β zero dependencies means the server can be deployed on isolated networks with no internet access
Demo Tools
Enable demo tools with the --demo flag or by calling RegisterDemoTools() in library mode.
These are safe, read-only tools that do not access the filesystem, network, or any external resources.
Tool | Risk Level | Required Params | Description |
| 10 | (none) | Returns |
| 30 | (none) | Returns Go version, OS, arch, CPU count, goroutine count, timestamp |
| 20 |
| Echoes back the provided message |
Example β system_info response:
{
"go_version": "go1.26.9",
"os": "linux",
"arch": "amd64",
"cpus": 8,
"goroutines": 12,
"timestamp": "2026-10-08T08:58:00Z"
}Documentation
Detailed documentation is available in the docs/ directory:
Document | Description |
Installation, first run, and basic configuration | |
Production deployment: Docker, TLS, air-gapped setups | |
Administration: sessions, audit logs, RBAC management, policies | |
Task-specific guides: custom tools, signature verification, mTLS setup | |
Tutorial: build a complete secure MCP server from scratch with custom tools, RBAC, and policies | |
Connect Cursor to AegisGate MCP via Streamable HTTP transport | |
ML model details: architecture, training data, performance metrics | |
Feature comparison: AegisGate MCP vs official MCP SDKs and bolt-on wrappers | |
OWASP MCP Top 10 risk mapping β coverage for all 10 security risks | |
Roadmap for SSE streaming, server-initiated notifications, resource subscriptions, and resource templates (P1βP4 complete) |
Changelog
See CHANGELOG.md for version history and notable changes.
Platform Interop (Optional)
AegisGate MCP can optionally integrate with AegisGate Platform for pattern pulling and event forwarding:
Pattern Pull: Fetch canonical detection patterns from Platform's telemetry endpoint with ETag caching
Event Forwarding: Send security events to Platform's telemetry receiver in canonical contract format
Tool Description Screening: Enhanced with 34 dangerous function patterns from AegisGate Scanner
All interop features are air-gap compatible β fully disabled when platform_url is not configured. No network calls, no telemetry, no external dependencies.
When to Upgrade to AegisGate Platform
AegisGate MCP is a standalone secure MCP server framework β perfect for building and running MCP servers with security built in. It's free, open source, and has zero external dependencies.
When your needs grow beyond a single server, AegisGate Platform is the natural upgrade path:
Need | AegisGate MCP (free) | AegisGate Platform |
Secure MCP server framework | β 23 layers, zero deps | β Embedded MCP server |
ML threat detection | β Capped at 100 inf/min (single-server) | β Unlimited, org-wide |
Proxy/gateway mode | β Framework, not proxy | β Sits between clients and all AI services |
OAuth 2.0 / OIDC / SSO | β Bearer tokens + API keys | β SAML, OIDC, JWT |
SIEM integration | β File-based audit + Prometheus | β Splunk, Elasticsearch, QRadar, Datadog (11 platforms) |
Compliance frameworks | β None | β 31 frameworks (HIPAA, PCI, SOC 2, EU AI Act, NIST, etc.) |
Multi-protocol (HTTP, A2A, ACP) | β MCP only | β 6 pillars |
Enterprise scale | β οΈ 250 connections, 25 sessions | β Unlimited |
Think of it this way: AegisGate MCP is the secure foundation you build MCP servers on. AegisGate Platform is the enterprise gateway that secures all AI traffic across your organization β including MCP, HTTP, A2A, and ACP.
Other AegisGate products:
AegisGate Rampart β Free local proxy for developers using Claude, Cursor, or Copilot
AegisGate Lens β Free browser extension for everyday AI conversations
License
Apache-2.0. See LICENSE for the full text and NOTICE for attribution.
Security
See SECURITY.md for vulnerability reporting.
Contributing
See CONTRIBUTING.md. All commits must be signed off (git commit -s) per the DCO.
IP Notice
AegisGate's core technologies are patent pending with the USPTO (Provisional App. Nos. 64/153,573β64/153,577, filed September 12, 2026; and 64/174,824, filed October 12, 2026). Source code is Β© 2025-2026 AegisGate Security, LLC. Licensed under Apache 2.0.
Trademark
AegisGate Securityβ’ is a trademark of AegisGate Security, LLC, filed with the United States Patent and Trademark Office (USPTO). The mark was published for opposition on October 13, 2026.
AegisGate MCP is an unregistered product name of AegisGate Security, LLC. The β’ symbol is not used for this product name, as it has not been separately filed as a trademark application. Use of the "AegisGate Security" mark is governed by the Lanham Act (15 U.S.C. Β§ 1126) and applicable state trademark law.
Permission is granted to use the AegisGate name and marks in connection with the unmodified open-source software distribution as published on GitHub. Use of the AegisGate name, logo, or other brand assets in derivative works, commercial products, service offerings, or marketing materials requires prior written permission from AegisGate Security, LLC.
Contact: legal@aegisgatesecurity.io
π AegisGate Security Β· π¬ Discord Β· βοΈ support@aegisgatesecurity.io Β· π @aegisgate Β· π± Telegram Β· π @aegisgate@mastodon.social
Made with π€ by AegisGate Security developers to secure the AI attack surface.
This server cannot be deployed
Maintenance
Related MCP Connectors
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
MEOK MCP Hardening MCP β automated security red-team for any MCP server. Maps OWASP LLM Top 10
MCP server: static security scanner for MCP servers, agent skills & plugins. 17 attack patterns.
- ArcjetOAuthcom.arcjet
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceSecure, Multi-Tenant MCP Server Framework for Modern AI30Apache 2.0
- AlicenseNot gradedqualityAmaintenanceA security-hardened, containerized MCP server framework that provides superior isolation and enterprise-grade security through Docker containers. Enables secure MCP command execution with comprehensive diagnostics, plugin architecture, and production-ready features like SSL/TLS and rate limiting.2MIT
- AlicenseAqualityBmaintenanceEnables creation of secure-by-default MCP servers with 5-layer validation to protect against injection, path traversal, and other attack vectors.71,047 npm2MIT
- FlicenseNot gradedqualityCmaintenanceA production-ready, modular MCP server with 40+ tools across 8 categories, featuring dynamic auto-loading and sandboxed security for file system, database, and network operations.-