Analyze the security vulnerabilities in the MCP STDIO transport layer of AI toolchains, focusing on Remote Code Execution (RCE) risks. Break down the attack chain, provide detection scripts, and suggest production-level defense configurations to secure the AI supply chain. Include practical examples and step-by-step guidance for implementation.