MCP tools
The Model Context Protocol is a common plug for agents: any application that speaks it can use any tool server that speaks it.
Hosts, clients, servers
The host is the AI application (a chat app, an IDE). For each connected server it runs a client that speaks the protocol: JSON-RPC messages over standard input/output for local servers, or HTTP for remote ones.
What servers offer
Servers expose tools (functions the model may call), resources (data such as files or records the application can read into context) and prompts (reusable templates). A session starts with a handshake where both sides state what they support; then the client can list and call.
Step through a session with a small notes server in the lab. The messages are trimmed for clarity.
In LangChain
The langchain-mcp-adapters package connects to one or more MCP servers and turns the tools they expose into ordinary LangChain tools, which you pass to create_agent like any other.
from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient({
"files": {"command": "python", "args": ["files_server.py"], "transport": "stdio"},
})
tools = await client.get_tools() # MCP tools, now LangChain tools
agent = create_agent(model="provider:model-name", tools=tools)A worked example
A coding assistant (the host) starts an MCP client for a file-system server. The client asks what the server offers and receives a list of tools such as read_file, each with a JSON schema. When the model decides to read a file, the client sends a tools/call request and returns the file’s contents to the model as the tool result.
In practice
MCP separates writing an integration from using it: a server written once works in every host that speaks the protocol. Servers can run locally or remotely. Treat third-party servers like any dependency: they can see and do what you allow, so grant the least access they need.
Easy to confuse
- MCP does not make the model smarter; it standardises how tools and data are described and called.
- The model still only sees descriptions and results; the client and server do the actual work.
What problem does MCP solve?
With a shared protocol, a server written once works with every MCP-capable client.
Which three kinds of capability can an MCP server offer?
Tools are actions the model can call, resources are data the application can read, prompts are reusable templates.
Who decides whether a tool call actually runs?
The host mediates between model and servers and is where consent and permission checks belong.
Read more in the books
- LangChain and LangGraph documentation, LangChain: LangChain: Model Context Protocol (MCP).
- AI Engineering, Chip Huyen: Ch. 6, “RAG and Agents”: tools and tool use.