rust-mcp-server 0.2.4

An MCP server for Rust development
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::process::Command;

fn main() {
    let hash = Command::new("git")
        .args(["rev-parse", "--short", "HEAD"])
        .output();

    if let Ok(hash) = hash {
        if let Ok(hash_str) = String::from_utf8(hash.stdout) {
            let trimmed_hash = hash_str.trim();
            println!("cargo:rustc-env=GIT_HASH={trimmed_hash}");
        } else {
            eprintln!("Failed to convert git hash output to string");
        }
    } else {
        eprintln!("Failed to execute git command");
    }
}