We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/horodchukanton/gitlab-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
run.sh•1.61 KiB
#!/bin/bash
# GitLab MCP Server startup script
# Can be used from the project directory or as an installed package
set -e
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Check if we're running from the gitlab-mcp project directory
if [ -f "$SCRIPT_DIR/.env" ]; then
# Load .env from project directory
export $(grep -v '^#' "$SCRIPT_DIR/.env" | xargs 2>/dev/null || true)
fi
# Check if .env file exists (either in project or current directory)
if [ -z "$GITLAB_URL" ] && [ ! -f .env ]; then
echo "Error: GITLAB_URL not configured"
echo ""
echo "Configuration options:"
echo " 1. Set environment variables: GITLAB_URL and GITLAB_TOKEN"
echo " 2. Create a .env file in the current directory"
echo " 3. Use .env file in the gitlab-mcp project directory"
echo ""
echo "Example .env file:"
echo " GITLAB_URL=https://your-gitlab-instance.com"
echo " GITLAB_TOKEN=glpat-xxx"
exit 1
fi
# Load .env from current directory if it exists
if [ -f .env ] && [ "$SCRIPT_DIR" != "$(pwd)" ]; then
export $(grep -v '^#' .env | xargs 2>/dev/null || true)
fi
# Activate virtual environment if it exists in the project directory
if [ -d "$SCRIPT_DIR/.venv" ]; then
source "$SCRIPT_DIR/.venv/bin/activate"
fi
# Install dependencies if running from project directory
if [ "$SCRIPT_DIR" = "$(pwd)" ]; then
if ! python -c "import fastmcp" 2>/dev/null; then
echo "Installing dependencies..."
pip install -r "$SCRIPT_DIR/requirements.txt"
fi
fi
# Run the server
echo "Starting GitLab MCP server..."
python -m src.server