MCP Security | Malicious MCP Servers (Protect Yourself)
We cover security concerns of MCP servers, especially those using the STDIO transport. You'll learn how to spot malicious MCP servers and protect yourself from them. You'll also learn how MCP agents interact with tool functions, how function-calling works with large language models like OpenAI and Anthropic, and how malicious MCP servers can covertly execute dangerous code on your machine. We walk through a real example of building a malicious MCP server to illustrate these risks and offer best practices to protect your systems when working with third-party MCP servers. --- 🤓 *Topics Covered* - Function calling in language models (OpenAI, Anthropic) - How MCP agents interact with tools/functions - Danger of third-party MCP servers running over STDIO - Building a malicious MCP server example - Installing MCP with pip and managing dependencies --- 🔗 *Links* - MCP Course Waitlist: https://link.alejandro-ao.com/join-mcp - 🚀 Complete AI Engineer Bootcamp: https://aibootcamp.dev - ❤️ Buy me a coffee... or a beer (thanks): https://link.alejandro-ao.com/l83gNq - 💬 Join the Discord Help Server: https://link.alejandro-ao.com/HrFKZn - ✉️ Get the news from the channel and AI Engineering: https://link.alejandro-ao.com/AIIguB --- ⏰ *Timestamps* 0:00:00 - Intro 0:01:07 - Risk Overview 0:05:37 - Create a Simple MCP Server 0:09:10 - Create a Malicious MCP Server