At a recent conference, engineers from Morgan Stanley laid out how the financial institution rebuilt its internal API infrastructure to accommodate a new generation of AI agents. The approach pairs an open-source architecture-as-code framework with the Model Context Protocol, creating a platform that allows business users to query proprietary data through natural language while maintaining enterprise-grade governance.

The Problem: An API Program That Needed AI Agents

Jim Gough, a distinguished engineer at Morgan Stanley and architect of its API program, described the challenge his team faced roughly a year ago. The firm had already been building APIs at scale, but the rise of large language models created a new demand signal: business users wanted to interact with internal systems using natural language rather than through traditional endpoints. This meant the API program needed to expose not just data structures but tools that AI agents could discover, invoke, and reason about.

When Gough first started exploring the Model Context Protocol, he admitted that he had not even heard of it. The protocol, announced in November 2024, was still nascent. By 2025, OpenAI had begun adopting it, followed by GitHub and other major platforms. The timing pushed Morgan Stanley to integrate MCP into its existing architecture rather than treat it as an afterthought.

What MCP Actually Does

At its core, MCP is a simple client-server protocol that allows LLM-based applications to discover tools, invoke them, and validate results. Beyond tools, which are structured operations analogous to API endpoints, MCP introduces two elements that are often overlooked. Prompts are reusable, parameterized instructions that guide agent behavior. Resources bring documents and data to agents, providing the context they need to operate effectively.

Gough, who has spent years working with OpenAPI specifications, was initially skeptical about what MCP offered beyond existing API descriptions. But the practical difference became clear quickly. Where an OpenAPI spec describes what an API does, MCP describes how an agent can piece together multiple operations in a reusable way to solve a business problem. It also adds natural-language-based discovery, which means users can simply type what they want in English and have the agent figure out how to access the right data.

Where Complexity Emerges

The protocol itself is straightforward. The difficulty lies in orchestration. When a system exposes only a handful of tools, an agent can easily select the right one based on its description. As the tool library grows, overlapping definitions become a problem. Two tools with similar names but different capabilities force the agent to read verbose descriptions, consuming tokens and driving up cost. Gough noted that even in a simple demonstration, the chatty nature of the protocol was apparent, with every tool definition and response adding to the token load.

This scalability challenge led Morgan Stanley to build specialized gateways and control planes. Traditional API gateways, which Gough noted were typically designed to remain agnostic about business logic, now needed to handle tool disambiguation, governance, and routing. The architecture shifted from being purely about transport to being about interaction design.

The CALM Framework Behind the Platform

The underlying platform that powers Morgan Stanley's deployments is CALM, an open-source project from FINOS, the financial industry's open-source foundation. CALM stands for Architecture as Code and allows teams to model infrastructure and services using typed JSON schemas that represent boxes and arrows, along with richer metadata. The system includes a CLI, a repository hub similar to Artifactory, and template engines that generate Terraform configurations, Kubernetes commands, Helm charts, and Kustomize manifests.

One of CALM's most powerful features is its pattern system. Rather than having each team define an architecture from scratch, the platform provides a small set of reusable patterns that encode platform opinions and guardrails. A developer who needs to deploy a new service selects a pattern, and the architecture inherits the security, networking, and compliance controls built into it. Morgan Stanley reported deploying over 110 APIs in production using this approach, all through continuous deployment pipelines.

More recently, the team introduced decorators to address a common problem: architectures were becoming bloated with metadata about everything from ownership to compliance tags. Decorators separate that metadata from the core architecture definition, keeping configurations clean and readable.

How It Works in Practice

The demonstration showed an agent host running Claude connecting to a Trades API through an MCP server deployed on a local Kubernetes cluster. The agent received a request to find the top ten Vodafone trades. It discovered the available tools, attempted several name variations including VOD, VOD.L, and Vodafone before finally finding the correct instrument prefix, LSE, and successfully querying the service. The entire flow was orchestrated by CALM architectures that defined both the REST service and the MCP server, with deployment handled through kubectl apply commands.

The system uses composite patterns, where an MCP architecture can reference an existing REST service architecture. This allows teams to layer AI agent access on top of existing APIs without rebuilding anything from scratch.

What This Means for Enterprise API Design

The approach Morgan Stanley described offers a template for how large organizations can bridge the gap between traditional API programs and the AI agent era. Rather than treating MCP as a separate initiative, they embedded it into the existing architecture-as-code workflow, preserving governance controls while adding new interaction patterns. The combination of CALM's pattern-based governance and MCP's natural-language discovery creates a platform where business users can query proprietary trade data, internal databases, and technical products without needing to know what those systems are called or how they are structured.

Whether other organizations can replicate this depends on their appetite for open-source infrastructure investment and their willingness to restructure how APIs are defined and deployed. Morgan Stanley's experience suggests that the hardest part is not the protocol itself but the orchestration layer that manages tool discovery, token costs, and governance at scale.