---
title: "How Does MCP Work Under the Hood?"
description: "[NewSearch millions of jobs from your AI agent with MCP→](/blog/jobspipe-mcp-server)"
canonical: https://jobspipe.dev/blog/how-does-mcp-work-under-the-hood
last_updated: 2026-09-10
---

[NewSearch millions of jobs from your AI agent with MCP→](/blog/jobspipe-mcp-server)

[All posts](/blog)

![](/listly/card-field.png)

GuideHood

Guide·Sep 9, 2026·3 min read

# How Does MCP Work Under the Hood?

How does MCP work under the hood? JSON-RPC 2.0 messages: a handshake, tools/list, then each model tool call routed as tools/call over stdio or HTTP.

![Dvir Atias](/authors/dvir-atias.jpg)

Dvir Atias

Founder, JobsPipe

How does MCP work under the hood? It is a JSON-RPC 2.0 conversation between a client, embedded in the host application, and a server that exposes tools. The two shake hands and negotiate capabilities, the client fetches the tool list, and every tool call the model makes travels as a `tools/call` request over stdio or Streamable HTTP.

## How MCP works internally, message by message

1.  **Three message shapes.** Every MCP message is JSON-RPC 2.0. A request carries an `id`, a `method` and `params`; a response carries the same `id` with either `result` or `error`; a notification has a method but no `id` and expects no reply.
2.  **The initialize handshake.** The client opens with `initialize`, stating the protocol version it speaks, its own capabilities and a `clientInfo` name. The server answers with the version it will use, its capabilities (whether it offers tools, resources or prompts, and whether it will announce list changes) and `serverInfo`. The client then sends `notifications/initialized`.
3.  **Discovery.** The client calls `tools/list`, and `resources/list` or `prompts/list` when the server advertised them. Each tool arrives with a name, a description and a JSON Schema for its arguments. The host turns those into the tool definitions it hands to the model, so the model sees ordinary function definitions and never the protocol.
4.  **The call.** When the model emits a tool call, the host matches the name to the client that advertised it and sends `tools/call` with the name and arguments. The server replies with content blocks, usually text, and optionally `structuredContent`. A failed run comes back with `isError: true` as a result the model can read, not as a protocol error.
5.  **Transports.** Over stdio the host launches the server as a subprocess and exchanges newline-delimited JSON on stdin and stdout; stderr is for logs. Over Streamable HTTP the server is one endpoint at a URL: the client POSTs each message, the server answers with plain JSON or a server-sent event stream, and an optional `Mcp-Session-Id` header ties requests to a session.
6.  **Everything else is notifications.** Servers announce changed tool lists, report progress and accept cancellation, and can ask the client for a model completion (sampling) or user input (elicitation) if the client declared those capabilities.

The host, not the model, owns the connection. When Claude or Cursor produces a tool call, the host looks up which client advertised that tool name, sends the request and inserts the result into the model’s context. With several servers connected it dispatches by name, which is why two servers exposing the same tool name cause trouble.

## Where JobsPipe fits

JobsPipe is a jobs data API that collects live postings from LinkedIn, Indeed, Y Combinator, Naukri, Workday, Greenhouse, Workable, SmartRecruiters, Ashby, Lever and Paylocity, returns them as one schema with closure tracking and a ghost score, and includes a free tier of 1,000 jobs a month. It runs a hosted MCP server at `https://mcp.jobspipe.dev/mcp` over Streamable HTTP with four tools: `search_jobs`, `detect_company_tech_stack`, `list_pricing_plans` and `search_documentation`. When an agent calls `search_jobs`, the server maps the arguments onto `POST /v1/jobs/search` and returns the postings as structured content. You can watch the handshake yourself with curl:

```
curl -X POST https://mcp.jobspipe.dev/mcp \
  -H "Authorization: Bearer $JOBSPIPE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": { "name": "curl", "version": "1.0" } } }'
```

The response lists the server’s capabilities, and a `tools/list` call on the same session returns the four tool schemas. Setup for each client is on the [MCP server page](/mcp-server), the concepts are in [what is an MCP server](/blog/what-is-an-mcp-server), and the server side is in [how to build an MCP server](/blog/how-to-build-an-mcp-server).

Connect the hosted MCP server and watch a real tools/call land - free tier included.

![](/listly/shape-heart.png)

FAQs

## Frequently Asked Questions

### How does MCP work internally?

Internally MCP is JSON-RPC 2.0 over a transport. The client sends initialize, the server answers with its capabilities, the client confirms with notifications/initialized, then calls tools/list and forwards the model's tool calls as tools/call requests. Results come back as content blocks, with isError marking a failed tool run the model can still read.

### How does MCP work with agents?

An agent framework plays the host. It opens one client per configured server, merges the tools they advertise into the model's tool list, and when the model emits a call it routes the request to the server that owns that name. The loop then feeds the result back as a tool result and continues until the task is done.

### How does MCP work with Claude?

Claude Desktop, Claude Code and claude.ai connectors each embed an MCP client. You register a server by command (stdio) or URL (Streamable HTTP), Claude lists its tools, and a permission prompt guards each call. The JobsPipe server connects at https://mcp.jobspipe.dev/mcp with a JobsPipe sign-in or an API key sent as a bearer token.

[

← Previous

Job board backfill: what backfill means in hiring, and how backfill feeds work

](/blog/job-board-backfill)[

Next →

What Are the Best AI Agents?

](/blog/what-are-the-best-ai-agents)

---
Canonical URL: https://jobspipe.dev/blog/how-does-mcp-work-under-the-hood
Title: How Does MCP Work Under the Hood?
Description: How does MCP work under the hood? JSON-RPC 2.0 messages: a handshake, tools/list, then each model tool call routed as tools/call over stdio or HTTP.

---
AI agents: the full machine-readable index of this site is https://jobspipe.dev/llms.txt?src=md-twin - API quickstart, no-key sandbox (POST https://api.jobspipe.dev/v1/sandbox/jobs/search), MCP server, pricing. Free key: https://jobspipe.dev/signup