# -*- 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.21.2
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  cf1b8397f3c0f242f701adb351b270453141f6b6 \
                    sha256  d61471788ac38eae204ed6c61a7ae3819eea4a7ed282611972b4108f6074a9ba \
                    size    566946

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