Model Context Protocol (MCP) Security for AI Agents
MCP gives AI agents real system permissions — and the protocol itself mandates no sandboxing, no integrity verification, and no audit trail. G8KEPR wraps every tools/call in a 7-step pipeline with rug-pull detection, per-tool rate limits, and a per-call audit record.
Understanding the Model Context Protocol and why it needs security
MCP is the open standard that lets AI agents interact with external tools, data sources, and systems. Think of it as the "API for AI agents" — but instead of HTTP requests, AI agents use natural language to invoke tools.
file_read("/data/users.csv")sql_query("SELECT * FROM orders")http_request("stripe.com/charges")send_email(to, subject, body)MCP tools execute with real system permissions. Without security controls, AI agents become attack vectors. Traditional API security doesn't work — MCP tool calls are invoked by an LLM that can be coerced, not by humans.
Transparent proxy that intercepts, validates, and logs every MCP tool call
file_read("/prod/users.csv")tools/call passes seven sequential checks before execution✓ Approved and logged in 4.2ms • Zero code changes to agent or tool
See every MCP tool invoked by your AI in real-time. Tool name, arguments, context, user, and response - all logged.
Granular control over which agents can call which tools. Block unauthorized access before it happens.
AI-powered detection blocks attackers trying to manipulate your agent into calling unauthorized tools.
Five capabilities that are not in the MCP spec and not in published reference implementations — the platform-level additions that make MCP safe for production.
Off unless MCP_STDIO_SERVERS_ENABLED is set. Interpreter / package-runner allowlist, inline-code flags rejected, scrubbed env, setsid(), RLIMIT_NPROC 64 / NOFILE 128 / AS 4 GiB / FSIZE 100 MiB, one process per call, stopped after it.
modules/mcp/interceptor_transport.pyTool definition hash registered at tools/list, re-verified on every tools/call.
modules/mcp/tool_registry.pyScans tool output for LLM-directed instructions before re-ingestion as context.
modules/mcp/output_verification.pyRisk score (max 110) detects coordinated multi-user and 24h slow-and-low attacks.
modules/mcp/correlation/analyzer.pyEvery tool call is logged with arguments, response and decision. Authentication and domain events are HMAC-SHA256 hash-chained per tenant and verified daily (since 2026-09-13).
mcp_tool_callsAnthropic's MCP protocol defines the interface between AI agents and tools. G8KEPR defines the security layer underneath it — the parts that have to exist for the protocol to be safe in production.
Each MCP tool-call row carries the correlation ID of the HTTP request that made it, and every pillar publishes its findings to one threat event bus, where the compound correlator joins them — a property of running the pillars on one platform that a standalone MCP-only tool does not have.
How G8KEPR blocks actual MCP threats in production
file_read("/etc/passwd")sql_query("DELETE FROM users WHERE...")tools/list returns mutated definitionhttp_request response payloadstdio server launchDistributed tool calls across sessionsPurpose-built for securing AI agent tool calls
Real-time visibility into every MCP tool invocation. Agent, tool name, full arguments, response, duration, and threat score — all logged with a correlation ID linking back to the parent AI request.
Tables: mcp_tool_calls, mcp_sessionsPer-tool, per-user/role RBAC. Approval-required flag for sensitive tools, MFA gates for privileged tools, parameter-level constraints, and time-limited grants.
ToolPermissionService → mcp_permissionsSHA-256 hash of every tool definition (name, description, parameters, schema) is registered at tools/list. Each tools/call re-hashes and compares — any drift blocks execution and fires a CRITICAL alert.
MCPRugPullDetectedError → ThreatEventBusStdio MCP servers start only from an allowlisted interpreter or package runner (npx, uvx), and only when the operator sets MCP_STDIO_SERVERS_ENABLED (off by default), with inline-code flags rejected, no shell and a scrubbed environment. On Linux each runs in its own session (setsid) with RLIMIT_NPROC 64, RLIMIT_NOFILE 128, RLIMIT_AS 4 GiB and RLIMIT_FSIZE 100 MiB. Each call gets its own server process, stopped once the call is answered or the connection timeout (30s default) passes. No CPU-time limit and no egress filter.
modules/mcp/interceptor_transport.pyTool output is scanned before it reaches the LLM. Blocks injection payloads in retrieved documents and API responses — the most common indirect-prompt-injection vector.
IndirectInjectionScanner • MCP_RESPONSE_SCAN_ENABLEDA one-minute sliding window per user, per tool, within each org: 60 calls/min by default, overridable per tool in the permission grant. Over the limit, the call is refused with a retry-after and a rate_abuse event; if the limiter itself errors, the call is refused.
modules/mcp/rate_limiter.py — interceptor step 3Looks across a session’s turns, not just one call: many-shot jailbreaking, crescendo escalation, skeleton-key overrides, fabricated prior agreements and permission drift. State is kept per organization and session, and the checks run when the request carries an MCP session id.
multi_turn_attack_detector.py • cross_turn_memory.pyEvery tool call written to the audit log, with PII-redacted columns, exportable in JSON/CSV/SIEM formats for SOC 2, HIPAA, GDPR evidence.
Format: JSON • CSV • SIEM (Splunk, Datadog)6-dimension risk score (max 110) across tool sensitivity, data volume, burst, denials, prior detections, and tool diversity. Detects coordinated multi-user attacks and 24h slow-and-low patterns.
MCPCorrelationAnalyzer — alert at score > 50Tag any tool as MFA-required and G8KEPR will pause the tool call until a TOTP code is presented. Enforced inline during step 2 of the security pipeline — before the tool ever runs.
Every MCP session is recorded to mcp_tool_calls with full arguments, response, threat results, and the correlation ID of the parent AI request. While the session is live, an in-memory context chain links each tool call to its result and runs chain correlation analysis as each call arrives.
Protocol-level security for any MCP-compliant agent or framework
Official MCP support from Anthropic
VerifiedMCP tool integration
SupportedAny MCP implementation
UniversalProtocol-agnostic
Compatiblestdio— subprocess MCP serversHTTP— REST-based MCP serversWebSocket— streaming MCP serversAny MCP tool that implements the protocol can be secured by G8KEPR
Everything you need to know about securing MCP tool calls
Need help securing your MCP implementation?
Talk to our MCP security experts →These are control mappings, not attestations: they show where the audit records apply, not that an auditor has tested the control. Mappings are pre-built — auditors get exports, not spreadsheets.
Subject to independent audit and attestation. G8KEPR provides the technical controls and evidence — your auditor issues the certification.
Complete visibility, granular permissions, contained subprocess execution, and an audit record for every AI agent tool call. Zero code changes.
No credit card required • Unlimited MCP tool calls • Full feature access