Sub topic 1
Why MCP Exists: From Custom Integrations to One Protocol
Prerequisites
Assume you can read JSON, understand basic client-server communication, and know that an LLM application can call external functions.
Why MCP exists: from custom integrations to one protocol
An AI application often needs access to files, databases, APIs, and developer tools. Without a shared protocol, each application must implement a separate integration for each service. A host might need one design for GitHub, another for a database, and another for a local file system.
The Model Context Protocol (MCP) defines common messages and behaviors for these integrations. An MCP server can expose its capabilities once, and many compatible hosts can use them. MCP does not replace the underlying service. It standardizes how an AI application discovers and uses that service.
Hosts, clients, and servers: who does what
The host is the AI application that the user operates. It manages the conversation, model, permissions, and user interface.
An MCP client is the connection component inside the host. A host can create one client for each MCP server. The client handles protocol messages and presents the server's capabilities to the host.
An MCP server is a program that provides capabilities. It can offer tools, resources, or prompts. The server usually controls how those capabilities access an external system.
The wire format: JSON-RPC requests, responses, and notifications
MCP uses JSON-RPC 2.0, a message format for calling methods by name. A request has an id, a method, and optional params. A response repeats the same id. A notification has no id, so it does not receive a response.
[
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "add",
"arguments": {
"a": 2,
"b": 3
}
}
},
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"content": [
{
"type": "text",
"text": "5"
}
],
"isError": false
}
}
]The two objects represent separate messages sent in sequence. The matching id lets the client connect the response to its request.
Starting a session: initialization and capability negotiation
An MCP connection starts with an initialization request. The client states the protocol version it supports, its identity, and capabilities such as sampling. The server responds with its supported version, identity, and capabilities. After that exchange, the client sends an initialized notification and normal operations can begin.
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": {
"sampling": {}
},
"clientInfo": {
"name": "example-client",
"version": "1.0.0"
}
}
}Capability negotiation prevents one side from assuming that the other supports a feature. Clients and servers should use only features confirmed during initialization.
Exercise
Which component should enforce whether a user approves a tool call: the host, client, or server?
Show answer
The host normally owns the user experience and approval policy, while the client transports the request and the server performs the operation.