The Model Context Protocol (MCP) is an open standard, introduced by Anthropic in late 2024 and now widely adopted, that defines how AI applications connect to external tools and data sources. It is often described as "USB-C for AI integrations": instead of building a custom integration for every model and every tool, both sides implement one protocol. Architecture - Host: the AI application the user works in (an IDE assistant, a chat app, an agent). - Client: the component inside the host that maintains a connection to one server. - Server: a program that exposes capabilities to the AI through the protocol. What an MCP server exposes - Tools: functions the model can call, with JSON Schema-described inputs (for example "create_issue", "query_database"). - Resources: read-only data the application can load into context (files, records, documents). - Prompts: reusable prompt templates offered to users. Transport and format - JSON-RPC 2.0 messages. - stdio for local servers launched by the host, or Streamable HTTP for remote servers, with OAuth-based authorization for remote access. Example flow 1. The host connects to a GitHub MCP server and lists its tools. 2. The user asks, "Summarise open bugs assigned to me." 3. The model decides to call the list_issues tool with parameters; the host executes it through the client (often after asking the user's permission) and returns the result to the model. 4. The model answers using real data. Building one in .NET The official C# SDK (ModelContextProtocol package) lets you mark methods with attributes such as [McpServerTool] and host the server over stdio or ASP.NET Core HTTP. SDKs also exist for TypeScript, Python, Java and others. Security considerations - Servers can run code and access data, so apply least privilege, authenticate remote servers, require user approval for sensitive actions, validate inputs, and beware of prompt injection from data returned by tools. Why it matters: reusable integrations, consistent tool access across AI products, and a standard way to give models up-to-date, real context.
Ravindra Wadile · · 0 likes