Skip to main content
Glama

CRM Employee Management MCP Server

dev-live.sh12.3 kB
#!/bin/bash # MCP Development Environment Launcher # Starts all four services (Mock Backend, Gateway, CRM MCP Server, Inspector) in separate terminal windows # Author: Gurkan Fikret Gunak set -e # Colors for output RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' CYAN='\033[0;36m' NC='\033[0m' # No Color # Get the script directory SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$SCRIPT_DIR" echo "" echo -e "${CYAN}╔══════════════════════════════════════════════════════════════╗${NC}" echo -e "${CYAN}║ MCP Development Environment - Starting All Services ║${NC}" echo -e "${CYAN}╚══════════════════════════════════════════════════════════════╝${NC}" echo "" # Function to check if a port is in use check_port() { if lsof -Pi :$1 -sTCP:LISTEN -t >/dev/null 2>&1 ; then return 0 else return 1 fi } # Function to wait for a service to be ready wait_for_service() { local url=$1 local service_name=$2 local max_attempts=30 local attempt=0 echo -e "${YELLOW}Waiting for $service_name to be ready...${NC}" while [ $attempt -lt $max_attempts ]; do if curl -s "$url" > /dev/null 2>&1; then echo -e "${GREEN}✓ $service_name is ready!${NC}" return 0 fi attempt=$((attempt + 1)) sleep 1 done echo -e "${RED}✗ $service_name failed to start${NC}" return 1 } # Check if ports are already in use echo -e "${BLUE}Checking ports...${NC}" if check_port 8081; then echo -e "${YELLOW}⚠ Port 8081 is already in use (Mock Backend)${NC}" fi if check_port 8080; then echo -e "${YELLOW}⚠ Port 8080 is already in use (Gateway)${NC}" fi if check_port 3000; then echo -e "${YELLOW}⚠ Port 3000 is already in use (Inspector)${NC}" fi if check_port 8083; then echo -e "${YELLOW}⚠ Port 8083 is already in use (CRM MCP Server)${NC}" fi echo "" # Check dependencies echo -e "${BLUE}Checking dependencies...${NC}" # Check Python if command -v python3 &> /dev/null; then PYTHON_CMD=python3 echo -e "${GREEN}✓ Python3 found${NC}" elif command -v python &> /dev/null; then PYTHON_CMD=python echo -e "${GREEN}✓ Python found${NC}" else echo -e "${RED}✗ Python is not installed${NC}" exit 1 fi # Check Node.js if command -v node &> /dev/null; then echo -e "${GREEN}✓ Node.js found ($(node --version))${NC}" else echo -e "${RED}✗ Node.js is not installed${NC}" exit 1 fi # Check npm if command -v npm &> /dev/null; then echo -e "${GREEN}✓ npm found ($(npm --version))${NC}" else echo -e "${RED}✗ npm is not installed${NC}" exit 1 fi echo "" # Detect OS OS="$(uname -s)" case "${OS}" in Linux*) MACHINE=Linux;; Darwin*) MACHINE=Mac;; CYGWIN*) MACHINE=Cygwin;; MINGW*) MACHINE=MinGw;; *) MACHINE="UNKNOWN:${OS}" esac echo -e "${BLUE}Detected OS: ${MACHINE}${NC}" echo "" # Start Mock Backend echo -e "${CYAN}[1/3] Starting Mock Backend on port 8081...${NC}" if [ "$MACHINE" = "Mac" ]; then osascript -e "tell application \"Terminal\" to do script \"cd '$SCRIPT_DIR' && echo '╔══════════════════════════════════════════════════════════════╗' && echo '║ Mock Backend Server (Port 8081) ║' && echo '╚══════════════════════════════════════════════════════════════╝' && echo '' && echo 'Starting Mock Backend...' && echo 'Health Check: http://localhost:8081/health' && echo 'GraphQL Endpoint: http://localhost:8081/graphql' && echo '' && python3 mock_backend.py\"" elif [ "$MACHINE" = "Linux" ]; then gnome-terminal -- bash -c "cd '$SCRIPT_DIR' && echo '╔══════════════════════════════════════════════════════════════╗' && echo '║ Mock Backend Server (Port 8081) ║' && echo '╚══════════════════════════════════════════════════════════════╝' && echo '' && echo 'Starting Mock Backend...' && echo 'Health Check: http://localhost:8081/health' && echo 'GraphQL Endpoint: http://localhost:8081/graphql' && echo '' && python3 mock_backend.py; exec bash" & else echo -e "${YELLOW}⚠ Unsupported OS. Please start Mock Backend manually:${NC}" echo " python3 mock_backend.py" fi sleep 2 # Start Gateway echo -e "${CYAN}[2/3] Starting Gateway on port 8080...${NC}" if [ "$MACHINE" = "Mac" ]; then osascript -e "tell application \"Terminal\" to do script \"cd '$SCRIPT_DIR' && echo '╔══════════════════════════════════════════════════════════════╗' && echo '║ MCP Gateway Server (Port 8080) ║' && echo '╚══════════════════════════════════════════════════════════════╝' && echo '' && echo 'Starting Gateway...' && echo 'API Endpoint: http://localhost:8080/graphql' && echo 'Health Check: http://localhost:8080/health' && echo 'Docs: http://localhost:8080/docs' && echo '' && uvicorn gateway.main:app --reload --host 0.0.0.0 --port 8080\"" elif [ "$MACHINE" = "Linux" ]; then gnome-terminal -- bash -c "cd '$SCRIPT_DIR' && echo '╔══════════════════════════════════════════════════════════════╗' && echo '║ MCP Gateway Server (Port 8080) ║' && echo '╚══════════════════════════════════════════════════════════════╝' && echo '' && echo 'Starting Gateway...' && echo 'API Endpoint: http://localhost:8080/graphql' && echo 'Health Check: http://localhost:8080/health' && echo 'Docs: http://localhost:8080/docs' && echo '' && uvicorn gateway.main:app --reload --host 0.0.0.0 --port 8080; exec bash" & else echo -e "${YELLOW}⚠ Unsupported OS. Please start Gateway manually:${NC}" echo " uvicorn gateway.main:app --reload --host 0.0.0.0 --port 8080" fi sleep 2 # Start CRM MCP Server echo -e "${CYAN}[3/4] Starting CRM MCP Server on port 8083...${NC}" if [ "$MACHINE" = "Mac" ]; then osascript -e "tell application \"Terminal\" to do script \"cd '$SCRIPT_DIR' && echo '╔══════════════════════════════════════════════════════════════╗' && echo '║ CRM Employee Management MCP Server (Port 8083) ║' && echo '╚══════════════════════════════════════════════════════════════╝' && echo '' && echo 'Starting CRM MCP Server...' && echo 'Health Check: http://localhost:8083/health' && echo 'API Endpoint: http://localhost:8083/api/employees' && echo '' && python3 crm_mcp_server.py\"" elif [ "$MACHINE" = "Linux" ]; then gnome-terminal -- bash -c "cd '$SCRIPT_DIR' && echo '╔══════════════════════════════════════════════════════════════╗' && echo '║ CRM Employee Management MCP Server (Port 8083) ║' && echo '╚══════════════════════════════════════════════════════════════╝' && echo '' && echo 'Starting CRM MCP Server...' && echo 'Health Check: http://localhost:8083/health' && echo 'API Endpoint: http://localhost:8083/api/employees' && echo '' && python3 crm_mcp_server.py; exec bash" & else echo -e "${YELLOW}⚠ Unsupported OS. Please start CRM MCP Server manually:${NC}" echo " python3 crm_mcp_server.py" fi sleep 2 # Start Inspector echo -e "${CYAN}[4/4] Starting Inspector on port 3000...${NC}" if [ "$MACHINE" = "Mac" ]; then osascript -e "tell application \"Terminal\" to do script \"cd '$SCRIPT_DIR/inspector' && echo '╔══════════════════════════════════════════════════════════════╗' && echo '║ MCP Inspector (Port 3000) ║' && echo '╚══════════════════════════════════════════════════════════════╝' && echo '' && echo 'Starting Inspector...' && echo 'Web UI: http://localhost:3000' && echo '' && npm run dev\"" elif [ "$MACHINE" = "Linux" ]; then gnome-terminal -- bash -c "cd '$SCRIPT_DIR/inspector' && echo '╔══════════════════════════════════════════════════════════════╗' && echo '║ MCP Inspector (Port 3000) ║' && echo '╚══════════════════════════════════════════════════════════════╝' && echo '' && echo 'Starting Inspector...' && echo 'Web UI: http://localhost:3000' && echo '' && npm run dev; exec bash" & else echo -e "${YELLOW}⚠ Unsupported OS. Please start Inspector manually:${NC}" echo " cd inspector && npm run dev" fi sleep 3 echo "" echo -e "${GREEN}╔══════════════════════════════════════════════════════════════╗${NC}" echo -e "${GREEN}║ All Services Started Successfully! ║${NC}" echo -e "${GREEN}╚══════════════════════════════════════════════════════════════╝${NC}" echo "" echo -e "${CYAN}Service URLs:${NC}" echo -e " ${BLUE}Mock Backend:${NC} http://localhost:8081" echo -e " ${BLUE}Gateway:${NC} http://localhost:8080" echo -e " ${BLUE}CRM MCP Server:${NC} http://localhost:8083" echo -e " ${BLUE}Inspector:${NC} http://localhost:3000" echo "" echo -e "${CYAN}Useful Endpoints:${NC}" echo -e " ${BLUE}Gateway Health:${NC} http://localhost:8080/health" echo -e " ${BLUE}Gateway Docs:${NC} http://localhost:8080/docs" echo -e " ${BLUE}Backend Health:${NC} http://localhost:8081/health" echo -e " ${BLUE}CRM Health:${NC} http://localhost:8083/health" echo -e " ${BLUE}CRM Employees:${NC} http://localhost:8083/api/employees" echo "" echo -e "${YELLOW}Note:${NC} Each service is running in a separate terminal window." echo -e "${YELLOW} ${NC}Close the terminal windows to stop the services." echo "" echo -e "${CYAN}═══════════════════════════════════════════════════════════════${NC}" echo -e "${CYAN}Author: Gurkan Fikret Gunak${NC}" echo -e "${CYAN}═══════════════════════════════════════════════════════════════${NC}" echo ""

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/gurkanfikretgunak/mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server