[Demo Webinar] ⛏️ How to build a user-friendly infra self-service portal with Spacelift

➡️ Register Now

General

What Is MCP? Model Context Protocol Explained Simply

What is the Model Context Protocol (MCP)

🚀 Level Up Your Infrastructure Skills

You focus on building. We’ll keep you updated. Get curated infrastructure insights that help you make smarter decisions.

Artificial Intelligence (AI) and Large Language Models (LLMs) have taken the world by storm over the past few years. Even though more powerful models emerge every few months, organizations still struggle to integrate them successfully with their own proprietary data. LLMs are great at writing, reasoning, and analyzing, but they remain trapped behind information silos and legacy systems.

The Model Context Protocol (MCP) represents a significant shift in how AI systems interact with enterprise data and tools. MCP addresses the growing complexity of AI integration by providing a standardized method for LLMs to interact with external systems. 

In this article, we’ll cover:

  1. What is the Model Context Protocol (MCP)?
  2. MCP architecture and concepts
  3. How does MCP work?
  4. Getting started with a demo project
  5. MCP vs traditional API approaches
  6. MCP in the broader AI ecosystem
  7. Real-world use cases and applications

What is the Model Context Protocol (MCP)?

The Model Context Protocol (MCP) is an emerging standard for sharing context between AI models and applications. It allows systems to persist and exchange structured information, such as user preferences, app history, or task state, across model interactions or even between models. 

MCP is designed to improve continuity, memory, and personalization using machine-readable schemas and standardized data exchange formats. It aims to enable seamless, stateful experiences across AI tools and platforms.

model contex protocol

Current approaches force developers to build custom connectors for each system they want to enhance with AI capabilities. Does your AI assistant need access to GitHub repositories, Slack conversations, and company databases? 

That means three separate integration projects, each with unique implementation work in authentication schemes, data models, and maintenance requirements. This creates integration fatigue for IT teams and orchestration chains that don’t scale.

To tackle this problem, Anthropic released and open-sourced the Model Context Protocol  (MCP) in November 2024. The MCP is an open standard that creates a universal language for AI systems to communicate with external data sources, tools, and services.

To streamline AI integration with complex systems and data sources, tool developers implement MCP servers that expose capabilities, while AI application developers build MCP clients that consume them. This model mirrors the client-server architecture of APIs but adapts it specifically for autonomous AI workflows.

MCP’s distinguishing feature is its AI-native design. Traditional APIs were optimized for static, predefined interactions, whereas MCP supports dynamic capability discovery. At runtime, an MCP client can query the server to learn which functions are available, enabling AI agents to adaptively incorporate new tools without hardcoded logic.

Simple explanation

The Model Context Protocol (MCP) is a standard that lets different AI models share and understand the same context, such as past conversations, user preferences, or tasks across tools or apps. It helps models work together more smoothly by passing relevant information in a structured way, so users don’t have to repeat themselves.

MCP architecture and core concepts

MCP follows a client-server architecture, where host applications connect to multiple servers through dedicated clients. The architecture consists of three primary components that work together to enable seamless integration.

MCP General Architecture

Source: MCP General Architecture

The MCP architecture includes the following:

  1. MCP Hosts: Applications like Claude Desktop, IDEs, or custom AI agent tools that want to access data through MCP. They are also responsible for managing user interactions and permissions. Hosts orchestrate the overall flow between user requests, LLM processing, and external tools.
  2. MCP Clients: Protocol clients that maintain dedicated, one-to-one connections with MCP servers. Each client handles the protocol-level details of MCP communication and acts as an intermediary between the host’s logic and external servers. Clients translate requests from hosts into MCP protocol messages.
  3. MCP Servers: Each of these lightweight programs exposes specific capabilities through the standardized MCP. These servers connect to local data sources, such as files and databases, or remote services available through APIs. Servers can provide three main types of capabilities to clients: 
    • Tools are functions that AI models can call to retrieve information or perform actions. They represent arbitrary code execution and must be treated with appropriate caution. Examples include 3rd-party APIs, database queries, or file operations.
    • Resources are data sources that can be included in the model’s context, such as database records, images, or file contents. They provide data without performing significant computation and have no side effects. They act like GET endpoints in a REST API.
    • Prompts are pre-defined templates that guide how models interact with specific tools or resources. They help users accomplish specific tasks and provide intent and context for AI behavior. To optimize tool usage, prompts can be selected before running inference.

The protocol uses JSON-RPC 2.0 as its message format for all communication. JSON-RPC provides a lightweight, language-agnostic foundation that’s human-readable and well-established.

How does MCP work?

MCP defines a formal lifecycle for client-server sessions consisting of three phases: initialization, operation, and shutdown.

The Initialization Phase establishes the connection between the client and server. The client sends an initialization request containing protocol version, capabilities, and implementation details. The server responds with its own capabilities and supported features. After successful initialization, the client sends an initialized notification to indicate readiness for normal operations.

The Operation Phase handles the actual work of the session. During normal operation, clients and servers exchange messages, allowing clients to invoke tools via tools/call requests, fetch resources via resources/get requests, and request prompts via prompts/get requests. The server responds to these requests, executing functions and returning results as needed.

The Shutdown Phase provides an orderly teardown process when interaction is complete.

MCP Communication Lifecycl Three-Phase Protocol Flow

Getting started with an MCP: demo project

Starting with existing MCP implementations is a great way to gain hands-on experience with MCP. Popular applications, such as Claude Desktop, Cursor, and VS Code, provide built-in MCP support. 

Typically, you just need to specify the MCP configuration for any servers you want to connect to and any required environment variables.

Below is the MCP example setup with various integrated tooling:

Let’s take a look at how to set up an MCP server on VS Code

Step 1. Configure an MCP server

First, enable the chat.mcp.enabled setting. Then, you need to configure an MCP server for a specific workspace and create a .vscode/mcp.json file in your workspace folder.

Here’s an example that shows how to set up a Perplexity MCP server, without hardcoding the API key. VS Code will prompt you for it when the server starts.

{
  // 💡 Inputs are prompted on first server start, then stored securely by VS Code.
  "inputs": [
    {
      "type": "promptString",
      "id": "perplexity-key",
      "description": "Perplexity API Key",
      "password": true
    }
  ],
  "servers": {
    // https://github.com/ppl-ai/modelcontextprotocol/
    "Perplexity": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "server-perplexity-ask"],
      "env": {
        "PERPLEXITY_API_KEY": "${input:perplexity-key}"
      }
    }
  }
}

Run the command MCP: List Servers, select your server, and opt for Start Server. You will be prompted to provide an API key from Perplexity.

Step 2. Use the MCP tools in agent mode

Once you have started the MCP server, you can use the tools it provides in agent mode. To use MCP tools in agent mode, open the Chat view (⌃⌘I) and select Agent mode from the dropdown.

If you click on the tool button, you should see the MCP Server: Perplexity tool available for use.

Step 3. Prompt the chat

Next, let’s prompt the chat and ask for the most recent news:

Prompt the chat

Click Continue to receive the result:

Our MCP setup works perfectly! 

Next steps

Next, check the MCP Servers list for agent mode from VS Code and this repository on MCP’s GitHub with a collection of reference implementations to get inspiration for various tooling you could integrate into your workflows.

Building MCP servers, on the other hand, requires implementing core capabilities, configuring transport mechanisms, and ensuring proper security and error handling. The FastMCP framework simplifies server creation for Python developers with decorator-based tools and resource definitions. 

The framework’s version 2.0 also includes an ecosystem, including client libraries, authentication systems, deployment tools, integrations with major AI platforms, testing frameworks, and production-ready infrastructure patterns. For a complete example, look at the MCP Quickstart for Server Developers.

MCP vs. traditional APIs

But how does MCP differ from the APIs developers already know? The main difference between MCP (Multi-Component Protocol) and traditional APIs lies in their purpose and design focus: MCP is built specifically to support AI agents, while traditional APIs serve general-purpose software integration.

Traditional APIs like REST or GraphQL provide structured endpoints for data access, authentication, and service interaction, typically relying on well-defined request/response flows between client and server. 

By contrast, MCP introduces a higher-level abstraction that wraps these APIs with AI-aware patterns such as tool invocation, context provisioning, and dynamic task orchestration. This allows AI systems to interact with APIs conversationally or through agentic workflows, rather than rigid endpoint calls.

MCP acts as a meta-layer that complements APIs, enabling adaptive behavior by AI agents using standard APIs as tools. Both are essential parts of the AI system stack and are most effective when combined strategically.

MCP in the broader AI ecosystem

MCP is quickly becoming a central protocol in the AI ecosystem, as major cloud providers and AI platforms begin integrating it into their offerings. Its potential to standardize interactions across AI agents is significant, but integration remains far from frictionless. Notable gaps persist, especially around security and stability.

Security is the most pressing concern. MCP’s design allows broad access to data and dynamic code execution, creating serious attack surfaces. If compromised, it could expose sensitive data, allow model manipulation, or even lead to system-wide exploitation. Threats can emerge from prompt injection, tool abuse, or insecure third-party integrations.

Robust safeguards are essential to mitigate these risks: strong authentication and authorization, encrypted data channels, input validation, rate limiting, and tight session controls. The risk of insecure third-party implementations when connecting to remote MCP endpoints further emphasizes the need for thorough security vetting. 

Read this blog Open Protocols for Agent Interoperability: Authentication on MCP, to learn more. 

Beyond security, MCP’s early-stage maturity also slows adoption. Like any emerging standard, it lacks mature tooling and seamless integration paths. Additionally, the dynamic nature of LLMs and agentic AI introduces variability that can disrupt established workflows and affect system reliability.

Despite these hurdles, momentum is building. MCP’s potential to unify AI agents with role-based, permission-aware interactions across systems positions it as a strong candidate for enterprise-scale deployment. Other standards are emerging too, but MCP’s early traction is setting it apart.

Real-world use cases and applications of MCP

How are organizations using MCP today? The applications span industries and use cases, demonstrating the protocol’s versatility.

1. Software development and infrastructure automation

Software development and infrastructure automation represent two of the most active areas of MCP adoption. Developers and platform engineers incorporate MCP tooling into their arsenal, enhancing the capabilities of their IDEs and command-line tools.

Some examples include GitHub’s official MCP server, which enables automating GitHub workflows, analyzing data from repositories, and integrating AI-powered tools with GitHub’s ecosystem. The Playwright MCP Server revolutionizes browser automation and testing workflows. 

Developers use it to automatically generate end-to-end test cases from application data and create self-maintaining test suites that adapt to UI changes. The Elasticsearch MCP server allows users to query data and interact with their indices through natural language conversations.

AWS MCP servers can help operators interact with their infrastructure in plain language, such as debugging issues with EKS clusters. Similarly, Spacelift offers an MCP server that enables AI models to interact with Spacelift, facilitating stack and module management and GraphQL schema management.

2. E-commerce

E-commerce use cases have demonstrated MCP’s ability to automate certain customer support flows and route complex queries appropriately.

E-commerce platforms have also started looking to integrate MCP to enhance recommendation engines by pulling data from purchases, browsing history, and inventory levels.  

3. Regulated industries

Financial services companies leverage MCP to develop automated trading systems that analyze market trends in real time, allowing seamless integration with various systems. They are also starting to build internal chatbot-based assistant systems that use MCP to connect to various tooling efficiently and can analyze large amounts of data, providing insights to users. 

Other use cases leverage MCP functionality on advanced fraud detection and prevention systems, especially when multiple systems need to be interconnected.

In healthcare, MCP enables the simultaneous analysis of data from multiple sources, which informs clinical decisions and helps create personalized treatment plans.

How does Spacelift improve developer velocity?

Spacelift is an infrastructure orchestration platform that improves developer velocity by offering a powerful policy engine based on OPA, self-service infrastructure, and the ability to build multi-tool workflows with dependencies and output sharing. Spacelift has its own Terraform/OpenTofu provider, and also its own Kubernetes operator, which makes it ideal to pair it with an AI-powered coding assistant.

You can easily have AI-powered coding assistants generate Spacelift Terraform/OpenTofu/Kubernetes code by showing them how you would like the code generated (for example, you want to use for_each on your resources and map(objects) variables when you are using Terraform/OpenTofu). 

Spacelift also offers its own AI assistant called Saturnhead AI. Saturnhead AI is built with a singular focus on making the day-to-day lives of DevOps practitioners easier. It’s an enterprise-grade AI assistant meant to enable your DevOps engineers to shift from being a troubleshooter to an enabler.

Saturnhead AI reviews your runner phase logs, automatically analyzes them, and provides clear and actionable feedback on what happened in a particular runner phase or what has happened inside your entire run if there is a failure. 

By automating the manual, time-consuming process of troubleshooting and guiding DevOps teams through resolution, Saturnhead AI slashes resolution time and eliminates operational bottlenecks. By leveraging Saturnhead AI in an enterprise, even for a modest 5% run failure rate, Saturnhead AI will eliminate the need to troubleshoot 1,000+ failed runs per week.

Read more about how Spacelift can help you with your infrastructure orchestration workflows here. If you want to take your infrastructure automation to the next level, create a Spacelift account today or book a demo with one of our engineers.

Key points

In this blog, we explored Model Context Protocol (MCP), its core components, use cases, and how to get started today. We discussed the similarities between MCP and traditional APIs and how they complement each other. 

A few key takeaways from this blog post are:

  • MCP defines a standardized way to provide external context to AI models, improving accuracy, relevance, and task alignment during runtime.
  • MCP structures and transmits metadata, user instructions, system behavior, or domain-specific information that the model uses during inference without changing its weights.
  • MCP is typically implemented as a structured message format (e.g., JSON) sent via API, enabling integration into toolchains or applications.
  • It is useful in scenarios requiring model grounding, such as enterprise AI, RAG (Retrieval-Augmented Generation), agents, or multi-step workflows.
  • MCP enhances control, traceability, and reliability of AI outputs by separating model architecture from contextual behavior definitions.

It’s still early days for agentic AI, but transformative use cases are already appearing across industries. Companies of all sizes are leveraging MCP to reshape their business processes and interconnect various systems. 

Frequently asked questions

Why is MCP called the “USB-C of AI apps”?

The MCP is called the “USB-C of AI apps” because it provides a standardized way for AI models (particularly LLMs) to connect and interact with external systems, data sources, and tools. MCP enables these AI apps to plug into various applications and databases seamlessly, much like USB-C provides a universal connector for hardware devices.

What is the difference between MCP and RAG?

Retrieval-Augmented Generation (RAG) combines external document retrieval with text generation. It retrieves relevant information from a knowledge base and injects it into the prompt before the LLM generates a response, improving factual accuracy and grounding.

RAG augments a language model’s answers with retrieved information, while MCP provides the memory, context, and ability to interact with live systems or coordinate multi-step workflows. They can also work together: RAG can supply fresh content, and MCP can use or remember that content in a complex, ongoing process.

What is the difference between MCP and ACP?

MCP focuses on delivering structured context (e.g., goals, history, inputs) to a language model at runtime. It ensures that models receive the right information in a standardized format, enabling consistent outputs across varying use cases.

In contrast, ACP (Agent Communication Protocol) defines how autonomous agents (which may include models) communicate with one another. It includes message formats, intentions, and state handling for multi-agent collaboration, such as task delegation or coordination.

In short, MCP governs context delivery to a model, whereas ACP governs structured messaging between agents. Together, they support scalable, multi-agent AI systems.

Solve your infrastructure challenges

Spacelift is a flexible orchestration solution for IaC development. It delivers enhanced collaboration, automation, and controls to simplify and accelerate the provisioning of cloud-based infrastructures.

Learn more