The Real Python Podcast

Dangers of Automatically Converting a REST API to MCP

When converting an existing REST API to the Model Context Protocol, what should you consider? What anti-patterns should you avoid to keep an AI agent’s context clean? This week on the show, Kyle Stratis returns to discuss his upcoming book, “AI Agents with MCP”.

Kyle has been busy since he last appeared on the show in 2020. He’s taken his experience working in machine learning startups and started his own consultancy, Stratis Data Labs. He’s been documenting his explorations working with LLMs and MCP on his blog, The Signal Path.

Kyle is also writing a book about building MCP clients, services, and end-to-end agents. We discuss a recent article he wrote about the hazards of using an automated tool to convert a REST API into an MCP server. He shares his personal experiences with building MCP tools and provides additional resources for you to learn more about the topic.

This episode is sponsored by InfluxData.

Spotlight: Python for Beginners: Code With Confidence – Real Python

Learn Programming Fundamentals and Pythonic Coding in Eight Weeks—With a Structured Course

Topics:

  • 00:00:00 – Introduction
  • 00:02:41 – Updates on career
  • 00:04:36 – The Signal Path - newsletter
  • 00:07:15 – Moving into consulting
  • 00:12:35 – Recent projects
  • 00:14:51 – Need for data skills with MCP
  • 00:16:49 – Describing the differences between REST APIs and MCP
  • 00:19:59 – Interaction model differences
  • 00:27:29 – Sponsor: InfluxData
  • 00:28:21 – Agent stories
  • 00:32:58 – Going through a simple example of MCP server
  • 00:37:50 – Defining client and server
  • 00:40:19 – Examples of servers currently
  • 00:51:44 – Announcement: Python for Beginners: Code with Confidence
  • 01:02:07 – Resources for further study
  • 01:05:07 – Breaking down advice on moving an API to MCP
  • 01:08:04 – What are you excited about in the world of Python?
  • 01:18:20 – What do you want to learn next?
  • 01:21:35 – How can people follow your work online?
  • 01:22:46 – Thanks and goodbye

Show Links:

  • AI Agents with MCP - Book
  • Episode #10: Python Job Hunting in a Pandemic
  • Stop Converting Your REST APIs to MCP
  • Stop Generating MCP Servers from REST APIs!
  • Context7 - Up-to-date documentation for LLMs and AI code editors
  • Anthropic
  • What is the Model Context Protocol (MCP)? - Model Context Protocol
  • github-mcp-server: GitHub’s official MCP Server
  • Model Context Protocol (/MCP) - Reddit
  • modelcontextprotocol/servers: Model Context Protocol Servers
  • Browse All MCP Servers - MCP Market
  • Welcome to FastMCP 2.0! - FastMCP
  • Agent Memory: How to Build Agents that Learn and Remember - Letta
  • Kyle Stratis Personal Blog - The Edge Cases
  • The Signal Path
  • Stratis Data Labs
  • Kyle Stratis - LinkedIn
  • Kyle (@kylestratis.com) — Bluesky

Level up your Python skills with our expert-led courses:

  • Using Pydantic to Simplify Python Data Validation
  • A History of Python Versions and Features
  • Interacting With REST APIs and Python

Support the podcast & join our community of Pythonistas