Building Safer AI Agents With the Model Context Protocol (MCP): A Practical Deep-Dive