Model Context Protocol - MCP

Model Context Protocol (MCP): The Universal Connector for AI Systems

Discover Model Context Protocol (MCP) in simple terms! Learn its benefits, architecture, use cases, and how to configure it in Claude Desktop App.

1. Introduction

The Model Context Protocol (MCP) is emerging as an exciting way to streamline interactions between AI models and the external tools they rely on. If you’re new to AI and agent-based systems, this guide will walk you through what MCP is, its benefits, architecture, and use cases—all in an easy-to-understand language. We’ll also include a practical demo to show you MCP in action!

2. What is Model Context Protocol?

Model Context Protocol (MCP) is a communication protocol designed to simplify how large language models (LLMs) and AI systems interact with various resources and external tools. Think of it as a universal language or set of rules that enables various AI systems to share context, information, and capabilities.

In simpler terms:

  • Without MCP: Your AI tools work in isolation, like separate islands that can’t easily share information
  • With MCP: Your AI tools can work together as a team, sharing information and capabilities

At its core, MCP is like an API (Application Programming Interface) specifically designed for AI models. It defines how models can request and receive information from each other, creating a more connected and powerful AI ecosystem.

Analogy: Imagine plugging in a USB device to your computer. Just like a USB standardizes connections so that any device can communicate effortlessly with your system, the Model Context Protocol (MCP) standardizes how AI models interact with various tools and resources.



3. Background: Why Was It Introduced?

MCP was introduced by Anthropic (the creators of Claude) in November 2024 as an open standard. They recognized a critical problem in the AI ecosystem: each AI system was like an island, unable to easily communicate with other systems or access external tools and data sources.

Before MCP, developers had to create custom integrations for each AI model and each external system they wanted to connect. This was like needing a different type of charger for every electronic device you own—inefficient and frustrating.

MCP solves this by creating a standardized way for:

  • AI models to communicate with each other
  • AI models to use external tools and resources
  • Applications to interact with multiple AI models

Think of MCP as creating a common language that all AI systems can speak, regardless of who built them or how they work internally.

4. Benefits of MCP

The benefits of MCP are similar to when USB was introduced for hardware devices:

For Developers:

  • Plug-and-Play Integration: Connect any MCP-compatible model to your application without custom code for each
  • Reduced Development Time: Build once, connect to many different AI models
  • Future-Proofing: Your applications can easily adopt newer, better models as they become available
  • Composability: Mix and match capabilities from different AI systems
  • Simplified Debugging: Standard protocol means standard ways to test and troubleshoot

For End Users:

  • More Powerful Applications: Access multiple specialized AI capabilities in a single interface
  • Smoother Experience: No switching between different tools for different AI tasks
  • Greater Functionality: AI systems that can take actions in the real world, not just generate text
  • Personalization: Applications can more easily adapt to your specific needs by combining models
  • Reliability: If one model is unavailable, applications can fall back to alternatives

For the AI Ecosystem:

  • Innovation Acceleration: Developers can focus on new capabilities instead of basic connectivity
  • Specialization: Models can excel at specific tasks while working together on complex problems
  • Compatibility: Different companies’ AI systems can interoperate without special agreements
  • Accessibility: Smaller companies can more easily compete by focusing on specialized capabilities


5. Real-World Use Cases for MCP

MCP solves real problems by connecting AI systems to each other and to external tools. Here are some practical examples:

1. Smart Coding Assistant

Problem: Developers need to write code, understand existing codebases, fix bugs, and commit changes—requiring constant context switching between tools.

MCP Solution: An integrated coding assistant that can:

  • Understand your codebase through file system access
  • Generate code based on natural language descriptions
  • Run and debug the code to ensure it works
  • Commit changes directly to your repository
  • All from within your IDE through a single interface

Example in Action: A developer types “Add error handling to the user registration function and commit the changes” in their IDE. The MCP-powered assistant analyzes the codebase, adds appropriate try/catch blocks, tests the changes, and commits them to Git—all without the developer switching contexts.


2. Intelligent Research Assistant

Problem: Researchers need to search for information across multiple sources, analyze data, generate visualizations, and write reports—tasks typically requiring multiple specialized tools.

MCP Solution: A research assistant that can:

  • Search the internet for relevant information
  • Access and analyze datasets
  • Generate appropriate visualizations
  • Summarize findings in well-formatted reports
  • All through natural language interactions

Example in Action: A researcher asks “Analyze the climate data from the attached CSV, create a temperature trend visualization, and prepare a summary of key findings.” The assistant processes the data, creates charts, identifies trends, and produces a formatted report with insights—tasks that would normally require jumping between spreadsheet software, visualization tools, and word processors.


3. Customer Support Automation

Problem: Support agents need to access customer information, troubleshoot issues, update records, and provide personalized assistance—often requiring multiple systems.

MCP Solution: A support assistant that can:

  • Look up customer information in CRM systems
  • Access knowledge bases for troubleshooting
  • Update tickets and customer records
  • Generate personalized response emails
  • All through a single conversational interface

Example in Action: An agent types “Help me resolve John Smith’s billing issue from ticket #45678.” The assistant retrieves the customer record, accesses the billing system, identifies the problem, suggests a solution, and prepares an email response.


4. Document Workflow Automation

Problem: Legal and business professionals need to review, analyze, extract information from, and take action on complex documents—a time-consuming process.

MCP Solution: A document assistant that can:

  • Read and understand uploaded documents
  • Extract key information and clauses
  • Compare against standard templates
  • Flag potential issues or missing information
  • Generate response documents
  • All through natural language commands

Example in Action: A legal professional uploads a contract and asks “Review this for non-standard clauses and prepare a response addressing the payment terms.” The assistant analyzes the document, identifies unusual clauses, compares payment terms to standards, and drafts a response document—saving hours of manual review.



6. MCP’s Core Concepts and Capabilities

Understanding MCP requires familiarity with these key concepts:

6.1. Resources

Resources are the fundamental building blocks in MCP—they represent capabilities that can be accessed through the protocol.

Types of resources include:

a. ModelsAI systems that can process and generate text:

  • Large Language Models like Claude or GPT
  • Specialized models for specific domains or tasks
  • Each with its own capabilities and limitations

b. ToolsExternal systems that models can use to:

  • Retrieve information (search engines, databases)
  • Perform actions (file operations, API calls)
  • Interact with the outside world

c. ContextsShared information that persists across interactions:

  • Conversation history
  • User preferences
  • Session data
  • File contents

6.2. Prompts

In MCP, prompts are structured messages sent to models. They include:

  • Content: The actual message or instruction
  • Context: Additional information for the model
  • Tools: Available external capabilities
  • Parameters: Settings for how the model should respond

6.3. Sampling

Sampling controls how models generate responses:

  • Temperature: Controls randomness (0.0 = deterministic, 1.0 = creative)
  • Top-p: Limits token selection to most likely options (nucleus sampling)
  • Max tokens: Sets the maximum length of the response
  • Stop sequences: Strings that will cause generation to stop

These parameters allow fine-tuning the model’s output for different tasks.


6.4. Transport

Transport defines how information moves between MCP components:

  • Authentication: Methods for securing connections
  • HTTP/REST: For basic request-response interactions
  • WebSockets: For streaming responses and real-time updates
  • Message formats: JSON structures for requests and responses


7. MCP Architecture

The Model Context Protocol (MCP) architecture consists of four main components that work together seamlessly to provide AI capabilities to applications:

7.1. MCP Client

This is the part that interacts directly with applications. It handles:

  • Taking requests from applications that want to use AI features
  • Packaging these requests in a format the protocol understands
  • Sending requests to the MCP Server
  • Receiving and unpacking responses for the application to use

Think of the MCP Client as a translator between your application and the AI system.


7.2. MCP Server

This is the brain of the operation that:

  • Receives requests from MCP Clients
  • Decides which tools and models are needed to fulfill the request
  • Coordinates all the different components
  • Maintains the conversation state and context
  • Sends the final answers back to the client

The MCP Server works like an air traffic controller, directing requests to the right places and making sure everything runs smoothly.


7.3. MCP Host

The MCP Host provides the environment where everything runs:

  • Provides the infrastructure to run the MCP Server
  • Manages authentication and security
  • Handles scaling to support multiple users
  • Maintains connections to various resources

Think of the MCP Host as the building that houses the entire operation, providing power, security, and basic resources.


7.4. MCP Tools

These are specialized components that perform specific tasks:

  • Access external data sources (like databases or the web)
  • Run calculations or analyze information
  • Interact with other systems (like GitHub or file systems)
  • Provide specialized capabilities (like image processing)

Each tool is like a skilled specialist that gets called in when their specific expertise is needed.

The Model Context Protocol creates a standardized way for all these components to communicate, ensuring they work together effectively to provide powerful AI capabilities to applications.

8. How MCP Components Work Together – Weather and Stock Examples

8.1. Weather Example

  1. You ask in your chat app: “What’s the weather like in Tokyo today?”
  2. MCP Client handles your request:
    • Captures your question from the chat interface
    • Formats it according to MCP protocol
    • Sends it to the MCP Server
  3. MCP Server processes your request:
    • Analyzes your question and recognizes it’s about weather
    • Decides to use the AI model to understand the question
    • Determines a weather tool is needed for current data
  4. MCP Host provides access to:
    • The AI model resource
    • The weather API tool
    • Ensures proper authentication for the weather service
  5. MCP Tools take action:
    • The weather tool connects to a weather service API
    • Requests current weather data for Tokyo
    • Receives temperature, conditions, and forecast
  6. MCP Server coordinates the response:
    • The AI model formulates a natural-language answer using the weather data
    • Creates a complete response with relevant details
  7. MCP Client delivers the answer:
    • Receives the formatted response
    • Displays it in your chat interface: “It’s currently 22°C and partly cloudy in Tokyo with a 30% chance of rain later today.”

8.2. Stock Price Example

  1. You ask in your investment app: “What’s the current price of Apple stock?”
  2. MCP Client processes your request:
    • Takes your question from the investment app
    • Packages it for the MCP system
    • Transmits it to the MCP Server
  3. MCP Server analyzes the request:
    • Understands you’re asking about a stock price
    • Recognizes “Apple” refers to AAPL ticker
    • Identifies the need for real-time financial data
  4. MCP Host facilitates:
    • Secure connection to financial data providers
    • Access to the AI model for interpretation
    • Session management for your request
  5. MCP Tools gather information:
    • The stock market tool retrieves the latest AAPL price
    • Possibly gets additional information like daily change
    • Collects recent trading volume data
  6. MCP Server assembles the response:
    • AI model formats the stock information clearly
    • Combines price, change percentage, and relevant context
  7. MCP Client shows you the result:
    • Receives the complete answer
    • Displays in your app: “Apple (AAPL) is currently trading at $218.27, up 1.95% since market open. Trading volume today is 93.39 million shares.”

In both examples, the entire process happens seamlessly in seconds, with each component playing its specific role in delivering the information you requested.



9. Configuring MCP in Claude Desktop (MacOS)

Let’s go through the steps to configure MCP servers in Claude Desktop.

  1. Download and install Claude Desktop from Anthropic’s website.
  2. Launch Claude Desktop and sign in with your credentials.
  3. In the menu bar, click on “Claude” and select “Settings” from the drop-down menu.
  4. Navigate to the “Developer” section and click the “Edit Config” button.
  5. This will open the folder wherein the Claude MCP server configuration file is present named “claude_desktop_config.json
  6. Edit this file to add or modify the required MCP server configurations.

10. Example 1: Setting Up IntelliJ MCP Server and Creating a Health Endpoint Using Claude Desktop

In this example, we’ll install the MCP Server plugin in IntelliJ, configure it within Claude Desktop, and demonstrate how to create a new health endpoint using MCP integration.

1. Installing the MCP Server Plugin in IntelliJ

To enable MCP capabilities in IntelliJ, we need to install the MCP Server plugin.

Steps:

  1. Open IntelliJ and navigate to File > Settings > Plugins > Marketplace.
  2. In the search bar, type “MCP Server” and install the plugin.
  3. Once installed, restart IntelliJ for the changes to take effect.

2. Configuring IntelliJ MCP Server in Claude Desktop

After installing the plugin, we need to configure Claude Desktop to recognize the IntelliJ MCP Server.

Steps:

  1. Open the “claude_desktop_config.json” file in a text editor.
  2. Add below mentioned configuration.
  3. Save the file and restart the Claude Desktop app.
{
  "mcpServers": {
    "jetbrains": {
      "command": "npx",
      "args": [
        "-y",
        "@jetbrains/mcp-proxy"
      ]
    }
  }
}
claude_desktop_config.json

3. Verifying MCP Server Installation in Claude Desktop

Once configured, we can verify that the IntelliJ MCP Server is running.

Method 1: Using Developer Settings

  1. In Claude Desktop, go to Menu Bar > Claude > Settings > Developer.
  2. You should see the “jetbrains” server listed.
  3. Clicking on it will show the status as “running”, along with the command and arguments specified in the JSON configuration file.

Method 2: Using Chat Window

  1. Open the Claude Desktop chat window.
  2. Look for an icon with a plug symbol.
    • Hovering over it will display “Attach from MCP”.
    • Clicking on it will show a dropdown labeled “Installed MCP Servers”.
    • Expanding the dropdown should list “jetbrains/proxy”, confirming successful installation.

4. Checking Available MCP Tools

  1. In the Claude Desktop chat window, locate the hammer icon.
  2. Hovering over it will show “X MCP tools available” (where X is the number of available tools).
  3. Clicking the hammer icon will display a list of all available tools, along with descriptions and their associated MCP servers.

5. Creating a Health Endpoint in Existing Spring Boot Project Using Claude Desktop

Now, we will import a simple Spring Boot Hello World project into IntelliJ and use Claude Desktop to add a basic health check endpoint. We will also ask Claude to run a Maven clean install to ensure that our build remains stable.

You can find the project on GitHub: 🔗 Spring Boot 3 Hello World

Steps:

  1. Clone the repository and open it in IntelliJ.
  2. Open the Claude Desktop chat window and type the below-mentioned prompt.
  3. Claude will start adding the necessary code to your project. While generating the code, it may prompt you for permissions to create and insert the required files. You can grant access by clicking “Allow for This Chat.”
  4. Once the code is added and Maven clean install runs successfully, you can start the Spring Boot application and verify the output by hitting the newly added health check endpoint.

Prompt

In our ‘spring-boot-3-hello-world’ IntelliJ project, add a simple health check controller and endpoint that returns “Application is running” and then run ‘mvn clean install’ to ensure the build is stable.

Output: MCP in Action Demo

In this video, you will see how Claude and our IntelliJ MCP Server worked together seamlessly. During the implementation, Claude requested the necessary permissions to perform various operations. It utilized available tools to analyze the project, list files, retrieve file contents, create new files, and execute commands via the terminal.

Once the Maven clean install was completed, we manually verified the changes by reviewing the newly added endpoint, started the application, and then checked the output by hitting the health endpoint via the browser.



11. Example 2: Using GitHub MCP Server to Create a New Branch, Add a New Controller and Push Changes

In this section, we’ll use our existing Spring Boot Hello World project. The GitHub MCP Server will create a new branch, add an MCPController with a GET endpoint that returns “Hello MCP”, commit the changes, and push them to the remote repository. This process involves generating a GitHub Personal Access Token, configuring the GitHub MCP Server in Claude Desktop, and then instructing Claude to make the required changes.

You can find the project on GitHub: 🔗 Spring Boot 3 Hello World

Note: While the Claude Desktop app offers native GitHub integration, in this demo we are using the MCP server to illustrate how MCP works.

1. Generate a GitHub Personal Access Token

  • Go to GitHub Settings, then click on Developer settings > Personal access tokens.
  • Select which repositories you want to give access to—Public, All, or Specific ones.
  • Create a token:
    • Use the repo scope for full access to private repositories.
    • Use public_repo if you only need access to public repositories.
  • Configure appropriate permissions related to the Repository and Account.
  • Once the token is generated, copy it and save it somewhere safe

2. Configure the GitHub MCP Server in Claude Desktop App

  • Open your Claude Desktop configuration file (“claude_desktop_config.json”).
  • You can keep your existing servers as they are and simply add the new GitHub MCP server configuration. Add the below configuration for the GitHub MCP Server
  • Replace <YOUR_GITHUB_TOKEN> with your GitHub Personal Access Token.
  • Save the file and restart the Claude Desktop app.
  • Verify that the GitHub MCP Server status is “running” and check the available tools, as described in Example 1.
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_GITHUB_TOKEN>"
      }
    }
  }
}
claude_desktop_config.json

3. Instruct Claude Desktop to Create a New Controller and Push Changes

  • Open the Claude Desktop chat window and instruct it with the below-mentioned prompt.
  • Claude Desktop, using the GitHub MCP server, will perform the required actions like creating the new branch, adding the controller, committing the changes, and pushing them to the remote repository.

Prompt

Our existing Spring Boot GitHub project is located at ‘/Users/bunty/Github/BuntyRaghani/spring-boot-3-hello-world’. Create a new branch named ‘feature/mcp_demo’, add a simple controller named MCPController with a GET endpoint that returns “Hello MCP”, commit the changes, and push the branch to the remote repository.

4. Verify the Changes

  • Open your browser and navigate to the GitHub repository.
  • Confirm that a new branch named “feature/mcp_demo” exists and contains the MCPController with the GET endpoint returning “Hello MCP”.

Output:

In this video, you’ll see how Claude and our GitHub MCP Server seamlessly work together to automate your version control workflow. Claude leverages various tools to perform the following operations:

• Create a new branch
• Retrieve file contents
• Create or update files as required

Once the changes are pushed, we manually verified the update by pulling the changes into our existing project in IntelliJ and then confirming the modifications via the browser.



12. Things to Consider

If you’re just getting started with MCP, keep these practical considerations in mind:

  • Start with Simple Integrations: Begin by connecting one model to one tool before building complex workflows.
  • Understanding Latency: Multiple model calls and tool interactions can increase response time.
  • Monitoring Usage: Keep track of API calls and resource consumption, especially when using commercial models.
  • Handling Failures: Plan for scenarios where a model or tool might be unavailable.
  • Testing Thoroughly: Ensure interactions between models and tools work as expected to avoid unexpected outcomes.
  • Privacy Considerations: Be mindful of what information is shared across different systems.
  • Use Trusted MCP Servers: Ensure that the MCP servers you use come from reliable sources or developers.
  • Limit Permissions: Instead of granting full directory access, restrict MCP servers to only the necessary directories or files.

By following these guidelines, you can enhance the security, efficiency, and reliability of your MCP-powered workflows.

13. FAQs

Do I need to know programming to use MCP?

How does MCP improve workflow integration?



14. Conclusion

MCP is transforming how AI systems interact by standardizing communication between models and external tools, much like how USB simplified device connections. This standardization allows developers to focus on building features rather than dealing with integration challenges. For beginners, learning MCP provides a strong foundation that will remain relevant as AI evolves. Start small, experiment, and explore how different models and tools can work together to solve real-world problems. The future of AI lies in specialized systems collaborating through protocols like MCP, making AI more powerful and efficient than ever before.

15. Learn More

#

Interested in learning more?

Spring Boot Validate API Requests and Responses with Atlassian Swagger Request Validator



Add a Comment

Your email address will not be published.