#!/bin/bash
# Context-Pods Meta-MCP Server Development Script
# Starts the server in development mode with hot reloading
set -e
echo "๐ ๏ธ Starting Context-Pods Meta-MCP Server in development mode..."
# Get script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
echo "๐ Project root: $PROJECT_ROOT"
# Change to project root
cd "$PROJECT_ROOT"
# Install dependencies if needed
if [ ! -d "node_modules" ]; then
echo "๐ฆ Installing dependencies..."
npm install
fi
# Initial build
echo "๐จ Building packages..."
npm run build
echo ""
echo "๐ ๏ธ Development mode features:"
echo " โข TypeScript compilation in watch mode"
echo " โข Server restart on file changes"
echo " โข Debug logging enabled"
echo " โข Source maps for debugging"
echo ""
echo "๐ The server will restart automatically when you make changes."
echo "๐ See docs/MCP_CLIENT_SETUP.md for configuration instructions."
echo ""
echo "Press Ctrl+C to stop the development server."
echo ""
# Set development environment variables
export NODE_ENV=development
export DEBUG=context-pods:*
# Function to start the server
start_server() {
echo "๐ Starting server..."
node packages/server/dist/src/index.js &
SERVER_PID=$!
echo "๐ก Server started with PID: $SERVER_PID"
}
# Function to stop the server
stop_server() {
if [ ! -z "$SERVER_PID" ]; then
echo "๐ Stopping server (PID: $SERVER_PID)..."
kill $SERVER_PID 2>/dev/null || true
wait $SERVER_PID 2>/dev/null || true
SERVER_PID=""
fi
}
# Function to restart the server
restart_server() {
echo "๐ Restarting server..."
stop_server
start_server
}
# Cleanup function
cleanup() {
echo ""
echo "๐งน Cleaning up..."
stop_server
# Kill the TypeScript compiler if it's running
if [ ! -z "$TSC_PID" ]; then
kill $TSC_PID 2>/dev/null || true
fi
echo "โ Development server stopped."
exit 0
}
# Set up signal handlers
trap cleanup SIGINT SIGTERM
# Start TypeScript compiler in watch mode
echo "๐ Starting TypeScript compiler in watch mode..."
npm run --workspace=packages/server dev &
TSC_PID=$!
# Wait for initial compilation
echo "โณ Waiting for initial compilation..."
sleep 3
# Start the server initially
start_server
# Monitor for file changes and restart server
echo "๐ Watching for changes..."
# Simple file watcher - restart server when dist files change
while true; do
# Check if dist files have been modified recently (within last 2 seconds)
RECENT_FILES=$(find packages/server/dist/src -name "*.js" -newermt "2 seconds ago" 2>/dev/null | wc -l)
if [ "$RECENT_FILES" -gt 0 ]; then
restart_server
fi
sleep 2
done
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/conorluddy/ContextPods'
If you have feedback or need assistance with the MCP directory API, please join our Discord server