Skip to main content

re_ghidra_agy_mcp/
mcp.rs

1//! `re-ghidra-agy-mcp` — the plugin's MCP server, spoken over stdio.
2//!
3//! Antigravity launches this binary via its MCP config and talks JSON-RPC to it on
4//! stdin/stdout. It owns no reverse-engineering logic: the server, its 19
5//! tools, the config contract and the embedded Ghidra worker all live in the
6//! shared `ghidra-mcp` crate. What this binary contributes is the Antigravity-shaped part —
7//! reading `.agents/re-ghidra-mcp-agy.local.md` as the lowest config layer.
8
9#[tokio::main]
10async fn main() {
11    let args: Vec<String> = std::env::args().skip(1).collect();
12
13    // Antigravity launches MCP servers with the workspace as the working
14    // directory, so this is where the project's settings file lives.
15    let project_dir = std::env::current_dir().unwrap_or_default();
16    let file_config = re_ghidra_mcp_agy::load_settings(&project_dir);
17
18    let code = ghidra_mcp::cli::dispatch(
19        env!("CARGO_BIN_NAME"),
20        env!("CARGO_PKG_VERSION"),
21        args,
22        file_config,
23    )
24    .await;
25    if code != 0 {
26        std::process::exit(code);
27    }
28}