So far, tools lived inside your agent file.
Teams often keep tools in another program: orders DB helper, notes app, company API. You need a shared protocol:
- What tools exist?
- Call this tool with these inputs
- Here is the result
MCP (Model Context Protocol) is that open protocol.
Real shape (stdio)
| Piece | Role |
|---|---|
| Server | Separate process that owns tools |
| Client | Starts the server, speaks MCP, lists/calls tools |
| Transport | Often stdio — stdin/stdout as the wire |
Do not print() debug lines on the server’s stdout. That wire is for MCP messages.
mcp_client_demo.py orders_server.py
(client) (FastMCP server)
│ spawn + stdio │
├────── list_tools ──────────►│
│◄───── tool list ────────────┤
├────── call get_order ──────►│
│◄───── order facts ──────────┤ShopTiny use case
Support needs order facts without importing shop code into every agent.
| Tool | Job |
|---|---|
get_order |
Look up id → item, amount, status |
list_orders |
List known order ids |
Data lives next to the server (data/orders.json). The client only speaks MCP.
This chapter vs the next two
| Chapter | You learn |
|---|---|
| What Is MCP (here) | Client lists + calls a real server |
| Build an MCP Server | You author tools + policy data |
| Agents with MCP Tools | An LLM agent uses MCP tools in a loop |
Language note
Official MCP SDKs are strongest in Python and TypeScript — those are the Code labs.
Java and Go tabs stay empty here on purpose (no hand-rolled stand-in). Switch to Python or TypeScript for the real framework path.
See it in Code
Install once: pip install mcp (Python) or the TS SDK note in Code.
Run the client demo — it starts orders_server.py, lists tools, calls get_order("4412").