Skip to content
general artificial-intelligence

Model Context Protocol (MCP)

mcp ai-integration tool-use protocol
Plain English

MCP is a universal plug for AI tools. Without MCP, every AI assistant needs a custom integration for every service it connects to (Slack, GitHub, Google Drive, your database). MCP standardizes this: any AI that speaks MCP can connect to any MCP server, just like any USB device works with any USB port. It gives AI assistants the ability to read files, query databases, search the web, and interact with your tools through a single, open protocol.

Technical Definition

Model Context Protocol (MCP) is an open protocol developed by Anthropic that standardizes how AI applications connect to external data sources and tools. It uses JSON-RPC 2.0 over STDIO (local) or HTTP with SSE (remote) for communication.

Architecture:

  • MCP Host: the AI application (Claude Desktop, Claude Code, IDE plugin) that initiates connections
  • MCP Client: maintains a 1:1 connection with an MCP server
  • MCP Server: a lightweight process that exposes tools, resources, and prompts to the AI

Server capabilities:

  • Tools: functions the AI can invoke (search files, run queries, send messages, create resources)
  • Resources: data the AI can read (file contents, database records, API responses)
  • Prompts: pre-built prompt templates the server provides

Protocol flow:

  1. Host starts the MCP server process
  2. Client and server exchange initialize messages (capability negotiation)
  3. Client discovers available tools via tools/list
  4. During conversation, the AI decides to call a tool
  5. Client sends tools/call with the tool name and arguments
  6. Server executes the tool and returns the result
  7. AI incorporates the result into its response

Key design principles:

  • Servers are stateless: each tool call is independent
  • Human in the loop: the host can require user approval before executing tool calls
  • Composable: multiple MCP servers can be connected simultaneously
  • Local-first: servers run on the user’s machine, keeping data private

MCP server implementation (Python)

# Simple MCP server using FastMCP
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("Network Tools")

@mcp.tool()
async def check_port(host: str, port: int) -> str:
    """Check if a TCP port is open on a remote host."""
    import asyncio
    try:
        _, writer = await asyncio.wait_for(
            asyncio.open_connection(host, port), timeout=5.0
        )
        writer.close()
        await writer.wait_closed()
        return f"Port {port} on {host} is OPEN"
    except (asyncio.TimeoutError, ConnectionRefusedError, OSError):
        return f"Port {port} on {host} is CLOSED or filtered"

@mcp.tool()
async def dns_lookup(domain: str) -> str:
    """Resolve a domain name to its IP addresses."""
    import socket
    try:
        results = socket.getaddrinfo(domain, None)
        ips = sorted(set(r[4][0] for r in results))
        return f"{domain} resolves to: {', '.join(ips)}"
    except socket.gaierror as err:
        return f"DNS lookup failed for {domain}: {err}"

if __name__ == "__main__":
    mcp.run()
// claude_desktop_config.json
{
  "mcpServers": {
    "network-tools": {
      "command": "python",
      "args": ["network_mcp.py"]
    }
  }
}
In the Wild

MCP adoption has been explosive since its release. As of early 2026, the MCP ecosystem has surpassed 97 million npm installs across server packages. Claude Code uses MCP extensively: every external tool connection (GitHub, Slack, Google Workspace, databases) goes through MCP servers. The protocol solves the “N x M integration problem”: without MCP, N AI applications each need custom integrations with M services (N*M integrations). With MCP, each service builds one server and each AI builds one client (N+M integrations). Community-built MCP servers exist for virtually every popular service. For IT professionals, writing an MCP server is a way to give AI assistants access to internal tools, custom APIs, and proprietary systems that will never have official integrations.