Skip to content

fix(mcp): restore Context7 client tool proxying under Spring AI 2.0 #201

fix(mcp): restore Context7 client tool proxying under Spring AI 2.0

fix(mcp): restore Context7 client tool proxying under Spring AI 2.0 #201

Workflow file for this run

name: Build and Publish Multi-Architecture Docker Image
on:
push:
branches: [main, develop]
tags: ["v*"]
pull_request:
branches: [main]
env:
DOCKER_HUB_REPOSITORY: arvindand/maven-tools-mcp
jobs:
build-amd64:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java 25
uses: actions/setup-java@v4
with:
java-version: "25"
distribution: "temurin"
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-amd64-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-amd64-m2
- name: Make mvnw executable
run: chmod +x ./mvnw
- name: Build with Maven
run: ./mvnw clean package -DskipTests
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push AMD64 images (with and without Context7)
run: |
PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout 2>/dev/null || echo "3.0.1")
# Build AMD64 native image WITH Context7
SPRING_PROFILES_ACTIVE=docker ./mvnw -Pnative spring-boot:build-image \
-Dspring-boot.build-image.imageName=arvindand/maven-tools-mcp:${PROJECT_VERSION}-amd64 \
-Dspring-boot.build-image.env.BP_NATIVE_IMAGE_BUILD_ARGUMENTS="-march=x86-64-v2 --no-fallback" \
-Dspring-boot.build-image.createdDate=now \
-Dspring-boot.build-image.publish=true \
-Ddocker.publishRegistry.username="${{ secrets.DOCKER_HUB_USERNAME }}" \
-Ddocker.publishRegistry.password="${{ secrets.DOCKER_HUB_TOKEN }}"
# Build AMD64 native image WITHOUT Context7 (noc7 variant)
SPRING_PROFILES_ACTIVE=docker,no-context7 ./mvnw -Pnative spring-boot:build-image \
-Dspring-boot.build-image.imageName=arvindand/maven-tools-mcp:${PROJECT_VERSION}-noc7-amd64 \
-Dspring-boot.build-image.env.BP_NATIVE_IMAGE_BUILD_ARGUMENTS="-march=x86-64-v2 --no-fallback" \
-Dspring-boot.build-image.createdDate=now \
-Dspring-boot.build-image.publish=true \
-Ddocker.publishRegistry.username="${{ secrets.DOCKER_HUB_USERNAME }}" \
-Ddocker.publishRegistry.password="${{ secrets.DOCKER_HUB_TOKEN }}"
# Build AMD64 native image with HTTP transport
SPRING_PROFILES_ACTIVE=http ./mvnw -Pnative spring-boot:build-image \
-Dspring-boot.build-image.imageName=arvindand/maven-tools-mcp:${PROJECT_VERSION}-http-amd64 \
-Dspring-boot.build-image.env.BP_NATIVE_IMAGE_BUILD_ARGUMENTS="-march=x86-64-v2 --no-fallback" \
-Dspring-boot.build-image.createdDate=now \
-Dspring-boot.build-image.publish=true \
-Ddocker.publishRegistry.username="${{ secrets.DOCKER_HUB_USERNAME }}" \
-Ddocker.publishRegistry.password="${{ secrets.DOCKER_HUB_TOKEN }}"
build-arm64:
runs-on: ubuntu-24.04-arm # Free ARM64 runners for public repos
if: github.event_name != 'pull_request'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java 25
uses: actions/setup-java@v4
with:
java-version: "25"
distribution: "temurin"
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-arm64-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-arm64-m2
- name: Make mvnw executable
run: chmod +x ./mvnw
- name: Build with Maven
run: ./mvnw clean package -DskipTests
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push ARM64 images (with and without Context7)
run: |
PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout 2>/dev/null || echo "3.0.1")
# Build ARM64 native image WITH Context7
SPRING_PROFILES_ACTIVE=docker ./mvnw -Pnative spring-boot:build-image \
-Dspring-boot.build-image.imageName=arvindand/maven-tools-mcp:${PROJECT_VERSION}-arm64 \
-Dspring-boot.build-image.createdDate=now \
-Dspring-boot.build-image.publish=true \
-Ddocker.publishRegistry.username="${{ secrets.DOCKER_HUB_USERNAME }}" \
-Ddocker.publishRegistry.password="${{ secrets.DOCKER_HUB_TOKEN }}"
# Build ARM64 native image WITHOUT Context7 (noc7 variant)
SPRING_PROFILES_ACTIVE=docker,no-context7 ./mvnw -Pnative spring-boot:build-image \
-Dspring-boot.build-image.imageName=arvindand/maven-tools-mcp:${PROJECT_VERSION}-noc7-arm64 \
-Dspring-boot.build-image.createdDate=now \
-Dspring-boot.build-image.publish=true \
-Ddocker.publishRegistry.username="${{ secrets.DOCKER_HUB_USERNAME }}" \
-Ddocker.publishRegistry.password="${{ secrets.DOCKER_HUB_TOKEN }}"
# Build ARM64 native image with HTTP transport
SPRING_PROFILES_ACTIVE=http ./mvnw -Pnative spring-boot:build-image \
-Dspring-boot.build-image.imageName=arvindand/maven-tools-mcp:${PROJECT_VERSION}-http-arm64 \
-Dspring-boot.build-image.createdDate=now \
-Dspring-boot.build-image.publish=true \
-Ddocker.publishRegistry.username="${{ secrets.DOCKER_HUB_USERNAME }}" \
-Ddocker.publishRegistry.password="${{ secrets.DOCKER_HUB_TOKEN }}"
create-manifest:
runs-on: ubuntu-latest
needs: [build-amd64, build-arm64]
if: github.event_name != 'pull_request'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Make mvnw executable
run: chmod +x ./mvnw
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Create and push multi-architecture manifests
run: |
PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout 2>/dev/null || echo "3.0.1")
# Create multi-architecture manifest for version tag (WITH Context7)
docker manifest create arvindand/maven-tools-mcp:${PROJECT_VERSION} \
--amend arvindand/maven-tools-mcp:${PROJECT_VERSION}-amd64 \
--amend arvindand/maven-tools-mcp:${PROJECT_VERSION}-arm64
docker manifest push arvindand/maven-tools-mcp:${PROJECT_VERSION}
# Create multi-architecture manifest for latest tag (WITH Context7)
docker manifest create arvindand/maven-tools-mcp:latest \
--amend arvindand/maven-tools-mcp:${PROJECT_VERSION}-amd64 \
--amend arvindand/maven-tools-mcp:${PROJECT_VERSION}-arm64
docker manifest push arvindand/maven-tools-mcp:latest
# Create multi-architecture manifest for noc7 version tag (WITHOUT Context7)
docker manifest create arvindand/maven-tools-mcp:${PROJECT_VERSION}-noc7 \
--amend arvindand/maven-tools-mcp:${PROJECT_VERSION}-noc7-amd64 \
--amend arvindand/maven-tools-mcp:${PROJECT_VERSION}-noc7-arm64
docker manifest push arvindand/maven-tools-mcp:${PROJECT_VERSION}-noc7
# Create multi-architecture manifest for latest-noc7 tag (WITHOUT Context7)
docker manifest create arvindand/maven-tools-mcp:latest-noc7 \
--amend arvindand/maven-tools-mcp:${PROJECT_VERSION}-noc7-amd64 \
--amend arvindand/maven-tools-mcp:${PROJECT_VERSION}-noc7-arm64
docker manifest push arvindand/maven-tools-mcp:latest-noc7
# Create multi-architecture manifest for http version tag (HTTP transport)
docker manifest create arvindand/maven-tools-mcp:${PROJECT_VERSION}-http \
--amend arvindand/maven-tools-mcp:${PROJECT_VERSION}-http-amd64 \
--amend arvindand/maven-tools-mcp:${PROJECT_VERSION}-http-arm64
docker manifest push arvindand/maven-tools-mcp:${PROJECT_VERSION}-http
# Create multi-architecture manifest for latest-http tag (HTTP transport)
docker manifest create arvindand/maven-tools-mcp:latest-http \
--amend arvindand/maven-tools-mcp:${PROJECT_VERSION}-http-amd64 \
--amend arvindand/maven-tools-mcp:${PROJECT_VERSION}-http-arm64
docker manifest push arvindand/maven-tools-mcp:latest-http
test-pr:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java 25
uses: actions/setup-java@v4
with:
java-version: "25"
distribution: "temurin"
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Make mvnw executable
run: chmod +x ./mvnw
- name: Build and test PR
run: |
./mvnw clean package -DskipTests
# Build with Context7 (default)
SPRING_PROFILES_ACTIVE=docker ./mvnw -Pnative spring-boot:build-image \
-Dspring-boot.build-image.imageName=maven-tools-mcp:pr-${{ github.event.number }} \
-Dspring-boot.build-image.createdDate=now
# Build without Context7 (noc7 variant)
SPRING_PROFILES_ACTIVE=docker,no-context7 ./mvnw -Pnative spring-boot:build-image \
-Dspring-boot.build-image.imageName=maven-tools-mcp:pr-${{ github.event.number }}-noc7 \
-Dspring-boot.build-image.createdDate=now
# Build with HTTP transport
SPRING_PROFILES_ACTIVE=http ./mvnw -Pnative spring-boot:build-image \
-Dspring-boot.build-image.imageName=maven-tools-mcp:pr-${{ github.event.number }}-http \
-Dspring-boot.build-image.createdDate=now
# Test all images
echo "Testing image with Context7..."
timeout 30s docker run --rm maven-tools-mcp:pr-${{ github.event.number }} --help || true
echo "Testing image without Context7..."
timeout 30s docker run --rm maven-tools-mcp:pr-${{ github.event.number }}-noc7 --help || true
echo "Testing HTTP transport image..."
timeout 30s docker run --rm -d -p 8080:8080 --name http-test maven-tools-mcp:pr-${{ github.event.number }}-http || true
sleep 5
curl -s http://localhost:8080/actuator/health/liveness || true
docker stop http-test || true