# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           npm 1.0

name                mcp-inspector
version             2.2.0
revision            0

categories          llm
maintainers         {breun @breun} openmaintainer
license             Apache-2
supported_archs     x86_64 arm64

description         The MCP inspector is a developer tool for testing and debugging MCP servers
long_description    The MCP inspector is a developer tool for testing and debugging MCP servers

homepage            https://modelcontextprotocol.io/docs/tools/inspector

npm.rootname        @modelcontextprotocol/inspector
distname            inspector-${version}

checksums           rmd160  9cebb2b691740056b72fc45e9f45f8fd7febc9f7 \
                    sha256  0604ec5f00eee023f9821f372462f6ed76e39c6b9c8edb50661e7f61c4c9e6e3 \
                    size    1244322

post-destroot {
    set node_modules_dir ${destroot}${prefix}/lib/node_modules/${npm.rootname}/node_modules

    # Remove binaries for other operating systems
    if {${os.platform} ne "darwin"} {
        delete {*}[glob ${node_modules_dir}/@oven/bun-darwin-*]
        delete {*}[glob ${node_modules_dir}/@rollup/rollup-darwin-*]
    }
    if {${os.platform} ne "windows"} {
        delete ${node_modules_dir}/spawn-rx/vendor/jobber/Jobber.exe
    }

    # Remove binaries for other CPU architectures
    if {${configure.build_arch} ne "arm64"} {
        delete ${node_modules_dir}/@oven/bun-darwin-aarch64
        delete ${node_modules_dir}/@rollup/rollup-darwin-arm64
    }
}
