Agentic AI Foundations Series · Part 4 of 6
Part 4: MCP – The USB-C of AI, in Plain Words
Model Context Protocol (MCP) is an open standard, started by Anthropic, that lets any AI app plug into any tool or data source the same way. Build a connector once; every MCP-aware app can use it.
The listener analogy
As a DBA you know this already. Before Oracle Net, every app needed its own way to reach the database. With a listener and a standard protocol, any client that speaks Oracle Net can connect.
MCP does that for AI. Without it, 5 AI apps × 10 tools = 50 custom integrations (the M×N problem). With MCP, each side implements the protocol once.
The three roles
- Host – the AI app the user works in (Claude Desktop, an IDE, your agent app). Like SQL Developer.
- Client – sits inside the host and holds one connection to one server. Like a single session.
- Server – exposes capabilities: a database server, a GitHub server, a file server. Like the database behind the listener.
What a server offers: three primitives
This is the most tested part. Learn who controls each:
| Primitive | Who controls it | DBA example |
|---|---|---|
| Tools | The model decides to call | run_sql, restart_listener |
| Resources | The application supplies | A schema file, alert log contents (read-only) |
| Prompts | The user picks | A saved "AWR analysis" template |
What a client offers back
- Sampling – the server asks the host's LLM to write something.
- Roots – the client tells the server which folders/files it may touch.
- Elicitation – the server asks the user for missing input.
Under the hood
- Messages are JSON-RPC 2.0.
- Two transports: stdio for a local server on the same machine, Streamable HTTP for remote servers (it replaced the older HTTP+SSE).
- Lifecycle: initialize → negotiate capabilities → work → shut down.
- Typical calls:
tools/listto discover,tools/callto run. - Security: user consent, least privilege, OAuth for remote servers, and watch for prompt injection hidden in tool results.
MCP vs function calling
Function calling is how one model asks for one tool. MCP is the standard plug that makes tools discoverable and reusable across apps. They work together.
Remember for the exam
- Host, client, server; client-to-server is 1:1.
- Tools = model, resources = app, prompts = user.
- JSON-RPC 2.0; stdio local, Streamable HTTP remote.
Self-check
- Which primitive gives read-only context such as file contents? (Resources)
- Which transport fits a server running on the same laptop? (stdio)
- What message format does MCP use? (JSON-RPC 2.0)
No comments:
Post a Comment