We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/karanb192/hn-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
build-mcpb.sh•2.51 kB
#!/bin/bash
# Build script for creating Claude Desktop Extension (.mcpb file)
# Creates a clean bundle with manifest.json at root level
# Check if script is being run from repository root
if [ ! -f "package.json" ] || [ ! -d "src" ] || [ ! -f "manifest.json" ]; then
echo "❌ Error: This script must be run from the repository root!"
echo ""
echo "Current directory: $(pwd)"
echo ""
echo "Required files not found. Please cd to the repository root and run:"
echo " cd /path/to/hn-mcp"
echo " ./scripts/build-mcpb.sh"
echo ""
echo "The repository root should contain:"
echo " - package.json"
echo " - manifest.json"
echo " - src/ directory"
exit 1
fi
echo "🔨 Building HN-MCP Desktop Extension..."
# Check if dist folder exists, build if not
if [ ! -d "dist" ]; then
echo "📚 Building TypeScript (dist folder not found)..."
echo "📦 Installing all dependencies (including TypeScript)..."
npm install # This installs ALL dependencies including dev dependencies
echo "🔨 Compiling TypeScript..."
npm run build
# Verify build succeeded
if [ ! -d "dist" ]; then
echo "❌ Error: Build failed - dist folder still not found after npm run build"
echo "Try running these commands manually:"
echo " npm install"
echo " npm run build"
echo "And check for TypeScript compilation errors"
exit 1
fi
echo "✅ TypeScript compilation successful"
fi
# Clean up any previous builds
rm -f hn-mcp.mcpb
rm -rf bundle-temp
# Create temp directory
mkdir -p bundle-temp
cd bundle-temp
# Copy necessary files (manifest must be at root)
cp -r ../dist .
cp ../manifest.json .
cp ../package.json .
cp ../package-lock.json .
cp ../README.md .
# Install production dependencies only
echo "📦 Installing production dependencies..."
npm ci --production --silent
# Remove unnecessary files to reduce bundle size
rm -rf dist/**/*.map
rm -f package-lock.json
# Create .mcpb file (it's just a zip file with .mcpb extension)
echo "📦 Creating .mcpb bundle..."
zip -r ../hn-mcp.mcpb . -q
cd ..
rm -rf bundle-temp
# Verify the .mcpb was created
if [ -f "hn-mcp.mcpb" ]; then
SIZE=$(du -h hn-mcp.mcpb | cut -f1)
echo "✅ Successfully created hn-mcp.mcpb (${SIZE})"
echo ""
echo "📋 Bundle contents:"
unzip -l hn-mcp.mcpb | head -20
echo ""
echo "✅ Ready for distribution!"
else
echo "❌ Error: Failed to create hn-mcp.mcpb"
exit 1
fi