1. Why MCP Replaces Custom Integration Glue
In early enterprise LLM implementations, engineering teams frequently created ad-hoc function-calling scripts for every tool, database, and internal API. This quickly created "integration sprawl": unversioned prompt schemas, fragmented authentication credentials passed directly into model contexts, and an inability to swap or upgrade underlying AI models without rewriting API layers.
The Model Context Protocol (MCP) establishes an open, vendor-neutral standard for AI model-to-system communication. By formalizing a lightweight JSON-RPC client-server contract, MCP acts as a universal abstraction layer between AI agent hosts and backend enterprise infrastructure.
2. The Three Core Protocol Primitives
MCP separates agent interactions into three distinct operational primitives to enforce the principle of least privilege:
Resources
Read-only data endpoints formatted as URIs (e.g. postgres://db/table/row). Used for safe grounding and retrieval without side effects.
Tools
Executable functions exposed to the model, defined by strict JSON Schema specifications for parameters, return values, and error payloads.
Prompts
Pre-templated contextual instructions provided by the server to guide the client on appropriate tool usage patterns and domain business rules.
3. Transport Protocols: Stdio vs. Streamable HTTP / SSE
MCP supports two primary transport mechanisms. Choosing the appropriate transport depends on deployment topology:
Standard I/O (Stdio)
The MCP Client spawns the MCP Server as a subprocess and communicates via standard input/output streams. Ideal for localized agent runtimes, CLI tooling, and developer workstation sandboxes.
- ✓ Lowest latency
- ✓ Zero network exposure
- ✗ Limited to single-host execution
Server-Sent Events (SSE / HTTP)
The MCP Server runs as an independent network service. Communication occurs via HTTP POST requests for client messages and an open SSE stream for server responses.
- ✓ Horizontally scalable across VPCs
- ✓ Centralized authentication & IAM
- ✓ Multi-agent shared server pools
4. Zero-Trust Security Architecture for MCP
Because MCP allows models to trigger real-world actions, protocol implementations must never trust raw model inputs. Enterpriva recommends four essential controls:
Identity-Brokered Token Delegation
The MCP server must authenticate against enterprise Identity Providers (OAuth 2.0 / OIDC). Long-lived secrets and database credentials remain inside the server environment and are never injected into the LLM context.
Heuristic Input Sanitization & JSON Schema Validation
Incoming tool parameters must be rigorously validated against strict type definitions (e.g. Zod schemas) before execution, rejecting any payloads containing unauthorized SQL fragments or out-of-range bounds.
Human-in-the-Loop Approval Escalation
Critical mutations (e.g. issuing invoices, altering user permissions) must emit an approval event, suspending execution until authorized personnel cryptographic sign-off is registered.
5. Reference MCP Server Implementation
The following TypeScript example illustrates an MCP Server exposing a parameterized database query tool with Zod schema verification:
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
import { z } from 'zod';
// 1. Initialize Server Instance
const server = new Server({
name: 'enterprise-analytics-mcp',
version: '2.0.0'
}, {
capabilities: { tools: {}, resources: {} }
});
// 2. Define Parameter Schema
const QueryArgsSchema = z.object({
customerId: z.string().uuid(),
dateRange: z.enum(['last_30_days', 'last_quarter', 'ytd'])
});
// 3. Register Tool Metadata
server.setRequestHandler(ListToolsRequestSchema, async () => ({
tools: [{
name: 'fetch_customer_metrics',
description: 'Retrieves aggregated billing telemetry for an authenticated customer.',
inputSchema: {
type: 'object',
properties: {
customerId: { type: 'string', description: 'Customer UUID' },
dateRange: { type: 'string', enum: ['last_30_days', 'last_quarter', 'ytd'] }
},
required: ['customerId', 'dateRange']
}
}]
}));
// 4. Handle Execution with Validation
server.setRequestHandler(CallToolRequestSchema, async (request) => {
if (request.params.name === 'fetch_customer_metrics') {
const validatedArgs = QueryArgsSchema.parse(request.params.arguments);
const data = await queryIsolatedMetrics(validatedArgs.customerId, validatedArgs.dateRange);
return {
content: [{ type: 'text', text: JSON.stringify(data) }]
};
}
throw new Error(`Tool not found: ${request.params.name}`);
});Consult with Enterpriva's MCP Engineering Advisory
Need guidance architecting secure MCP topologies, developing custom server adapters for proprietary data silos, or configuring zero-trust guardrails? Our systems engineering practice is available for strategic discovery briefings.