github-mcp 0.1.0

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-3.18",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.17",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.16",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.15",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.14",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.13",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.12",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.11",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.10",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.9",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.8",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.7",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.6",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.5",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.4",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.3",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.2",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.1",
        is_default: false,
    },
    VersionRow {
        label: "ghes-3.0",
        is_default: false,
    },
    VersionRow {
        label: "ghes-2.22",
        is_default: false,
    },
    VersionRow {
        label: "ghes-2.21",
        is_default: false,
    },
    VersionRow {
        label: "ghes-2.20",
        is_default: false,
    },
    VersionRow {
        label: "ghes-2.19",
        is_default: false,
    },
    VersionRow {
        label: "ghes-2.18",
        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(())
}