1. The MCP lifecycle
Every MCP session moves through the same five steps. The client initialises a connection, discovers what the server can do, negotiates the shared capability set, invokes individual tools or resources, and waits for typed responses.
- 1
Initialize
- 2
Discover
- 3
Negotiate
- 4
Invoke
- 5
Respond
2. Transports
MCP carries its JSON-RPC payload over one of three transports. Pick based on whether the server runs locally with the client, as a daemon, or on the edge.
stdio
Server runs as a child process of the client. Zero network surface.
HTTP
Server runs as a daemon, client connects via HTTP. Best for production.
SSE
Server-Sent Events for long-lived streaming responses.
3. JSON-RPC communication
MCP is JSON-RPC 2.0 with a small set of well-known methods. Here
is a typical tools/list exchange:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
} {
"jsonrpc": "2.0",
"id": 1,
"result": {
"tools": [
{
"name": "posts.create",
"description": "Create a new WordPress post",
"inputSchema": { ... }
}
]
}
} 4. Tools, resources & prompts
Three primitives, three jobs:
- Tools — verbs 14
- Resources — data 8
- Prompts — recipes 5
5. Capabilities
During the initialize step, server and client exchange a capability map. The client learns what verbs the server exposes; the server learns which features the client supports (sampling, roots, log levels, progress notifications).
6. Context flow
A single user prompt usually triggers a small graph of tool calls. The agent plans, calls a tool, reads the response, optionally fetches a resource, calls another tool, and finally returns text to the user. Every step is logged and replayable.
7. Why it matters
Without MCP, every AI integration is bespoke — a custom prompt, a custom JSON shape, a custom auth flow per client. MCP collapses that into a single typed protocol so the WordPress server you build once works in Claude, ChatGPT, Cursor, and every future client.