github-mcp 0.1.3

GitHub v3 REST API MCP server, generated by mcpify.
Documentation
// GitHub v3 REST API MCP server — generated by mcpify. Do not hand-edit.
//
// v8 multi-version support: lists the OpenAPI spec versions this project
// currently has a store for (added at `generate`/`mcpify add-version` time),
// showing which is the default/latest and which is active for this process.

use github_mcp::core::config_manager::load_config;

struct VersionRow {
    label: &'static str,
    is_default: bool,
}

// mcpify:versions:begin
const KNOWN_VERSIONS: &[VersionRow] = &[
    VersionRow {
        label: "gh-2026-03-10",
        is_default: true,
    },
    VersionRow {
        label: "ghec-2026-03-10",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.21",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.20",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.19",
        is_default: false,
    },
    VersionRow {
        label: "ghes-2.22",
        is_default: false,
    },
];
// mcpify:versions:end

pub fn run() -> anyhow::Result<()> {
    let active_version = load_config(serde_json::Map::new())
        .map(|config| config.api_version)
        .unwrap_or_default();

    for row in KNOWN_VERSIONS {
        let mut markers = Vec::new();
        if row.is_default {
            markers.push("default");
        }
        if row.label == active_version {
            markers.push("active");
        }
        if markers.is_empty() {
            println!("{}", row.label);
        } else {
            println!("{} ({})", row.label, markers.join(", "));
        }
    }
    Ok(())
}