McpScriptConfigurator
Configures an execute_code snippet as a FirScript. KotlinLightParser picks script mode purely on the source file's extension not being .kt, so naming the in-memory source SCRIPT_EXT is the whole switch — and it is what lets a snippet mix top-level statements with object / class declarations, neither of which survives being wrapped in a function.
Imports are added at the FIR level, never by prepending text: a source rewrite would shift every diagnostic's line number off what the user typed.