AI Dev Tools: Week 3 - MCP & Agents
This week was a deep dive into the Model Context Protocol (MCP), an open standard that enables AI models to interact with external data sources and tools in a standardized way. Here’s what I learned:
Standardizing AI Interactions
MCP solves the problem of “bespoke” integrations for every AI tool. Instead of writing custom code for each AI assistant to access a database or API, we can now build MCP Servers that any MCP Client (like Cursor, Claude Desktop, or VSCode) can understand. This decoupling of the “brain” (AI model) from the “hands” (tools/data) is a game-changer for developer productivity.
MCP Primitives: Tools, Resources, and Prompts
I learned the three core building blocks of MCP:
- Tools: Executable functions the AI can call (e.g., get_weather, scrape_website).
- Resources: Read-only data sources the AI can inspect (e.g., local files, API docs).
- Prompts: Pre-defined templates that guide how the AI should interact with the user or the tools.
Developer Experience with FastMCP
Using FastMCP (by Jon Lowin) made building servers incredibly easy. With just a few lines of Python and a decorator (@mcp.tool), I could transform a standard function into an MCP tool. The library handles the complex JSON-RPC communication under the hood, allowing developers to focus on the logic.
Protocol Transports: Stdio vs. SSE
We explored two main ways MCP clients and servers communicate:
- Stdio: The standard way for local integrations (e.g., a CLI tool or a plugin within an IDE).
- SSE (Server-Sent Events): Enables remote communication over HTTP, which is essential for web-based agents and distributed systems.
Supercharging Workflows with Live Docs
One of the most powerful use cases we saw was using Context 7. By connecting an AI assistant to live documentation (like Airflow or Astro) via MCP, the model can “see” the latest updates and fix code based on real-time info, rather than relying on stale training data.
Key Lessons
- MCP is the “USB port” for AI: It provides a universal interface for AI power.
- Fast prototyping is key: Tools like
mcp-inspectorallow you to test your server logic instantly without needing a full AI client. - Connect to the real world: Whether it’s scraping a website or indexing a GitHub repo, MCP allows AI to act on real, current data.
Homework
I implemented an MCP server that included:
1. Web Scraper Tool: Uses the Jina Reader API to convert any URL into clean markdown for the AI to process.
2. Documentation Search Tool: Downloads a repository, indexes markdown files using Minsearch, and provides a search function to retrieve relevant context.
This turned my AI assistant into a specialized documentation expert for any library I point it at.
Homework: MCP Scraper and Search Tool