sqlserver-mcp 0.4.1

SQL Server 2025/2022/2019/2017 - master/msdb/sandbox combined catalog MCP server, generated by mcpify.
Documentation
// SQL Server 2025 - master/msdb/sandbox combined catalog 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 sqlserver_mcp_catalog::core::config_manager::load_config;

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

// mcpify:versions:begin
const KNOWN_VERSIONS: &[VersionRow] = &[
    VersionRow {
        label: "2025",
        is_default: true,
    },
    VersionRow {
        label: "2022",
        is_default: false,
    },
    VersionRow {
        label: "2019",
        is_default: false,
    },
    VersionRow {
        label: "2017",
        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(())
}