Agentic AI
What Is MCP, Actually? (Explained Like You're Five, With Code)
Every "AI agent" you've heard about — Claude Code editing your files, an agent checking your calendar, a bot pulling data from your company's database — needs some way to actually reach outside the model and touch real systems. MCP is the answer to that. Not a new AI capability. A plumbing standard.
The analogy
Before USB existed, every device needed its own custom port and its own custom cable — a printer needed one connector, a mouse needed another, a scanner needed a third. USB fixed that: one standard port, and any device that speaks USB just plugs in.
MCP (Model Context Protocol) does the same thing for AI models and tools. Instead of every company writing custom, one-off integration code to connect their model to their database, their file system, their internal APIs — each of those things exposes itself through one standard interface. Any MCP-compatible AI client (Claude Desktop, Claude Code, and others) can plug into any MCP server without custom glue code.
That's genuinely the whole idea. Everything else is implementation detail.
Why this needed to exist
Before MCP, if you wanted Claude to read your company's Notion docs and query your Postgres database and check your GitHub issues, you'd write three separate, bespoke integrations — each with its own auth, its own request format, its own bugs. Every AI product was rebuilding the same wheel.
With MCP: someone builds one Notion MCP server, one Postgres MCP server, one GitHub MCP server — once — and every MCP-compatible client can use all three immediately. You're not integrating with three APIs anymore. You're integrating with one protocol, three times over, by other people.
The two sides: servers and clients
- An MCP server exposes capabilities — tools (functions the model can call), resources (data it can read), and prompts (reusable templates). You write this once per system you want to connect.
- An MCP client — built into Claude Desktop, Claude Code, and other AI apps — discovers what a server offers and lets the model use it.
You almost never write the client. You write servers, for whatever you want an AI model to be able to reach.
The smallest possible MCP server
Let's expose one tool: checking the weather. This uses FastMCP, the high-level interface in the official Python SDK that turns a plain function into a fully-described MCP tool automatically.
pip install mcpfrom mcp.server.fastmcp import FastMCP
mcp = FastMCP("weather-server")
@mcp.tool()
def get_weather(city: str) -> str:
"""Get the current weather for a city."""
fake_data = {"Hyderabad": "34°C, humid", "London": "17°C, rainy"}
return fake_data.get(city, "No data for that city")
if __name__ == "__main__":
mcp.run()That's it. That's a working MCP server. @mcp.tool() reads your function's name, its docstring, its type hints, and turns all of that into the structured schema an AI model needs to know the tool exists and how to call it — you didn't write any JSON schema by hand.
Connecting it to Claude
Point Claude Desktop or Claude Code at this server by adding it to your MCP config (usually claude_desktop_config.json or via the claude mcp add command), and it becomes available in conversation exactly like a built-in tool:
{
"mcpServers": {
"weather": {
"command": "python",
"args": ["/path/to/weather_server.py"]
}
}
}Restart the client, and you can ask "what's the weather in Hyderabad?" — Claude sees the tool, calls it, gets the result, and answers, the same request → tool_use → tool_result cycle from the previous post in this series, just running through a standard protocol instead of code you wired up by hand.
Testing it without wiring up a full AI client
Anthropic ships an inspector tool specifically so you don't have to open Claude Desktop every time you tweak a server:
npx @modelcontextprotocol/inspector python weather_server.pyThis opens a browser UI where you can call your tools directly and see exactly what gets sent back — genuinely useful the first ten times you build one of these, before it becomes muscle memory.
What this unlocks in practice
Once you frame it as "a standard port," a lot of the agentic AI landscape stops feeling like separate technologies and starts looking like the same pattern, over and over:
- A filesystem MCP server lets Claude Code read and edit your project files.
- A database MCP server lets an agent query your data without you writing a custom SQL wrapper.
- A GitHub MCP server lets an agent open issues or read pull requests.
- A Slack MCP server lets an agent post updates to your team.
None of these are fundamentally different pieces of engineering. They're all the same 15-line pattern above, pointed at a different system.
Reference links
- Official spec: modelcontextprotocol.io/specification/latest
- Python SDK: github.com/modelcontextprotocol/python-sdk
- Official + community servers: github.com/modelcontextprotocol/servers
- MCP Inspector: github.com/modelcontextprotocol/inspector
- Anthropic's original announcement: anthropic.com/news/model-context-protocol
- Claude MCP docs: platform.claude.com/docs/en/agents-and-tools
Next in this series: "The Agent Loop — Why Every Claude Agent Is Just a While Loop."
Related articles
Agentic AI
Connecting MCP to the Real World with HTTPX (With Async Python)
Hardcoding fake data in an MCP server is fine for a demo. Making real, asynchronous REST API calls to external services is where the magic actually happens. Here's how to pair FastMCP with HTTPX.
- #mcp
- #httpx
- #python
- #agentic-ai
- #api
Agentic AI
5 Agent Mistakes I Made So You Don't Have To
Every one of these cost me real debugging time. Each has a one-line fix — here they are, with the code.
- #claude
- #agentic-ai
- #python
- #debugging
- #best-practices
Agentic AI
I Connected Claude to My Terminal and Broke My Laptop (Lessons on Agent Guardrails)
A weekend project, a bash tool with no restrictions, and the exact three mistakes that let it happen — plus the guardrails that would have stopped every one of them.
- #claude
- #agentic-ai
- #safety
- #guardrails
- #python