Add MCP server to AST tool

Integrates the MCP server functionality into the AST tool binary. This
allows the tool to act as a server for LLM integration, enabling
communication over stdio. The server can list available bindings and
execute scripts.
This commit is contained in:
2026-03-25 14:03:22 +01:00
parent 6042415dfc
commit 641a19e736
6 changed files with 386 additions and 2 deletions
+12
View File
@@ -39,10 +39,22 @@ struct Cli {
/// Disable optimization
#[arg(long)]
no_opt: bool,
/// Start MCP server (stdio transport, for LLM integration)
#[arg(long)]
mcp: bool,
}
fn main() {
let cli = Cli::parse();
if cli.mcp {
if let Err(e) = myc::ast::mcp_server::run() {
eprintln!("MCP server error: {}", e);
std::process::exit(1);
}
return;
}
let mut env = Environment::new();
env.optimization = !cli.no_opt;