Skip to content

Lab 012: What is MCP? Anatomy of the ProtocolΒΆ

Level: L100 Path: πŸ”Œ MCP Time: ~20 min πŸ’° Cost: Free β€” No account needed

What You'll LearnΒΆ

  • What MCP is and why it was created
  • The three MCP primitives: Tools, Resources, and Prompts
  • MCP transport options: stdio vs HTTP/SSE
  • How to explore MCP servers with the MCP Inspector
  • How MCP integrates with GitHub Copilot, Foundry, Claude, and other agents

IntroductionΒΆ

The problem MCP solvesΒΆ

Before MCP, if you wanted to connect an AI agent to a database, you had to write custom integration code for every combination of agent + data source. N agents Γ— M data sources = NΓ—M custom integrations.

MCP solves this with a standard protocol:

MCP Architecture

MCP was created by Anthropic in 2024 and quickly adopted by Microsoft, OpenAI, Google, and others as the industry standard.


The Three MCP PrimitivesΒΆ

1. πŸ”§ ToolsΒΆ

Functions the LLM can call β€” the most common primitive.

{
  "name": "search_products",
  "description": "Search products by keyword or semantic similarity",
  "inputSchema": {
    "type": "object",
    "properties": {
      "query": { "type": "string", "description": "Search term" },
      "max_results": { "type": "integer", "default": 10 }
    },
    "required": ["query"]
  }
}

The LLM reads the description and decides when to call this tool.

2. πŸ“ ResourcesΒΆ

Data the LLM can read β€” like files, URLs, or database records.

{
  "uri": "file:///data/products.csv",
  "name": "Product catalog",
  "mimeType": "text/csv"
}

3. πŸ’¬ PromptsΒΆ

Reusable prompt templates the LLM can use.

{
  "name": "summarize_sales_report",
  "description": "Summarize a monthly sales report in 3 bullet points",
  "arguments": [
    { "name": "month", "required": true }
  ]
}

Transport OptionsΒΆ

MCP communicates over two transports:

Transport Use case How it works
stdio Local tools, CLI agents Parent process spawns MCP server as child; communicates via stdin/stdout
HTTP/SSE Remote servers, cloud agents MCP server exposes HTTP endpoints; agent connects via Server-Sent Events

In this hub's labs, we use HTTP/SSE so cloud-hosted agents (like Foundry Agent Service) can reach your MCP server.


MCP Message FlowΒΆ

When an agent calls a tool, here's what happens:

1. User asks: "Find me waterproof outdoor tools"
       β”‚
       β–Ό
2. LLM reads available tools from MCP server
   (tools/list response)
       β”‚
       β–Ό
3. LLM decides to call: search_products("waterproof outdoor tools")
       β”‚
       β–Ό
4. Agent sends: tools/call { name: "search_products", arguments: {...} }
       β”‚
       β–Ό
5. MCP Server executes the function
   (queries database, calls API, reads file...)
       β”‚
       β–Ό
6. MCP Server returns result as text/JSON
       β”‚
       β–Ό
7. LLM incorporates result into its response
       β”‚
       β–Ό
8. User sees: "Here are waterproof outdoor tools: ..."

Using the MCP InspectorΒΆ

The MCP Inspector is a browser-based tool for exploring any MCP server without writing code.

Try it now β€” no install needed

Run this command (requires Node.js):

npx @modelcontextprotocol/inspector
Or visit inspector.modelcontextprotocol.io in your browser.

With the inspector you can:

  • Connect to any MCP server (local or remote)
  • Browse available tools, resources, and prompts
  • Call tools manually and see the JSON responses
  • Debug your own MCP servers

MCP in the Microsoft EcosystemΒΆ

Product MCP support
GitHub Copilot (VS Code) βœ… Connect MCP servers in .vscode/mcp.json
Microsoft Foundry Agent Service βœ… Connect MCP servers as agent tools
Semantic Kernel βœ… MCP plugin adapter available
Claude Desktop βœ… Native MCP support
Azure MCP Server βœ… Microsoft-hosted MCP server for Azure services

VS Code MCP configuration (.vscode/mcp.json)ΒΆ

{
  "servers": {
    "my-products-server": {
      "type": "http",
      "url": "http://localhost:8000/sse"
    }
  }
}

Once configured, GitHub Copilot in VS Code can call your MCP server's tools from chat.


SummaryΒΆ

MCP is an open standard that lets any AI agent connect to any tool or data source via a consistent protocol. It has three primitives (Tools, Resources, Prompts) and two transports (stdio and HTTP/SSE). The MCP Inspector lets you explore servers without writing code.


Next StepsΒΆ

Ready to build your own MCP server?