AI Platform & Tooling

Enterprise Model Context Protocol (MCP) Architecture

A production-grade blueprint for deploying centralized, zero-trust Model Context Protocol (MCP) gateways connecting coding and operational agents to internal databases and APIs.

By Bhavin Mistry, Senior Engineering Manager at Commonwealth Bank Published: 2026-09-15 Last updated: 2026-10-01 11 min read
Table of Contents (9 sections)
SYSTEM TOPOLOGY & LIVE DATA FLOW ENTERPRISE SPECIFICATION ยท INTERACTIVE NODES
Client Application RBAC Context Security & Gateway PII Sanitization Semantic Cache Check Rate & Token Budget Inference & Rerank BM25 + Vector Fusion Cross-Encoder Top-5 Grounded Synthesis Telemetry OpenTelemetry
LIVE SIMULATOR Test an Enterprise Request Path:
00.0ms [CLIENT] Incoming query: "Retrieve Q3 capital adequacy ratio formula for APRA review"
+08.2ms [GATEWAY] PII check: Clean ยท Semantic cache hit (0.97 match) ยท Cost: $0.0000
+11.4ms [TELEMETRY] OTEL trace CBA-9142 exported. Zero LLM egress cost.

The Core Problem Solved

Enterprise agents (Claude Code, Cursor, internal custom agents) need access to internal relational databases, git repos, and ticket queues, but direct credential provisioning creates critical security vulnerabilities and credential sprawl.

When To Deploy This Architecture

Deploy when enabling agentic tooling across engineering or operations teams requiring auditable, least-privilege access to core systems of record.

Architectural Components

  • MCP Edge Gateway with mTLS Authentication & RBAC token translation
  • Sandboxed Internal Tool Servers (PostgreSQL, Jira, GitHub, Enterprise Confluence)
  • Prompt Sanitization & Secret Redaction Proxy
  • OpenTelemetry Tool Call Audit Span Exporter

Data Flow Narrative

Agent emits standardized JSON-RPC MCP request -> Enterprise MCP Gateway intercepts and validates caller token -> Applies RBAC filter and parameter bounds check -> Invokes internal microservice with short-lived STS credentials -> Sanitizes output before returning context to agent.

Security & Perimeter Control

Enforces zero data retention on external LLM vendors, cryptographic tool signing, and automated parameter validation against schema injection.

Governance & Telemetry

Every tool invocation generates an immutable OpenTelemetry audit log including caller identity, sanitized parameters, execution latency, and return status.

Identified Failure Modes & Mitigations

Downstream tool timeout causing agent hang; mitigated by hard 3.5s circuit-breaker timeout and deterministic error serialization.

Production Code Implementation

Copy-paste ready implementation snippet demonstrating the core architectural boundary logic:

typescript
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';

// Enterprise Zero-Trust MCP Server for Banking Knowledge
const server = new Server(
  { name: 'enterprise-mcp-gateway', version: '2.4.0' },
  { capabilities: { tools: {} } }
);

server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [{
    name: 'query_account_ledger',
    description: 'Secure, read-only query against enterprise accounting ledger with RBAC redaction.',
    inputSchema: {
      type: 'object',
      properties: {
        accountId: { type: 'string', pattern: '^ACC-[0-9]{8}$' },
        auditReason: { type: 'string', minLength: 10 }
      },
      required: ['accountId', 'auditReason']
    }
  }]
}));

server.setRequestHandler(CallToolRequestSchema, async (request) => {
  if (request.params.name === 'query_account_ledger') {
    const { accountId, auditReason } = request.params.arguments as any;
    // Log security telemetry span
    console.error(`[AUDIT] Tool invoked: account=${accountId} reason=${auditReason}`);
    return {
      content: [{ type: 'text', text: JSON.stringify({ status: 'ACTIVE', tier: 'ENTERPRISE_CORE', balanceRedacted: true }) }]
    };
  }
  throw new Error(`Unsupported tool: ${request.params.name}`);
});

const transport = new StdioServerTransport();
await server.connect(transport);
Architectural Q&A

Frequently Asked Questions

Engineering Resource

The Enterprise AI Production Checklist

A rigorous 50-point engineering, security, and FinOps verification gate before promoting Generative AI and Agentic systems to live enterprise traffic.

Zero spam. Fortnightly dispatches. Unsubscribe anytime.
Author & Engineering Leader

Bhavin Mistry

Senior Engineering Manager at Commonwealth Bank based in Melbourne, Australia. Focusing on enterprise AI architecture, hybrid RAG, agentic reliability, and technology economics.

Connected Tools & Frameworks

Cross-Referenced Production Resources

Methodology

5-Stage Maturity Framework

Stage gates from exploration to hardened multi-region deployment.

Assessment

AI Readiness Diagnostic

Benchmark organizational readiness across 12 operational dimensions.

FinOps

RAG Cost Calculator

Model vector storage, query volume, and caching ROI accurately.