MCP Gateway
Deterministic firewall between AI agents and enterprise infrastructure
MCP Gateway
The Nexus MCP Gateway acts as a deterministic firewall between your probabilistic AI agents and your mission-critical infrastructure. It performs deep packet inspection on every JSON-RPC tool call before it reaches your backend.
Zero-LLM latency
Unlike prompt-based guardrails that rely on a secondary LLM to evaluate safety, the Nexus Gateway evaluates execution payloads against compiled Network Policy Language (NPL) rules entirely in-memory.
| Metric | Value |
|---|---|
| p50 latency | ~160 ms |
| p99 latency | < 201 ms |
| Token cost | 0 |
Policies compile from the open npl-spec repository. View open-source spec →
Inspection pipeline
flowchart TD
A[JSON-RPC request] --> B{Valid RPC 2.0?}
B -->|no| X[BLOCK: MCP_MALFORMED_RPC]
B -->|yes| C{Server whitelisted?}
C -->|no| X2[BLOCK: MCP_SERVER_NOT_WHITELISTED]
C -->|yes| D{Method blocked?}
D -->|yes| X3[BLOCK: MCP_METHOD_BLOCKED]
D -->|no| E{Destructive op?}
E -->|yes| X4[BLOCK: MCP_DESTRUCTIVE_OP_BLOCKED]
E -->|no| F{NPL policy}
F -->|deny| X5[BLOCK + audit]
F -->|require_human| H[Approval queue]
F -->|allow| G[Forward to backend]Decision types
| Decision | Behavior |
|---|---|
allow | Forward to backend (or mock in simulation mode) |
deny | Block with stable reasonCode, audit before agent sees error |
require_human_approval | Queue for operator review, block until resolved |
Inspect an MCP call
curl -X POST "https://api.hardalion.com/api/v1/mcp/gateway/inspect" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agt_prod_f8a92b",
"execution_id": "exec_01hxyz",
"server_id": "enterprise-db",
"tool_name": "query_ledger",
"execution_mode": "production",
"request": {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "query_ledger",
"arguments": { "account_id": "ACC-4421" }
}
}
}'Scope required: agents:execute.
Connecting a LangChain agent
Wrap your tools with the Nexus SDK and provide your AgentIAM passport:
import { NexusGateway } from '@hardalion/sdk'
import { myEnterpriseTools } from './tools'
const securedTools = NexusGateway.wrap(
{ invoke: myEnterpriseTools.invoke.bind(myEnterpriseTools) },
{
tenantId: 'ten_acme',
agentId: 'agt_prod_f8a92b',
apiKey: process.env.HARDALION_API_KEY,
baseUrl: 'https://api.hardalion.com',
policy: 'hardalion://nato-prou-strict-financial@1.0.0',
},
)
// Pass securedTools to your LangChain or CrewAI instance.Execution modes
| Mode | Behavior |
|---|---|
production | Inspect and forward allowed calls to real backends |
simulation | Inspect and return mock responses (no backend contact) |
shadow | Evaluate policies, log counterfactual blocks, do not enforce (see Shadow mode) |
Policy pinning
Pin immutable policy versions with registry URIs:
hardalion://nato-prou-strict-financial@1.0.0View bundled policies: NPL reference policies.
Gateway policies
Per-tenant MCP gateway policies configure:
- Trusted server whitelist
- Blocked methods and tools
- Destructive operation denial
- Data exfiltration heuristics
Configure via the Nexus console or tenant API.