# -*- 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             0.20.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  c5a67104799ed09372e851b4593b2ac1430fb35a \
                    sha256  9288e465ba4be28523276841a5a2b2949c99acaeabe144b5e6e11ecbadc67a55 \
                    size    624009

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