MCP server is used to create a secure code sandbox environment, execute code in Docker containers, and provide code execution capabilities for AI applications.