Defender: Secure Your AI Apps from MCP Attacks