This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-mcp.git


The following commit(s) were added to refs/heads/main by this push:
     new 3b71d12  refactor: Fix jib build and docs (#13)
3b71d12 is described below

commit 3b71d122ae29156b02c9fbe65eeee1a31890ecde
Author: Aditya Parikh <[email protected]>
AuthorDate: Tue Nov 4 07:23:53 2025 -0500

    refactor: Fix jib build and docs (#13)
    
    * chore: bump Jib to 3.4.5 and update Docker-related README sections for 
clarity
    
    * Add Docker support with Jib and GitHub Actions CI/CD
    
    * test: add Docker integration tests for MCP server under both STDIO and 
HTTP modes
    
    * Add Docker support with Jib and GitHub Actions CI/CD
    
    * refactor: centralize build info retrieval logic and update tests and docs 
accordingly. remove buildTar instructions.
    
    * feat: configure Docker executable path for Jib with OS-specific defaults 
and customizability
    
    * feat: add MCP Registry publishing configuration and automation
    
    - Add server.json for MCP registry metadata
    - Add publish-mcp.yml GitHub Actions workflow for automated publishing
    - Add MCP label to Docker image for registry discovery
    - Uses GitHub OIDC for authentication (no secrets required)
    - Supports both STDIO and HTTP transport modes
---
 .github/workflows/publish-mcp.yml                  | 115 ++++++++++++++++
 README.md                                          | 149 +++------------------
 build.gradle.kts                                   |  41 +++++-
 gradle/libs.versions.toml                          |   2 +-
 server.json                                        |  54 ++++++++
 .../apache/solr/mcp/server/BuildInfoReader.java    | 105 +++++++++++++++
 .../org/apache/solr/mcp/server/ClientStdio.java    |  29 +---
 .../DockerImageHttpIntegrationTest.java            |  15 ++-
 .../DockerImageStdioIntegrationTest.java           |   9 +-
 9 files changed, 341 insertions(+), 178 deletions(-)

diff --git a/.github/workflows/publish-mcp.yml 
b/.github/workflows/publish-mcp.yml
new file mode 100644
index 0000000..40852d7
--- /dev/null
+++ b/.github/workflows/publish-mcp.yml
@@ -0,0 +1,115 @@
+# GitHub Actions Workflow: Publish to MCP Registry
+# ==================================================
+#
+# This workflow publishes the Solr MCP Server to the Model Context Protocol 
Registry.
+#
+# Workflow Triggers:
+# ------------------
+# - Version tags (v*) - Automatically publishes when you push tags like 
v0.1.0, v1.0.0, etc.
+#
+# Prerequisites:
+# --------------
+# 1. Docker images must be published to GHCR by the build-and-publish workflow
+# 2. The server.json file must be properly configured
+# 3. The Jib configuration must include the MCP annotation
+#
+# Authentication:
+# ---------------
+# Uses GitHub OIDC (no secrets required) for authentication with the MCP 
Registry.
+# This requires:
+# - id-token: write permission (already configured below)
+# - Repository must be public
+# - Namespace must be io.github.OWNER/*
+#
+# Usage:
+# ------
+# 1. Ensure all changes are committed and pushed
+# 2. Create and push a version tag:
+#    git tag v0.1.0
+#    git push origin v0.1.0
+# 3. The workflow will automatically publish to the MCP Registry
+
+name: Publish to MCP Registry
+
+on:
+  push:
+    tags:
+      - 'v*'  # Trigger on version tags like v0.1.0, v1.0.0, etc.
+  workflow_dispatch:  # Allow manual workflow runs from GitHub UI
+
+permissions:
+  id-token: write  # Required for OIDC authentication with MCP Registry
+  contents: read   # Required to read repository contents
+
+jobs:
+  publish:
+    name: Publish to MCP Registry
+    runs-on: ubuntu-latest
+
+    steps:
+      # Checkout the repository code
+      - name: Checkout code
+        uses: actions/checkout@v4
+
+      # Extract version from tag (remove 'v' prefix)
+      # Example: v1.0.0 -> 1.0.0
+      - name: Extract version
+        id: version
+        run: |
+          VERSION=${GITHUB_REF#refs/tags/v}
+          echo "version=$VERSION" >> $GITHUB_OUTPUT
+          echo "Publishing version: $VERSION"
+
+      # Update server.json version to match the tag
+      # This ensures the published version matches the Git tag
+      - name: Update server.json version
+        run: |
+          VERSION="${{ steps.version.outputs.version }}"
+          # Update main version field
+          jq --arg v "$VERSION" '.version = $v' server.json > server.json.tmp
+          # Update package version field
+          jq --arg v "$VERSION-SNAPSHOT" '.packages[0].version = $v' 
server.json.tmp > server.json
+          rm server.json.tmp
+          cat server.json
+
+      # Download the MCP Publisher CLI
+      # Fetches the latest release from GitHub
+      - name: Download MCP Publisher
+        run: |
+          curl -L 
https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher-linux-amd64.tar.gz
 | tar xz
+          chmod +x mcp-publisher
+          ./mcp-publisher --version
+
+      # Authenticate with MCP Registry using GitHub OIDC
+      # No secrets required - uses GitHub's built-in OIDC token
+      - name: Authenticate with MCP Registry
+        run: |
+          ./mcp-publisher login github-oidc
+
+      # Publish the server to the MCP Registry
+      # This makes the server discoverable by MCP clients
+      - name: Publish to MCP Registry
+        run: |
+          ./mcp-publisher publish
+
+      # Verify the server was published successfully
+      # Query the registry to confirm the server is available
+      - name: Verify publication
+        run: |
+          echo "Waiting 10 seconds for registry to update..."
+          sleep 10
+          echo "Querying registry for published server..."
+          curl 
"https://registry.modelcontextprotocol.io/v0/servers?search=io.github.apache/solr-mcp";
 | jq .
+
+      # Create a summary of the publication
+      - name: Summary
+        run: |
+          echo "### MCP Server Published Successfully! :rocket:" >> 
$GITHUB_STEP_SUMMARY
+          echo "" >> $GITHUB_STEP_SUMMARY
+          echo "**Server Name:** io.github.apache/solr-mcp" >> 
$GITHUB_STEP_SUMMARY
+          echo "**Version:** ${{ steps.version.outputs.version }}" >> 
$GITHUB_STEP_SUMMARY
+          echo "**Docker Image:** ghcr.io/apache/solr-mcp-server:${{ 
steps.version.outputs.version }}-SNAPSHOT" >> $GITHUB_STEP_SUMMARY
+          echo "" >> $GITHUB_STEP_SUMMARY
+          echo "The server is now discoverable in the MCP Registry!" >> 
$GITHUB_STEP_SUMMARY
+          echo "" >> $GITHUB_STEP_SUMMARY
+          echo "**Registry URL:** 
https://registry.modelcontextprotocol.io/v0/servers?search=io.github.apache/solr-mcp";
 >> $GITHUB_STEP_SUMMARY
\ No newline at end of file
diff --git a/README.md b/README.md
index 5900902..b37baf5 100644
--- a/README.md
+++ b/README.md
@@ -74,12 +74,12 @@ The build produces two JAR files in `build/libs/`:
 - `solr-mcp-0.0.1-SNAPSHOT.jar` - Executable JAR with all dependencies (fat 
JAR)
 - `solr-mcp-0.0.1-SNAPSHOT-plain.jar` - Plain JAR without dependencies
 
-### 4. Building Docker Images (Optional)
+### 4. Building using Docker Images instead of JARs
 
 This project uses [Jib](https://github.com/GoogleContainerTools/jib) to build 
optimized Docker images without requiring
 Docker installed. Jib creates layered images for faster rebuilds and smaller 
image sizes.
 
-#### Option 1: Build to Docker Daemon (Recommended)
+#### Option 1: Build to Docker Daemon
 
 Build directly to your local Docker daemon (requires Docker installed):
 
@@ -95,23 +95,9 @@ Verify the image:
 docker images | grep solr-mcp
 ```
 
-#### Option 2: Build to Tar File (No Docker Required)
+#### Option 2: Push to Docker Hub
 
-Build to a tar file without Docker installed:
-
-```bash
-./gradlew jibBuildTar
-```
-
-This creates `build/jib-image.tar`. Load it into Docker:
-
-```bash
-docker load < build/jib-image.tar
-```
-
-#### Option 3: Push to Docker Hub
-
-Authenticate with Docker Hub and push:
+Authenticate with Docker Hub and push (No Local Docker daemon required):
 
 ```bash
 # Login to Docker Hub
@@ -121,9 +107,9 @@ docker login
 ./gradlew jib -Djib.to.image=YOUR_DOCKERHUB_USERNAME/solr-mcp:0.0.1-SNAPSHOT
 ```
 
-#### Option 4: Push to GitHub Container Registry
+#### Option 3: Push to GitHub Container Registry
 
-Authenticate with GitHub Container Registry and push:
+Authenticate with GitHub Container Registry and push (No Local Docker daemon 
required):
 
 ```bash
 # Create a Personal Access Token (classic) with write:packages scope at:
@@ -142,7 +128,7 @@ echo $GITHUB_TOKEN | docker login ghcr.io -u 
YOUR_GITHUB_USERNAME --password-std
 The Docker images are built with multi-platform support for:
 
 - `linux/amd64` (Intel/AMD 64-bit)
-- `linux/arm64` (Apple Silicon M1/M2/M3)
+- `linux/arm64` (Apple Silicon M1/M2/M3/M4/M5)
 
 #### Automated Builds with GitHub Actions
 
@@ -195,127 +181,22 @@ docker run -i --rm \
   solr-mcp:0.0.1-SNAPSHOT
 ```
 
-### 4. Building Docker Images (Optional)
+#### Docker Executable Configuration
 
-This project uses [Jib](https://github.com/GoogleContainerTools/jib) to build 
optimized Docker images without requiring
-Docker installed. Jib creates layered images for faster rebuilds and smaller 
image sizes.
+Jib needs to find the Docker executable to build images. The build is 
configured to automatically detect Docker based on
+your operating system:
 
-#### Option 1: Build to Docker Daemon (Recommended)
+- **macOS**: `/usr/local/bin/docker`
+- **Linux**: `/usr/bin/docker`
+- **Windows**: `C:\Program Files\Docker\Docker\resources\bin\docker.exe`
 
-Build directly to your local Docker daemon (requires Docker installed):
+If Docker is installed in a different location, set the `DOCKER_EXECUTABLE` 
environment variable:
 
 ```bash
+export DOCKER_EXECUTABLE=/custom/path/to/docker
 ./gradlew jibDockerBuild
 ```
 
-This creates a local Docker image: `solr-mcp-server:0.0.1-SNAPSHOT`
-
-Verify the image:
-
-```bash
-docker images | grep solr-mcp-server
-```
-
-#### Option 2: Build to Tar File (No Docker Required)
-
-Build to a tar file without Docker installed:
-
-```bash
-./gradlew jibBuildTar
-```
-
-This creates `build/jib-image.tar`. Load it into Docker:
-
-```bash
-docker load < build/jib-image.tar
-```
-
-#### Option 3: Push to Docker Hub
-
-Authenticate with Docker Hub and push:
-
-```bash
-# Login to Docker Hub
-docker login
-
-# Build and push
-./gradlew jib 
-Djib.to.image=YOUR_DOCKERHUB_USERNAME/solr-mcp-server:0.0.1-SNAPSHOT
-```
-
-#### Option 4: Push to GitHub Container Registry
-
-Authenticate with GitHub Container Registry and push:
-
-```bash
-# Create a Personal Access Token (classic) with write:packages scope at:
-# https://github.com/settings/tokens
-
-# Login to GitHub Container Registry
-export GITHUB_TOKEN=YOUR_GITHUB_TOKEN
-echo $GITHUB_TOKEN | docker login ghcr.io -u YOUR_GITHUB_USERNAME 
--password-stdin
-
-# Build and push
-./gradlew jib 
-Djib.to.image=ghcr.io/YOUR_GITHUB_USERNAME/solr-mcp-server:0.0.1-SNAPSHOT
-```
-
-#### Multi-Platform Support
-
-The Docker images are built with multi-platform support for:
-
-- `linux/amd64` (Intel/AMD 64-bit)
-- `linux/arm64` (Apple Silicon M1/M2/M3)
-
-#### Automated Builds with GitHub Actions
-
-This project includes a GitHub Actions workflow that automatically builds and 
publishes Docker images to both GitHub
-Container Registry and Docker Hub.
-
-**Triggers:**
-
-- Push to `main` branch - Builds and publishes images tagged with 
`version-SHA` and `latest`
-- Version tags (e.g., `v1.0.0`) - Builds and publishes images tagged with the 
version number and `latest`
-- Pull requests - Builds and tests only (no publishing)
-
-**Published Images:**
-
-- GitHub Container Registry: `ghcr.io/OWNER/solr-mcp-server:TAG`
-- Docker Hub: `DOCKERHUB_USERNAME/solr-mcp-server:TAG`
-
-**Setup for Docker Hub Publishing:**
-
-To enable Docker Hub publishing, configure these repository secrets:
-
-1. Go to your GitHub repository Settings > Secrets and variables > Actions
-2. Add the following secrets:
-    - `DOCKERHUB_USERNAME`: Your Docker Hub username
-    - `DOCKERHUB_TOKEN`: Docker Hub access token (create at 
https://hub.docker.com/settings/security)
-
-**Note:** GitHub Container Registry publishing works automatically using the 
`GITHUB_TOKEN` provided by GitHub Actions.
-
-#### Running the Docker Container
-
-Run the container with STDIO mode:
-
-```bash
-docker run -i --rm solr-mcp-server:0.0.1-SNAPSHOT
-```
-
-Or with custom Solr URL:
-
-```bash
-docker run -i --rm \
-  -e SOLR_URL=http://your-solr-host:8983/solr/ \
-  solr-mcp-server:0.0.1-SNAPSHOT
-```
-
-**Note for Linux users:** If you need to connect to Solr running on the host 
machine, add the `--add-host` flag:
-
-```bash
-docker run -i --rm \
-  --add-host=host.docker.internal:host-gateway \
-  solr-mcp-server:0.0.1-SNAPSHOT
-```
-
 ## Project Structure
 
 The codebase follows a clean, modular architecture organized by functionality:
diff --git a/build.gradle.kts b/build.gradle.kts
index 1936d13..7eadfe0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -258,16 +258,11 @@ tasks.register<Test>("dockerIntegrationTest") {
 //    ./gradlew jibDockerBuild
 //    Creates image: solr-mcp:0.0.1-SNAPSHOT
 //
-// 2. Build to local tar file (no Docker required):
-//    ./gradlew jibBuildTar
-//    Creates: build/jib-image.tar
-//    Load with: docker load < build/jib-image.tar
-//
-// 3. Push to Docker Hub (requires authentication):
+// 2. Push to Docker Hub (requires authentication):
 //    docker login
 //    ./gradlew jib -Djib.to.image=dockerhub-username/solr-mcp:0.0.1-SNAPSHOT
 //
-// 4. Push to GitHub Container Registry (requires authentication):
+// 3. Push to GitHub Container Registry (requires authentication):
 //    echo $GITHUB_TOKEN | docker login ghcr.io -u GITHUB_USERNAME 
--password-stdin
 //    ./gradlew jib 
-Djib.to.image=ghcr.io/github-username/solr-mcp:0.0.1-SNAPSHOT
 //
@@ -286,6 +281,20 @@ tasks.register<Test>("dockerIntegrationTest") {
 //   jib.to.auth.username=YOUR_USERNAME
 //   jib.to.auth.password=YOUR_TOKEN_OR_PASSWORD
 //
+// Docker Executable Configuration:
+// ---------------------------------
+// Jib needs to find the Docker executable to build images. By default, it 
uses these paths:
+// - macOS: /usr/local/bin/docker
+// - Linux: /usr/bin/docker
+// - Windows: C:\Program Files\Docker\Docker\resources\bin\docker.exe
+//
+// If Docker is installed in a different location, set the DOCKER_EXECUTABLE 
environment variable:
+//   export DOCKER_EXECUTABLE=/custom/path/to/docker
+//   ./gradlew jibDockerBuild
+//
+// Or in gradle.properties:
+//   systemProp.DOCKER_EXECUTABLE=/custom/path/to/docker
+//
 // Environment Variables:
 // ----------------------
 // The container is pre-configured with:
@@ -295,6 +304,22 @@ tasks.register<Test>("dockerIntegrationTest") {
 // These can be overridden at runtime:
 //   docker run -e SOLR_URL=http://custom-solr:8983/solr/ 
solr-mcp:0.0.1-SNAPSHOT
 jib {
+    // Configure Docker client executable path
+    // This ensures Jib can find Docker even if it's not in Gradle's PATH
+    // Can be overridden with environment variable: 
DOCKER_EXECUTABLE=/path/to/docker
+    dockerClient {
+        executable = System.getenv("DOCKER_EXECUTABLE") ?: when {
+            // macOS with Docker Desktop
+            org.gradle.internal.os.OperatingSystem.current().isMacOsX -> 
"/usr/local/bin/docker"
+            // Linux (most distributions)
+            org.gradle.internal.os.OperatingSystem.current().isLinux -> 
"/usr/bin/docker"
+            // Windows with Docker Desktop
+            org.gradle.internal.os.OperatingSystem.current().isWindows -> 
"C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker.exe"
+            // Fallback to PATH lookup
+            else -> "docker"
+        }
+    }
+
     from {
         // Use Eclipse Temurin JRE 25 as the base image
         // Temurin is the open-source build of OpenJDK from Adoptium
@@ -359,6 +384,8 @@ jib {
                 "org.opencontainers.image.version" to version.toString(),
                 "org.opencontainers.image.vendor" to "Apache Software 
Foundation",
                 "org.opencontainers.image.licenses" to "Apache-2.0",
+                // MCP Registry annotation for server discovery
+                "io.modelcontextprotocol.server.name" to 
"io.github.apache/solr-mcp"
             ),
         )
     }
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 81ca101..2c1fce4 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -3,7 +3,7 @@
 spring-boot = "3.5.6"
 spring-dependency-management = "1.1.7"
 errorprone-plugin = "4.2.0"
-jib = "3.4.4"
+jib = "3.4.5"
 spotless = "7.0.2"
 
 # Main dependencies
diff --git a/server.json b/server.json
new file mode 100644
index 0000000..266bf6a
--- /dev/null
+++ b/server.json
@@ -0,0 +1,54 @@
+{
+  "$schema": 
"https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json";,
+  "name": "io.github.apache/solr-mcp",
+  "description": "MCP server for Apache Solr providing search, indexing, 
schema and collection management",
+  "repository": {
+    "url": "https://github.com/apache/solr-mcp";,
+    "source": "github"
+  },
+  "version": "0.0.1",
+  "packages": [
+    {
+      "registryType": "docker",
+      "identifier": "ghcr.io/apache/solr-mcp-server",
+      "version": "0.0.1-SNAPSHOT",
+      "transport": {
+        "type": "stdio"
+      },
+      "environmentVariables": [
+        {
+          "description": "URL of the Solr instance to connect to (default: 
http://localhost:8983/solr/)",
+          "isRequired": false,
+          "format": "string",
+          "isSecret": false,
+          "name": "SOLR_URL"
+        }
+      ]
+    },
+    {
+      "registryType": "docker",
+      "identifier": "ghcr.io/apache/solr-mcp-server",
+      "version": "0.0.1-SNAPSHOT",
+      "transport": {
+        "type": "streamable-http",
+        "url": "http://localhost:8080/mcp";
+      },
+      "environmentVariables": [
+        {
+          "description": "URL of the Solr instance to connect to (default: 
http://localhost:8983/solr/)",
+          "isRequired": false,
+          "format": "string",
+          "isSecret": false,
+          "name": "SOLR_URL"
+        },
+        {
+          "description": "Enable HTTP mode (set to 'http' for streamable-http 
transport)",
+          "isRequired": true,
+          "format": "string",
+          "isSecret": false,
+          "name": "PROFILES"
+        }
+      ]
+    }
+  ]
+}
\ No newline at end of file
diff --git a/src/test/java/org/apache/solr/mcp/server/BuildInfoReader.java 
b/src/test/java/org/apache/solr/mcp/server/BuildInfoReader.java
new file mode 100644
index 0000000..29dc5e5
--- /dev/null
+++ b/src/test/java/org/apache/solr/mcp/server/BuildInfoReader.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.mcp.server;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+/**
+ * Test utility class for reading build information from {@code 
META-INF/build-info.properties}.
+ *
+ * <p>This utility provides access to build artifact name and version that are 
generated by Spring
+ * Boot during the build process. It's primarily used by Docker integration 
tests to construct
+ * Docker image names dynamically.
+ *
+ * <p><strong>Prerequisites:</strong> The build-info.properties file must be 
present in the test
+ * classpath. This is typically generated by running:
+ *
+ * <pre>{@code
+ * ./gradlew build
+ * }</pre>
+ */
+public class BuildInfoReader {
+
+    private static final String BUILD_INFO_PROPERTIES_PATH = 
"/META-INF/build-info.properties";
+    private static final Properties buildInfo = loadBuildInfo();
+
+    // Private constructor to prevent instantiation
+    private BuildInfoReader() {
+        throw new UnsupportedOperationException("Utility class");
+    }
+
+    /**
+     * Loads build information from the properties file.
+     *
+     * @return Properties object containing build information
+     * @throws IllegalStateException if the properties file cannot be found or 
loaded
+     */
+    private static Properties loadBuildInfo() {
+        Properties properties = new Properties();
+        try (InputStream input =
+                     
BuildInfoReader.class.getResourceAsStream(BUILD_INFO_PROPERTIES_PATH)) {
+            if (input == null) {
+                throw new IllegalStateException(
+                        "build-info.properties not found at "
+                                + BUILD_INFO_PROPERTIES_PATH
+                                + ". Run './gradlew build' first.");
+            }
+            properties.load(input);
+        } catch (IOException e) {
+            throw new IllegalStateException("Failed to load 
build-info.properties", e);
+        }
+        return properties;
+    }
+
+    /**
+     * Gets the build artifact name from build-info.properties.
+     *
+     * @return the artifact name (e.g., "solr-mcp")
+     */
+    public static String getArtifact() {
+        return buildInfo.getProperty("build.artifact");
+    }
+
+    /**
+     * Gets the build version from build-info.properties.
+     *
+     * @return the version string (e.g., "0.0.1-SNAPSHOT")
+     */
+    public static String getVersion() {
+        return buildInfo.getProperty("build.version");
+    }
+
+    /**
+     * Gets the Docker image name in the format "artifact:version".
+     *
+     * @return Docker image name (e.g., "solr-mcp:0.0.1-SNAPSHOT")
+     */
+    public static String getDockerImageName() {
+        return String.format("%s:%s", getArtifact(), getVersion());
+    }
+
+    /**
+     * Gets the JAR file name in the format "artifact-version.jar".
+     *
+     * @return JAR file name (e.g., "solr-mcp-0.0.1-SNAPSHOT.jar")
+     */
+    public static String getJarFileName() {
+        return String.format("%s-%s.jar", getArtifact(), getVersion());
+    }
+}
diff --git a/src/test/java/org/apache/solr/mcp/server/ClientStdio.java 
b/src/test/java/org/apache/solr/mcp/server/ClientStdio.java
index 066a5e5..1af93d4 100644
--- a/src/test/java/org/apache/solr/mcp/server/ClientStdio.java
+++ b/src/test/java/org/apache/solr/mcp/server/ClientStdio.java
@@ -21,40 +21,19 @@ import 
io.modelcontextprotocol.client.transport.ServerParameters;
 import io.modelcontextprotocol.client.transport.StdioClientTransport;
 import io.modelcontextprotocol.json.jackson.JacksonMcpJsonMapper;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
 // run after project has been built with "./gradlew build -x test and the mcp 
server jar is
 // connected to a running solr"
 public class ClientStdio {
 
-    public static void main(String[] args) throws IOException {
-        // Read build info generated by Spring Boot
-        Properties buildInfo = new Properties();
-        try (InputStream input =
-                     
ClientStdio.class.getResourceAsStream("/META-INF/build-info.properties")) {
-            if (input == null) {
-                throw new IllegalStateException(
-                        "build-info.properties not found. Run './gradlew 
build' first.");
-            }
-            buildInfo.load(input);
-        }
+    static void main() {
 
-        String jarName =
-                String.format(
-                        "build/libs/%s-%s.jar",
-                        buildInfo.getProperty("build.artifact"),
-                        buildInfo.getProperty("build.version"));
+        String jarName = String.format("build/libs/%s", 
BuildInfoReader.getJarFileName());
 
-        var stdioParams = ServerParameters
-                .builder("java")
-                .args("-jar", jarName)
-                .build();
+        var stdioParams = ServerParameters.builder("java").args("-jar", 
jarName).build();
 
         var transport =
                 new StdioClientTransport(stdioParams, new 
JacksonMcpJsonMapper(new ObjectMapper()));
 
         new SampleClient(transport).run();
     }
-}
\ No newline at end of file
+}
diff --git 
a/src/test/java/org/apache/solr/mcp/server/DockerImageHttpIntegrationTest.java 
b/src/test/java/org/apache/solr/mcp/server/containerization/DockerImageHttpIntegrationTest.java
similarity index 94%
rename from 
src/test/java/org/apache/solr/mcp/server/DockerImageHttpIntegrationTest.java
rename to 
src/test/java/org/apache/solr/mcp/server/containerization/DockerImageHttpIntegrationTest.java
index 7d2b93e..ba12f16 100644
--- 
a/src/test/java/org/apache/solr/mcp/server/DockerImageHttpIntegrationTest.java
+++ 
b/src/test/java/org/apache/solr/mcp/server/containerization/DockerImageHttpIntegrationTest.java
@@ -14,8 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.solr.mcp.server;
+package org.apache.solr.mcp.server.containerization;
 
+import org.apache.solr.mcp.server.BuildInfoReader;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Tag;
 import org.junit.jupiter.api.Test;
@@ -63,7 +64,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
  * ./gradlew jibDockerBuild
  * }</pre>
  *
- * <p>This will create the image: {@code solr-mcp:0.0.1-SNAPSHOT}
+ * <p>The image name and version are read from {@code 
META-INF/build-info.properties}
  *
  * <p><strong>Test Architecture:</strong>
  *
@@ -82,11 +83,10 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 @Tag("docker-integration")
 class DockerImageHttpIntegrationTest {
 
-    private static final Logger log =
-            LoggerFactory.getLogger(DockerImageHttpIntegrationTest.class);
+    private static final Logger log = 
LoggerFactory.getLogger(DockerImageHttpIntegrationTest.class);
 
-    // Docker image name and tag from build.gradle.kts
-    private static final String DOCKER_IMAGE = "solr-mcp:0.0.1-SNAPSHOT";
+    // Docker image name and tag from build-info.properties
+    private static final String DOCKER_IMAGE = 
BuildInfoReader.getDockerImageName();
     private static final String SOLR_IMAGE = "solr:9.9-slim";
     private static final int HTTP_PORT = 8080;
 
@@ -198,7 +198,8 @@ class DockerImageHttpIntegrationTest {
                         .GET()
                         .build();
 
-        HttpResponse<String> response = httpClient.send(request, 
HttpResponse.BodyHandlers.ofString());
+        HttpResponse<String> response =
+                httpClient.send(request, HttpResponse.BodyHandlers.ofString());
 
         assertEquals(200, response.statusCode(), "Health endpoint should 
return 200 OK");
         assertTrue(
diff --git 
a/src/test/java/org/apache/solr/mcp/server/DockerImageStdioIntegrationTest.java 
b/src/test/java/org/apache/solr/mcp/server/containerization/DockerImageStdioIntegrationTest.java
similarity index 95%
rename from 
src/test/java/org/apache/solr/mcp/server/DockerImageStdioIntegrationTest.java
rename to 
src/test/java/org/apache/solr/mcp/server/containerization/DockerImageStdioIntegrationTest.java
index 1c801c3..d8a4fb4 100644
--- 
a/src/test/java/org/apache/solr/mcp/server/DockerImageStdioIntegrationTest.java
+++ 
b/src/test/java/org/apache/solr/mcp/server/containerization/DockerImageStdioIntegrationTest.java
@@ -14,8 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.solr.mcp.server;
+package org.apache.solr.mcp.server.containerization;
 
+import org.apache.solr.mcp.server.BuildInfoReader;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Tag;
 import org.junit.jupiter.api.Test;
@@ -54,7 +55,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
  * ./gradlew jibDockerBuild
  * }</pre>
  *
- * <p>This will create the image: {@code solr-mcp:0.0.1-SNAPSHOT}
+ * <p>The image name and version are read from {@code 
META-INF/build-info.properties}
  *
  * <p><strong>Test Architecture:</strong>
  *
@@ -76,8 +77,8 @@ class DockerImageStdioIntegrationTest {
     private static final Logger log =
             LoggerFactory.getLogger(DockerImageStdioIntegrationTest.class);
 
-    // Docker image name and tag from build.gradle.kts
-    private static final String DOCKER_IMAGE = "solr-mcp:0.0.1-SNAPSHOT";
+    // Docker image name and tag from build-info.properties
+    private static final String DOCKER_IMAGE = 
BuildInfoReader.getDockerImageName();
     private static final String SOLR_IMAGE = "solr:9.9-slim";
 
     // Network for container communication

Reply via email to