#!/bin/bash
# =============================================================================
# Jina Web Search MCP Server - Linux/macOS Bash Startup Script
# =============================================================================
# This script builds and starts the MCP server using Docker Compose
#
# Prerequisites:
# - Docker installed and running
# - docker-compose available
# - Optional: .env file with JINA_API_KEY configured
#
# Usage:
# chmod +x run.sh
# ./run.sh
# =============================================================================
# Exit on any error
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
MAGENTA='\033[0;35m'
BOLD='\033[1m'
NC='\033[0m' # No Color
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Function to check if Docker is running
docker_running() {
docker info >/dev/null 2>&1
}
echo -e "${CYAN}============================================================${NC}"
echo -e "${CYAN}${BOLD} Jina Web Search MCP Server - Starting Up${NC}"
echo -e "${CYAN}============================================================${NC}"
echo ""
# Check prerequisites
echo -e "${YELLOW}[0/3] Checking prerequisites...${NC}"
if ! command_exists docker; then
echo -e "${RED}ERROR: Docker is not installed or not in PATH${NC}"
echo -e "${RED}Please install Docker and try again${NC}"
echo -e "${RED}Visit: https://docs.docker.com/get-docker/${NC}"
exit 1
fi
if ! docker_running; then
echo -e "${RED}ERROR: Docker is not running${NC}"
echo -e "${RED}Please start Docker and try again${NC}"
exit 1
fi
if ! command_exists docker-compose; then
echo -e "${RED}ERROR: docker-compose is not installed or not in PATH${NC}"
echo -e "${RED}Please install docker-compose and try again${NC}"
echo -e "${RED}Visit: https://docs.docker.com/compose/install/${NC}"
exit 1
fi
echo -e "${GREEN}✓ All prerequisites met${NC}"
echo ""
# Build Docker image
echo -e "${GREEN}[1/3] Building Jina MCP Server Docker image...${NC}"
if docker build -t jina-mcp-server .; then
echo -e "${GREEN}✓ Docker image built successfully${NC}"
else
echo -e "${RED}ERROR: Failed to build Docker image${NC}"
exit 1
fi
echo ""
# Start services
echo -e "${GREEN}[2/3] Starting Jina MCP Server with Docker Compose...${NC}"
if docker-compose up -d; then
echo -e "${GREEN}✓ Services started successfully${NC}"
else
echo -e "${RED}ERROR: Failed to start services${NC}"
exit 1
fi
echo ""
# Display completion information
echo -e "${GREEN}[3/3] Server startup complete!${NC}"
echo -e "${CYAN}============================================================${NC}"
echo -e "${CYAN}${BOLD} MCP Server Information${NC}"
echo -e "${CYAN}============================================================${NC}"
echo -e " ${BOLD}Status:${NC} ${YELLOW}Starting up (may take 30-60 seconds)${NC}"
echo -e " ${BOLD}URL:${NC} ${CYAN}http://localhost:5003${NC}"
echo -e " ${BOLD}Logs:${NC} ${YELLOW}docker-compose logs -f${NC}"
echo -e " ${BOLD}Stop:${NC} ${YELLOW}docker-compose down${NC}"
echo -e "${CYAN}============================================================${NC}"
echo ""
echo -e "${MAGENTA}💡 Tip: Set your JINA_API_KEY in .env file for production use${NC}"
echo ""
# Option to view logs
read -p "Would you like to view the server logs now? (y/N): " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo -e "${YELLOW}Starting log viewer... (Press Ctrl+C to exit)${NC}"
sleep 2
docker-compose logs -f
fi
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/hypersniper05/JinaWebSearchMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server