Model Context Protocol Explained: A Look at MCP

Aditya KhadangaAditya Khadanga
3 min read

Both Software Engineers and AI Agents use MCP to complete tasks for their organizations. MCP is designed based on how Software Engineers work, making it easier for AI to perform similar tasks.

Here's a simple example: When developers need to create GitHub repositories, they can do it manually for a few repos. But for creating many repositories (like 100), they use APIs instead. They use a REST client that communicates with servers using HTTP protocol.

AI agent Cons

AI agents face 3 main challenges:

  • They lack standardized ways to perform tasks

  • They don't have enough context about the tasks they need to do

  • There are security concerns when sharing login credentials

How MCP became the Solution

MCP solves these problems by providing a standard way for AI to interact with systems:

REST Client → HTTP Protocol → REST API Server

just like that

MCP Client → MCP Protocol → MCP Server

It works similarly to how you chat with AI assistants. The AI agent comes with an MCP Client - you just need to turn it on.

Setup

Here's how to set it up in VS Code (version 1.99 or higher):

  1. Go to github.com/github/github-mcp-server on GitHub ( here you will find the repo you can fork it for futute use. go to your usecase. ( ex: here we will use MCP Protocol for tasks for github itself) so go an copy from there or get that code from below )
{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "github_token",
        "description": "GitHub Personal Access Token",
        "password": true
      }
    ],
    "servers": {
      "github": {
        "command": "docker",
        "args": [
          "run",
          "-i",
          "--rm",
          "-e",
          "GITHUB_PERSONAL_ACCESS_TOKEN",
          "ghcr.io/github/github-mcp-server"
        ],
        "env": {
          "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}"
        }
      }
    }
  }
}
  1. Create a Project in VS Code

  2. Press Ctrl + Shift + P and select "Open User Settings"

  3. Copy the provided JSON settings and paste them into settings.json.

  4. then click on start and paste your github personal access token ( github → settings → developer settings in left pane → tokens - clasic - >Personal access tokens (classic) for general use → give the permission only how much required and save it for future use )

  1. When prompted, enter your GitHub API token ( after that if you face those issue click on the github copilot chat logo and ask to that chat, as here i have faced issue regarding docker ) after running docker as a administrator this issue got resolved)

  1. then in github copilot chat click on agent

  2. Check this in a terminal →

    docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN=<Paste Personal access token> ghcr.io/github/github-mcp-server

( why? → After ensuring Docker is running, test the MCP server by running the configured command in your settings.json file )

  1. Now check the below image

here i tell the MCP Server(here it is github) to create_repository using a MCP Clinet(Co pilot) and the request and response happened through a MCP Protocol.

Important notes:

  • GitHub Copilot chat serves as the MCP Client

  • Select "agent" from the dropdown menu

  • Click on "tools" to see available tasks

  • You can perform actions like creating repositories

Use Case Example: Even when cloud services like AWS don't provide APIs for certain resources, you can still automate tasks using MCP Clients through simple prompt scripts.

0
Subscribe to my newsletter

Read articles from Aditya Khadanga directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Aditya Khadanga
Aditya Khadanga

A DevOps practitioner dedicated to sharing practical knowledge. Expect in-depth tutorials and clear explanations of DevOps concepts, from fundamentals to advanced techniques. Join me on this journey of continuous learning and improvement!