MCP
MCP (Model Context Protocol)
Summary
model: means machine learning models
model context protocol: the standard to adding more context ability for ai model. It’s an open-source standard for connecting AI applications to external systems.
the protocol contains:
specification (schema) of client/server implementation requirements:
JSON-RPC: as the main communication media type
lifecyce management
authorization
transports: how client & server communicate
stdio, communication over standard in and standard out
server features
client features: this makes the server can be interactive with the client side.
other utilities
sdks
tools
etc.
Architecture
Architecture overview - Model Context Protocol
Architecture - Model Context Protocol
It’s a client-host-server architecture. Host can coordinate and run mutliple client instances. And each client instance can connect with server to use external abilities.
The whole communication is based on json messages.
The key concepts are the primitives provided by both client & server. Those primitives enable the client to send request to be finished by server, and server can send request to client for further information from user

Key Notes

workflow examples
example workflow - Model Context Protocol
1. initialization
client request:
1 | { |
server response:
1 | { |
2. primitive discovery
client request:
1 | { |
server response:
1 | { |
primitive execution
client request:
1 | { |
server response:
1 | { |
4. notifications
server notification:
1 | { |
Primitives examples
Understanding MCP servers - Model Context Protocol
Understanding MCP clients - Model Context Protocol
tools
example server tool definition response:
1 | { |
resources
example server resource definition response:
1 | { |
prompt
example server prompt definition response:
1 | { |
elicitation
example client elicitation definition response:
1 | { |
root
example client response to a server root request:
1 | { |
sampling
example server request to client for model support:
1 | { |