(AI) Model Context Protocol
Overview
In 2023, use of LLMs (Large Language Models) enabled OpenAI, Google, Anthropic to become popular quicker than any other mobile apps in history.
When, in 2024, Anthropic.com released https://www.anthropic.com/news/model-context-protocol, the technology was called the “hottest thing ever in tech”:
“MCP” (Model Context Protocol) is powerful because it enables LLMs (Large Language Models) hosts to access custom tools and services. An MCP client can make requests to MCP servers to access tools that they provide.
6-hr video course: Learn about MCP by Elie Schoppik of Anthropic
Components of MCP:
-
MCP Server = a back-end API (provides actual functionality - like database access, file operations, API integrations such as a database server that exposes query tools, a file system server that provides file access, a web scraping server.
-
MCP Client = a front-end app that consumes functionality by making MCP-compliant requests to MCP Severs to execute tools, fetch resources, or use prompts. Examples are Warp, Claude Desktop, VS Code extensions, custom AI applications.
This shows an image of an MCP Client, Claude Desktop:
A standardized way to communicate means that when a MCP Client is created, it can quickly be connected to clients who can use them in prompts.
-
MCP Host = A web server/runtime hosts (houses) MCP Clients and manages the connection and orchestration among MCP Clients and Servers. It makes use of LLM apps with server lifecycles, transport protocol handling. and message routing (based on MCP, the Model Context Protocol). A Host may expose “Resources” of read-only data or “Template” of prompts.
Orchestration capabilities is what sparked the “Agentic AI” vision toward a future where multiple AI Agents can be coordianted to autonomously take action – not just moving a cursor, filling forms, and coding, but also reason to do research, perform entire workflows as physical and virtual robots.
Standardization of how MCP communicates with AI Agents has made it easier for thousands of MCP servers and AI Agents to be created each day and appear in MCP Catalogs:
- https://hub.docker.com/mcp is Docker’s MCP catalog
- https://github.com/mcp
- https://mcpservers.org
- https://mcp.so
- https://github.com/punkpeye/awesome-mcp-servers
- https://github.com/microsoft/mcp lists Microsoft’s MCP Servers.
JSON for Configuration
Details about each MCP Server would include a sample JSON-format configuration file sent to execute it. For example, the “time” MCP Server also has tools such as “get_current_time” and “convert_time” not shown above but described by documentation.
{
"mcpServers": {
"time": {
"command": "uvx",
"args": ["mcp-server-time", "--local-timezone=America/Denver"],
"env": { "-y", { "ACCESS_TOKEN": "SECRET_API_KEY" } },
"working_directory": null
}
}
}
PROTIP: The JSON configuration enables you to define multiple servers in one go.
Such configurations contain a command spec of “uvx”, “npx” or “pip” utilities used to install the MCP Server named. So the uv, Node.js, and pip packages should be installed.
Alternately, a URL may be provided for an HTTP endpoint that supports Server-Sent Events (SSE).
“args” (arguments) specify parameters that specify program behavior options. Other MCP Servers might require “SECRET_API_KEY” in the JSON configuration. [VIDEO]
Optionally, the “env” (environment) variable is used to hold positional specifications such as “-y” to automatically confirm acceptance of default values.
Aditionally, working_directory argument specified if a server needs them.
Dozens of YouTube videos offer conceptual tutorials with flowcharts:
- https://www.youtube.com/watch?v=7j1t3UZA1TY
- https://www.youtube.com/watch?v=23PzNxw11jc&pp=0gcJCfwJAYcqIYzv gRPC
- https://www.youtube.com/watch?v=E2DEHOEbzks “How MCP Works” by the author of KodeKloud.com
In this article, let’s get you hands-on using the “Official Microsoft Learn MCP Server” loaded with what Microsoft previously displayed on their marketing, documentation, and tutorial websites, so that users can hold natural language conversations like with OpenAI’s ChatGPT.
- https://learn.microsoft.com/api/mcp
Sample prompts are presented after we cover installation of MCP Clients on your laptop.
- Highlight and copy the above URL to your machine’s Clipboard so you can paste it into an internet browser Address field.
- If you use the Safari browser, it would try to download a file “mcp”. So…
- If you use the Chrome, Firefox, or Brave browser, you would see a message returned as a convenience to humans:
“This is an MCP server endpoint and cannot be accessed directly via a browser or unsupported transports like SSE. Please use a streamable HTTP transport. For more details, visit: https://github.com/microsoftdocs/mcp.
DEFINITION: “streamable HTTP transport” refers to the MCP standard specifying that, unlike websites which return HTML, MCP Servers use gRPC (Remote Procedure calls) and SSE (Server Sent Events) for remote and “stdio” for local communication.
An MCP client usually needs to be installed to handle those technologies:
MCP Clients
At https://github.com/MicrosoftDocs/mcp/blob/main/README.md#-installation–getting-started the page provides step-by-step instructions to install several clients to use Microsoft’s server.
REMEMBER: Even though the underlying communication protocol is standardized by MCP, each of these categories of MCP Client tech have a different way to install:
- Stand-alone apps such as Warp CLI, Claude Desktop, Cline, Copilot Studio, Microsoft Semantic Kernel, etc.
- Stand-alone IDE such as Winsurf, PyCharm, continue.dev
- Extensions added to IDE VSCode, such as Cursor, GitHub Copilot.
- Stand-alone utilities such as MCP Inspector for a deep-dive into the “JSON-RPC over HTTP or stdio” protocol used by MCP.
- Web servers such as NodeJs
Click on a link in the list above for install and run instructions.
The exception is curl command within the Terminal that comes with macOS.
curl
Copy all lines of this command for pasting on the Warp CLI or other Terminal to execute:
curl -X POST https://learn.microsoft.com/api/mcp \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream, application/json" \
-d '{
"jsonrpc": "2.0",
"id": "test-1234",
"method": "tools/call",
"params": {
"name": "microsoft_docs_search",
"arguments": {
"query": "Who uses MCP"
}
}
}' | grep '^data:' | sed 's/^data: //' \
| jq -r '.result.content[].text' | jq -r '.[] | .content' \
> mcp-ms-learn.md
brew install glow
glow mcp-ms-learn.md
More about the coding parameters above:
-X POST defines the MCP Server endpoint.
-H “Content-Type: application/json is required for JSON-RPC compliance.
-H “Accept: text/event-stream, application/json defined in
-d ‘{ … }’ defines a JSON body defining the RPC method and parameters.
“jsonrpc”: “2.0” uses the “JSON-RPC version 2” protocol (which operates over HTTP POST).
“method”: “tools/call” — Invokes a tool defined by the MCP server.
“params.name” — The name of the tool Microsoft defined, and
“params.arguments” — Key–value pairs of arguments specific to the selected tool.
Tool Name | Description | Input Parameters |
---|---|---|
"microsoft_docs_search" | Performs semantic search against Microsoft official technical documentation | query (string): The search query for retrieva |
"microsoft_docs_fetch" | Fetch and convert a Microsoft documentation page into markdown format | url (string): URL of the documentation page to read |
"microsoft_code_sample_search" | Search for official Microsoft/Azure code snippets and examples | query (string): Search query for Microsoft/Azure code snippets language (string, optional): Programming language filter. |
| grep ‘^data:’ | sed ‘s/^data: //’ adjusts JSON response parsing for SSE response format.
| jq -r ‘.result.content[].text’ | jq -r ‘.[] | .content’ </tt> removes the excess “\\n” in JSON response.
> mcp-ms-learn.md; brew install glow; glow mcp-ms-learn.md outputs to a markdown file which the glow utility formats for display on the CLI Console.
Warp CLI
Warp.dev is my favorite AI assistant.
- Open Warp.app
-
At the same time, press command + comma for the Settings GUI.
Go to Warp’s MCP Server settings via: Warp Drive > Personal > MCP Servers. Command Palette: search “Open MCP Servers”
- Click “AI” menu.
- Scroll down to click “Manage MCP Servers”.
- Click “+ Add” to add a new MCP server.
https://github.com/MicrosoftDocs/mcp/blob/main/README.md
https://github.com/MicrosoftDocs/mcp/blob/main/.openpublishing.publish.config.json contains:
{
"docsets_to_publish": [],
"notification_subscribers": [],
"sync_notification_subscribers": [],
"branches_to_filter": [],
"need_preview_pull_request": true,
"dependent_repositories": [
{
"path_to_root": "_themes",
"url": "https://github.com/Microsoft/templates.docs.msft",
"branch": "main",
"branch_mapping": {}
}
]
}
Install and use MCP within VS Code
Since most developers already have Visual Studio Code, let’s add an MCP server to it:
- In VSCode, open the Command Palette
- Press at the same time: Shift + Command + P
- Click the settings icon at the lower-left to select “Command Pallete”.
- Ignore the “>” and type enough of MCP: Add Server to select it.
- Choose the server type (HTTP/SSE (Server Sent Events) for remote, stdio for local).
-
Enter the server URL
https://learn.microsoft.com/api/mcp
- ??? Provide a Server ID, and select whether to save in workspace or user settings.
- ??? Configure authentication (e.g., add your API key to headers in .vscode/mcp.json or settings.json).
Claude Desktop
https://claude.ai/download
MCP OpenAI Claude
References:
- https://www.youtube.com/watch?v=Y0tZ35dFFx4
MCP servers in the cloud
https://
Ensure you send the required authentication headers (often an API key or OAuth token).
Build Custom MCP Servers
Build your own MCP server using any supported language — MCP just requires
For .NET or Node.js, sample server-side packages are available.
You can define tools and expose them dynamically for LLMs to consume, optionally supporting authentication, prompts, and tool-specific parameters.
Install and use MCP Inspector utility
- https://www.youtube.com/watch?v=tnk80CnhQB4&t=43s by Euron, using Powrshell VSCode uv add “mcp[cli]” to define a program usinf fastmcp library
Documentation about the tool is at:
https://modelcontextprotocol.io/docs/develop/connect-remote-servers
“The Inspector runs directly through npx without requiring installation”
npx @modelcontextprotocol/inspector python main.py
MCP projects
https://github.com/smallnest/mcp Awesome list of MCP projects
https://www.projectpro.io/article/mcp-projects/1142
MCP
https://www.youtube.com/watch?v=Ek8JHgZtmcI Learn MCP Servers with Python (EASY)” by Alejandro AO - Software & Ai
https://www.youtube.com/watch?v=E2DEHOEbzks&t=61s Model Context Protocol (MCP) Explained for Beginners: AI Flight Booking Demo! by Mumshad Mannambeth at KodeKloud
https://learn.kodekloud.com/courses/crash-course-mcp-for-beginners 1hr Crash Course: MCP For Beginners by Mumshad Mannambeth
https://learn.kodekloud.com/courses/mcp-for-beginners MCP For Beginners by Jeremy Morgan
https://learn.kodekloud.com/courses/ai-agents AI Agents by Gav Ridgeway
https://learn.kodekloud.com/user/courses/cline Cline by Jeremy Morgan free open-source MCP plan and act workflows agent context windows https://learn.kodekloud.com/user/courses/cline/module/07505364-dfb1-4691-8f55-ce69bc5e81ec/lesson/e9b7e535-1529-44be-8dd1-702c06a7b7dc
https://www.youtube.com/watch?v=yY6uo6mL-Ic&t=1019s Impact of AI on the future of our industry & software development by 4.0 Solutions
Local notes Obsedian MCP server
https://www.youtube.com/watch?v=5xqFjh56AwM 1hr MCP Crash Course for Python Developers by Dave Ebbelaar
https://www.youtube.com/watch?v=VfZlglOWWZw&t=3s 1hr MCP Crash Course for Python Developers https://github.com/microsoft/mcp-for-beginners This high-level generalizations with buzzwords open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
RAG
https://www.youtube.com/watch?v=X0PwwfcGSHU We Found the BEST Vector Database! (Testing Head-to-Head Benchmarks) by Better Stack
https://github.com/santosomar/AI-agents-for-cybersecurity
Azure MCP Server
https://learn.microsoft.com/en-us/azure/developer/azure-mcp-server/tools/ and https://learn.microsoft.com/en-us/training/modules/connect-agent-to-mcp-tools/?source=recommendations describes how “Azure MCP Server tools” answers questions such as:
- “Show me all my resource groups”
- “List blobs in my storage container named ‘documents’”
- “What’s the value of the ‘ConnectionString’ key in my app configuration?”
- “Query my log analytics workspace for errors in the last hour”
- “Show me all my Cosmos DB databases”