# -*- 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             1.0.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  85cf95f0fe200be72e6adfb239578e0f6a31b9e3 \
                    sha256  02684b5238eba62bf64cdd5cf3e9feb5d04a2feabf557c423a8298eb76ba66ea \
                    size    571566

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
    }
}
