The need for Model Context Protocol

Software Engineer | Open Source Enthusiast | Mentor | Learner I love documenting stuff that I come across and find interesting. Hoping that you will love reading it and get to know something new :)
AI development often presents an illusion of standardization. When engineering structured workflows, JSON Schema is universally relied upon to force Large Language Models into returning predictable, type-safe data.
However, beneath the surface lies a fragmented landscape. If you take a complex schema designed for OpenAI and copy-paste it into an API call for Google Gemini or Anthropic Claude, the request will likely crash.
The industry is undergoing a paradigm shift. The Model Context Protocol (MCP) offers an open-source standard designed to decouple AI engines from custom data schemas, fundamentally resolving the integration bottleneck.
The Illusion of Universal JSON Schema
Every major AI platform uses the JSON Schema standard as its core blueprint, yet each platform implements a different dialect, subset, and set of constraints.
The friction manifests in three primary architectural areas.
1. The Wire Format Envelope
AI providers do not allow the direct submission of a raw JSON Schema. It must be wrapped inside provider-specific API request parameters. Even if the schema definitions are identical, the surrounding container remains fragmented:
OpenAI requires schemas to sit inside
response_format: { type: "json_schema", json_schema: {...} }for structured outputs, ortools: [ { type: "function", function: { parameters: {...} } } ]for tool calling.Google Gemini expects the configuration to map to
generationConfig: { responseMimeType: "application/json", responseSchema: {...} }.Anthropic Claude processes tool requests via
tools: [ { name: "...", input_schema: {...} } ].
Sending the wrong wrapper envelope causes the platform API to reject the network request immediately.
2. Under-the-Hood Token Constraints
To guarantee that an LLM complies with a schema, platforms do not just validate the output after it is written. They use constrained decoding at the token-generation level. This process mathematically restricts the modelβs vocabulary, preventing it from generating invalid characters (such as an opening bracket where a string belongs).
Because each provider engineers their constrained decoding engine differently, they impose conflicting mathematical requirements on your schema:
OpenAI Strict Mode: Requires every single object property to be explicitly declared in the
requiredarray, and demands that"additionalProperties": falsebe hardcoded into every object. It uniquely supports deeply recursive schemas (e.g., node structures containing an array of identical nodes).Google Gemini: Requires explicit typing down to the primitive layer. Defining an array format such as
{"type": "array", "items": {}}works under OpenAI but causes a runtime crash on Gemini, which mandates strict type declarations like{"type": "array", "items": {"type": "string"}}.Anthropic Claude: Allows flexible structural composition (like
allOf), but rejects deep recursive loops and enforces restrictive payload size limits on the schema definition itself.
How MCP Eliminates Schema Fragmentation
The Model Context Protocol (MCP) provides an open standard that decouples host AI applications from underlying data sources and tools. Rather than requiring developers to write custom schema translations for every combination of LLM and API, MCP acts as a universal adapter layer.
ββββββββββββββββββ ββββββββββββββββββ ββββββββββββββββββ
β OpenAI Client β β Anthropic Host β β Gemini Client β
βββββββββ¬βββββββββ βββββββββ¬βββββββββ βββββββββ¬βββββββββ
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β (Standardized JSON-RPC)
βΌ
βββββββββββββββββββββββββ
β MCP Universal Layer β
β (Schema 2020-12) β
βββββββββββββ¬ββββββββββββ
β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
βΌ βΌ βΌ
βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ
β Postgres Toolβ β GitHub Tool β β Custom Web APIβ
βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ
MCP standardizes tool discovery and execution using a unified client-server architecture over JSON-RPC 2.0. This framework alters how schemas are handled across different systems.
A Single, Enforced Dialect Baseline
The MCP specification mandates JSON Schema 2020-12 as its default, uniform dialect. When an MCP server exposes capability primitives (such as tools or resources), it defines its arguments using this explicit version. AI applications that integrate as MCP clients must natively support this baseline format, removing the need to predict whether a model prefers older Draft-07 or newer variations.
Flattened Input Parameter Schemas
REST APIs distribute parameters across path segments, query strings, headers, and request bodies. AI engines struggle to track these distinct contexts across different providers.
MCP flattens complex API inputs into a single, comprehensive inputSchema object. Path parameters, query parameters, and body elements are merged into unified top-level object properties, drastically simplifying the model's reasoning loop.
Bidirectional Protocol Error Handling
When a model outputs data that breaks a standard API configuration, the system typically fails silently or raises uninformative HTTP status errors. MCP resolves this by categorizing errors into two separate fields:
Protocol Errors: Handled directly at the transport layer via standard JSON-RPC codes (e.g., code
-32602for an unknown tool structure). The model never sees these; they are stopped at the engineering boundary.Tool Execution Errors: Wrapped in responses where
isError: trueis explicitly declared. These payloads include clear descriptions of exactly what failed (e.g.,"Invalid departure date: must be in the future"). This structures the feedback so the LLM can parse the error, self-correct, and re-generate a valid payload automatically.
Architectural Comparison: Legacy vs. MCP Architecture
The shift from manual translation layers to a decoupled MCP interface streamlines production pipelines.
| Capability Feature | Legacy Fragmented Multi-Model Approach | Unified MCP Server Approach |
|---|---|---|
| Schema Dialect | Varies arbitrarily between Draft-07, Draft-09, and custom enterprise subsets. | Enforced adherence to standard JSON Schema 2020-12. |
| Integration Complexity | \(N \times M\) integration loops (Every model requires distinct wrapper syntax for every tool). | \(1 \times N\) integration loop (Every tool is exposed once via an MCP server to any model). |
| Validation Layer | Manual enforcement using wrapper frameworks like Pydantic or Zod. | Native type safety and verification built into the JSON-RPC wire protocol. |
| Error Remediations | Custom retry algorithms and prompt engineering tricks to handle format failures. | Structured isError feedback loop allowing systemic autonomous model self-correction. |
Future-Proofing AI Infrastructure
Relying on hand-crafted JSON strings mapped to individual model endpoints creates technical debt that breaks when APIs update.
MCP provides a clean architectural separation: tool developers design a single MCP server with a clean schema definition, and AI application developers build a single host client to parse it. By standardizing on JSON Schema 2020-12 and using a unified transport layer, MCP eliminates the need for complex custom integration code, transforming structured data integration into a plug-and-play architecture.
π Enjoyed this blog?
Reach out in the comments below or on LinkedIn to let me know what you think of it.
For more updates, do follow me here :)





