We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/croit/mcp-croit-ceph'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
variables:
DOCKER_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
DOCKERHUB_IMAGE: croit/mcp-croit-ceph
# Version should match server.json
MCP_VERSION: "0.4.1"
.docker-image:
tags:
- docker-builder
image: docker:stable
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
stages:
- lint
- build
- publish
lint:python:
stage: lint
image: python:3.9-slim
before_script:
- pip install black
script:
- black --check --diff .
build:mcp-croit-ceph:
stage: build
extends:
- .docker-image
script:
# Build image
- docker build -t $DOCKER_IMAGE .
# Push to GitLab registry
- docker push $DOCKER_IMAGE
# Also push to Docker Hub with proper tags
- |
if [ -n "$DOCKERHUB_USER" ] && [ -n "$DOCKERHUB_PASSWORD" ]; then
echo "Attempting Docker Hub login..."
echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USER" --password-stdin 2>/dev/null || {
echo "Warning: Docker Hub login failed. Please check DOCKERHUB_USER and DOCKERHUB_PASSWORD variables."
echo "Continuing pipeline without Docker Hub push..."
exit 0
}
echo "Docker Hub login successful, pushing images..."
# Tag and push with version
docker tag $DOCKER_IMAGE $DOCKERHUB_IMAGE:$MCP_VERSION
docker push $DOCKERHUB_IMAGE:$MCP_VERSION
echo "Pushed: $DOCKERHUB_IMAGE:$MCP_VERSION"
# Also push as latest
docker tag $DOCKER_IMAGE $DOCKERHUB_IMAGE:latest
docker push $DOCKERHUB_IMAGE:latest
echo "Pushed: $DOCKERHUB_IMAGE:latest"
# If this is a tag, also use the tag name
if [ -n "$CI_COMMIT_TAG" ]; then
docker tag $DOCKER_IMAGE $DOCKERHUB_IMAGE:$CI_COMMIT_TAG
docker push $DOCKERHUB_IMAGE:$CI_COMMIT_TAG
echo "Pushed: $DOCKERHUB_IMAGE:$CI_COMMIT_TAG"
fi
else
echo "Docker Hub credentials not configured (DOCKERHUB_USER and/or DOCKERHUB_PASSWORD missing)"
echo "Skipping Docker Hub push..."
fi
after_script:
- docker rmi -f $DOCKER_IMAGE
publish:mcp-registry:
stage: publish
image: ubuntu:latest
only:
# Only run on tags or manual trigger
- tags
- web
allow_failure: true # Don't fail the whole pipeline if MCP publishing fails
script:
# Install dependencies
- apt-get update && apt-get install -y curl ca-certificates jq
# First check if Docker image is available on Docker Hub
- |
echo "Checking if Docker image is available on Docker Hub..."
DOCKER_HUB_CHECK=$(curl -s "https://hub.docker.com/v2/repositories/$DOCKERHUB_IMAGE/tags/$MCP_VERSION" | jq -r '.name' 2>/dev/null || echo "")
if [ "$DOCKER_HUB_CHECK" != "$MCP_VERSION" ]; then
echo "Error: Docker image $DOCKERHUB_IMAGE:$MCP_VERSION not found on Docker Hub"
echo "Please ensure Docker Hub credentials are correct and the image was pushed successfully"
exit 1
fi
echo "Docker image found on Docker Hub: $DOCKERHUB_IMAGE:$MCP_VERSION"
# Download MCP publisher
- |
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_linux_amd64.tar.gz" | tar xz mcp-publisher
chmod +x mcp-publisher
./mcp-publisher --version
# Validate server.json exists
- |
if [ ! -f "server.json" ]; then
echo "Error: server.json not found"
exit 1
fi
echo "Found server.json:"
cat server.json
# Login to MCP Registry
# For GitLab CI, we need to use GitHub token authentication
- |
if [ -n "$MCP_GITHUB_TOKEN" ]; then
echo "Using GitHub token authentication..."
export GITHUB_TOKEN="$MCP_GITHUB_TOKEN"
./mcp-publisher login github
else
echo "Error: MCP_GITHUB_TOKEN not configured"
echo "Please set MCP_GITHUB_TOKEN as a CI/CD variable with a GitHub personal access token"
echo "The token needs 'public_repo' scope for the croit organization"
exit 1
fi
# Publish to MCP Registry
- |
echo "Publishing to MCP Registry..."
./mcp-publisher publish --verbose
artifacts:
reports:
dotenv: publish.env
paths:
- publish.log
when: always