Skip to content

Commit fe514d6

Browse files
adityamparikhepugh
andauthored
chore: Rename repo (#7)
* Add Docker support with Jib and GitHub Actions CI/CD * Add Docker support with Jib and GitHub Actions CI/CD # Conflicts: # build.gradle.kts # gradle/libs.versions.toml * Update the repo name pattern. * Add Docker support with Jib and GitHub Actions CI/CD # Conflicts: # build.gradle.kts # gradle/libs.versions.toml * test: add Docker integration tests for MCP server under both STDIO and HTTP modes * refactor: rename project from solr-mcp-server to solr-mcp --------- Co-authored-by: Eric Pugh <epugh@opensourceconnections.com>
1 parent e7642e7 commit fe514d6

10 files changed

Lines changed: 158 additions & 49 deletions

.github/workflows/build-and-publish.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
#
3434
# Published Images:
3535
# ----------------
36-
# - GitHub Container Registry: ghcr.io/OWNER/solr-mcp-server:TAG
37-
# - Docker Hub: DOCKERHUB_USERNAME/solr-mcp-server:TAG
36+
# - GitHub Container Registry: ghcr.io/OWNER/solr-mcp:TAG
37+
# - Docker Hub: DOCKERHUB_USERNAME/solr-mcp:TAG
3838
#
3939
# Image Tagging Strategy:
4040
# ----------------------
@@ -114,8 +114,8 @@ jobs:
114114
- name: Upload JAR artifact
115115
uses: actions/upload-artifact@v4
116116
with:
117-
name: solr-mcp-server-jar
118-
path: build/libs/solr-mcp-server-*.jar
117+
name: solr-mcp-jar
118+
path: build/libs/solr-mcp-*.jar
119119
retention-days: 7
120120

121121
# Upload JUnit test results
@@ -200,7 +200,7 @@ jobs:
200200
# Get version from build.gradle.kts
201201
VERSION=$(grep '^version = ' build.gradle.kts | sed 's/version = "\(.*\)"/\1/')
202202
echo "version=$VERSION" >> $GITHUB_OUTPUT
203-
203+
204204
# Determine image tags based on trigger type
205205
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
206206
# For version tags (e.g., v1.0.0), use semantic version
@@ -271,13 +271,13 @@ jobs:
271271
run: |
272272
TAGS="${{ steps.meta.outputs.tags }}"
273273
IFS=',' read -ra TAG_ARRAY <<< "$TAGS"
274-
274+
275275
# Build and push each tag to GHCR
276276
# Jib automatically handles multi-platform builds (amd64, arm64)
277277
for TAG in "${TAG_ARRAY[@]}"; do
278-
echo "Building and pushing ghcr.io/${{ steps.repo.outputs.owner_lc }}/solr-mcp-server:$TAG"
278+
echo "Building and pushing ghcr.io/${{ steps.repo.outputs.owner_lc }}/solr-mcp:$TAG"
279279
./gradlew jib \
280-
-Djib.to.image=ghcr.io/${{ steps.repo.outputs.owner_lc }}/solr-mcp-server:$TAG \
280+
-Djib.to.image=ghcr.io/${{ steps.repo.outputs.owner_lc }}/solr-mcp:$TAG \
281281
-Djib.to.auth.username=${{ github.actor }} \
282282
-Djib.to.auth.password=${{ secrets.GITHUB_TOKEN }}
283283
done
@@ -290,12 +290,12 @@ jobs:
290290
run: |
291291
TAGS="${{ steps.meta.outputs.tags }}"
292292
IFS=',' read -ra TAG_ARRAY <<< "$TAGS"
293-
293+
294294
# Build and push each tag to Docker Hub
295295
for TAG in "${TAG_ARRAY[@]}"; do
296-
echo "Building and pushing ${{ secrets.DOCKERHUB_USERNAME }}/solr-mcp-server:$TAG"
296+
echo "Building and pushing ${{ secrets.DOCKERHUB_USERNAME }}/solr-mcp:$TAG"
297297
./gradlew jib \
298-
-Djib.to.image=${{ secrets.DOCKERHUB_USERNAME }}/solr-mcp-server:$TAG \
298+
-Djib.to.image=${{ secrets.DOCKERHUB_USERNAME }}/solr-mcp:$TAG \
299299
-Djib.to.auth.username=${{ secrets.DOCKERHUB_USERNAME }} \
300300
-Djib.to.auth.password=${{ secrets.DOCKERHUB_TOKEN }}
301301
done
@@ -311,14 +311,14 @@ jobs:
311311
TAGS="${{ steps.meta.outputs.tags }}"
312312
IFS=',' read -ra TAG_ARRAY <<< "$TAGS"
313313
for TAG in "${TAG_ARRAY[@]}"; do
314-
echo "- \`ghcr.io/${{ steps.repo.outputs.owner_lc }}/solr-mcp-server:$TAG\`" >> $GITHUB_STEP_SUMMARY
314+
echo "- \`ghcr.io/${{ steps.repo.outputs.owner_lc }}/solr-mcp:$TAG\`" >> $GITHUB_STEP_SUMMARY
315315
done
316-
316+
317317
# Only show Docker Hub section if secrets are configured
318318
if [[ "${{ secrets.DOCKERHUB_USERNAME }}" != "" ]]; then
319319
echo "" >> $GITHUB_STEP_SUMMARY
320320
echo "#### Docker Hub" >> $GITHUB_STEP_SUMMARY
321321
for TAG in "${TAG_ARRAY[@]}"; do
322-
echo "- \`${{ secrets.DOCKERHUB_USERNAME }}/solr-mcp-server:$TAG\`" >> $GITHUB_STEP_SUMMARY
322+
echo "- \`${{ secrets.DOCKERHUB_USERNAME }}/solr-mcp:$TAG\`" >> $GITHUB_STEP_SUMMARY
323323
done
324-
fi
324+
fi

.run/SolrMcpServerHttp.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<configuration default="false" name="SolrMcpServerHttp" type="SpringBootApplicationConfigurationType"
33
factoryName="Spring Boot">
44
<option name="ACTIVE_PROFILES" value="http"/>
5-
<module name="solr-mcp-server.main"/>
5+
<module name="solr-mcp.main"/>
66
<option name="SPRING_BOOT_MAIN_CLASS" value="org.apache.solr.mcp.server.Main"/>
77
<method v="2">
88
<option name="Make" enabled="true"/>

.run/SolrMcpServerStdio.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<configuration default="false" name="SolrMcpServerStdio" type="SpringBootApplicationConfigurationType"
33
factoryName="Spring Boot">
44
<option name="ACTIVE_PROFILES" value="stdio"/>
5-
<module name="solr-mcp-server.main"/>
5+
<module name="solr-mcp.main"/>
66
<option name="SPRING_BOOT_MAIN_CLASS" value="org.apache.solr.mcp.server.Main"/>
77
<method v="2">
88
<option name="Make" enabled="true"/>

README.md

Lines changed: 129 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,129 @@ centrally managed in `gradle/libs.versions.toml`.
7171

7272
The build produces two JAR files in `build/libs/`:
7373

74-
- `solr-mcp-server-0.0.1-SNAPSHOT.jar` - Executable JAR with all dependencies (fat JAR)
75-
- `solr-mcp-server-0.0.1-SNAPSHOT-plain.jar` - Plain JAR without dependencies
74+
- `solr-mcp-0.0.1-SNAPSHOT.jar` - Executable JAR with all dependencies (fat JAR)
75+
- `solr-mcp-0.0.1-SNAPSHOT-plain.jar` - Plain JAR without dependencies
76+
77+
### 4. Building Docker Images (Optional)
78+
79+
This project uses [Jib](https://github.com/GoogleContainerTools/jib) to build optimized Docker images without requiring
80+
Docker installed. Jib creates layered images for faster rebuilds and smaller image sizes.
81+
82+
#### Option 1: Build to Docker Daemon (Recommended)
83+
84+
Build directly to your local Docker daemon (requires Docker installed):
85+
86+
```bash
87+
./gradlew jibDockerBuild
88+
```
89+
90+
This creates a local Docker image: `solr-mcp:0.0.1-SNAPSHOT`
91+
92+
Verify the image:
93+
94+
```bash
95+
docker images | grep solr-mcp
96+
```
97+
98+
#### Option 2: Build to Tar File (No Docker Required)
99+
100+
Build to a tar file without Docker installed:
101+
102+
```bash
103+
./gradlew jibBuildTar
104+
```
105+
106+
This creates `build/jib-image.tar`. Load it into Docker:
107+
108+
```bash
109+
docker load < build/jib-image.tar
110+
```
111+
112+
#### Option 3: Push to Docker Hub
113+
114+
Authenticate with Docker Hub and push:
115+
116+
```bash
117+
# Login to Docker Hub
118+
docker login
119+
120+
# Build and push
121+
./gradlew jib -Djib.to.image=YOUR_DOCKERHUB_USERNAME/solr-mcp:0.0.1-SNAPSHOT
122+
```
123+
124+
#### Option 4: Push to GitHub Container Registry
125+
126+
Authenticate with GitHub Container Registry and push:
127+
128+
```bash
129+
# Create a Personal Access Token (classic) with write:packages scope at:
130+
# https://github.com/settings/tokens
131+
132+
# Login to GitHub Container Registry
133+
export GITHUB_TOKEN=YOUR_GITHUB_TOKEN
134+
echo $GITHUB_TOKEN | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin
135+
136+
# Build and push
137+
./gradlew jib -Djib.to.image=ghcr.io/YOUR_GITHUB_USERNAME/solr-mcp:0.0.1-SNAPSHOT
138+
```
139+
140+
#### Multi-Platform Support
141+
142+
The Docker images are built with multi-platform support for:
143+
144+
- `linux/amd64` (Intel/AMD 64-bit)
145+
- `linux/arm64` (Apple Silicon M1/M2/M3)
146+
147+
#### Automated Builds with GitHub Actions
148+
149+
This project includes a GitHub Actions workflow that automatically builds and publishes Docker images to both GitHub
150+
Container Registry and Docker Hub.
151+
152+
**Triggers:**
153+
154+
- Push to `main` branch - Builds and publishes images tagged with `version-SHA` and `latest`
155+
- Version tags (e.g., `v1.0.0`) - Builds and publishes images tagged with the version number and `latest`
156+
- Pull requests - Builds and tests only (no publishing)
157+
158+
**Published Images:**
159+
160+
- GitHub Container Registry: `ghcr.io/OWNER/solr-mcp:TAG`
161+
- Docker Hub: `DOCKERHUB_USERNAME/solr-mcp:TAG`
162+
163+
**Setup for Docker Hub Publishing:**
164+
165+
To enable Docker Hub publishing, configure these repository secrets:
166+
167+
1. Go to your GitHub repository Settings > Secrets and variables > Actions
168+
2. Add the following secrets:
169+
- `DOCKERHUB_USERNAME`: Your Docker Hub username
170+
- `DOCKERHUB_TOKEN`: Docker Hub access token (create at https://hub.docker.com/settings/security)
171+
172+
**Note:** GitHub Container Registry publishing works automatically using the `GITHUB_TOKEN` provided by GitHub Actions.
173+
174+
#### Running the Docker Container
175+
176+
Run the container with STDIO mode:
177+
178+
```bash
179+
docker run -i --rm solr-mcp:0.0.1-SNAPSHOT
180+
```
181+
182+
Or with custom Solr URL:
183+
184+
```bash
185+
docker run -i --rm \
186+
-e SOLR_URL=http://your-solr-host:8983/solr/ \
187+
solr-mcp:0.0.1-SNAPSHOT
188+
```
189+
190+
**Note for Linux users:** If you need to connect to Solr running on the host machine, add the `--add-host` flag:
191+
192+
```bash
193+
docker run -i --rm \
194+
--add-host=host.docker.internal:host-gateway \
195+
solr-mcp:0.0.1-SNAPSHOT
196+
```
76197

77198
### 4. Building Docker Images (Optional)
78199

@@ -343,7 +464,7 @@ You can add this MCP server to Claude Desktop using either the JAR file or Docke
343464
"command": "java",
344465
"args": [
345466
"-jar",
346-
"/absolute/path/to/solr-mcp-server/build/libs/solr-mcp-server-0.0.1-SNAPSHOT.jar"
467+
"/absolute/path/to/solr-mcp/build/libs/solr-mcp-0.0.1-SNAPSHOT.jar"
347468
],
348469
"env": {
349470
"SOLR_URL": "http://localhost:8983/solr/",
@@ -354,7 +475,7 @@ You can add this MCP server to Claude Desktop using either the JAR file or Docke
354475
}
355476
```
356477

357-
**Note:** Replace `/absolute/path/to/solr-mcp-server` with the actual path to your project directory.
478+
**Note:** Replace `/absolute/path/to/solr-mcp` with the actual path to your project directory.
358479

359480
### Option 2: Using Docker Container
360481

@@ -377,7 +498,7 @@ You can add this MCP server to Claude Desktop using either the JAR file or Docke
377498
"run",
378499
"-i",
379500
"--rm",
380-
"solr-mcp-server:0.0.1-SNAPSHOT"
501+
"solr-mcp:0.0.1-SNAPSHOT"
381502
],
382503
"env": {
383504
"SOLR_URL": "http://localhost:8983/solr/"
@@ -403,7 +524,7 @@ host:
403524
"-i",
404525
"--rm",
405526
"--add-host=host.docker.internal:host-gateway",
406-
"solr-mcp-server:0.0.1-SNAPSHOT"
527+
"solr-mcp:0.0.1-SNAPSHOT"
407528
],
408529
"env": {
409530
"SOLR_URL": "http://host.docker.internal:8983/solr/"
@@ -428,7 +549,7 @@ If you've pushed the image to Docker Hub or GitHub Container Registry, you can u
428549
"run",
429550
"-i",
430551
"--rm",
431-
"YOUR_DOCKERHUB_USERNAME/solr-mcp-server:0.0.1-SNAPSHOT"
552+
"YOUR_DOCKERHUB_USERNAME/solr-mcp:0.0.1-SNAPSHOT"
432553
],
433554
"env": {
434555
"SOLR_URL": "http://localhost:8983/solr/"
@@ -449,7 +570,7 @@ If you've pushed the image to Docker Hub or GitHub Container Registry, you can u
449570
"run",
450571
"-i",
451572
"--rm",
452-
"ghcr.io/YOUR_GITHUB_USERNAME/solr-mcp-server:0.0.1-SNAPSHOT"
573+
"ghcr.io/YOUR_GITHUB_USERNAME/solr-mcp:0.0.1-SNAPSHOT"
453574
],
454575
"env": {
455576
"SOLR_URL": "http://localhost:8983/solr/"

build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ dependencyManagement {
7878

7979
// Configures Spring Boot plugin to generate build metadata at build time
8080
// This creates META-INF/build-info.properties containing:
81-
// - build.artifact: The artifact name (e.g., "solr-mcp-server")
81+
// - build.artifact: The artifact name (e.g., "solr-mcp")
8282
// - build.group: The group ID (e.g., "org.apache.solr")
8383
// - build.name: The project name
8484
// - build.version: The version (e.g., "0.0.1-SNAPSHOT")
@@ -256,7 +256,7 @@ tasks.register<Test>("dockerIntegrationTest") {
256256
// ----------------
257257
// 1. Build to Docker daemon (requires Docker installed):
258258
// ./gradlew jibDockerBuild
259-
// Creates image: solr-mcp-server:0.0.1-SNAPSHOT
259+
// Creates image: solr-mcp:0.0.1-SNAPSHOT
260260
//
261261
// 2. Build to local tar file (no Docker required):
262262
// ./gradlew jibBuildTar
@@ -265,11 +265,11 @@ tasks.register<Test>("dockerIntegrationTest") {
265265
//
266266
// 3. Push to Docker Hub (requires authentication):
267267
// docker login
268-
// ./gradlew jib -Djib.to.image=dockerhub-username/solr-mcp-server:0.0.1-SNAPSHOT
268+
// ./gradlew jib -Djib.to.image=dockerhub-username/solr-mcp:0.0.1-SNAPSHOT
269269
//
270270
// 4. Push to GitHub Container Registry (requires authentication):
271271
// echo $GITHUB_TOKEN | docker login ghcr.io -u GITHUB_USERNAME --password-stdin
272-
// ./gradlew jib -Djib.to.image=ghcr.io/github-username/solr-mcp-server:0.0.1-SNAPSHOT
272+
// ./gradlew jib -Djib.to.image=ghcr.io/github-username/solr-mcp:0.0.1-SNAPSHOT
273273
//
274274
// Authentication:
275275
// ---------------
@@ -293,7 +293,7 @@ tasks.register<Test>("dockerIntegrationTest") {
293293
// - SOLR_URL=http://host.docker.internal:8983/solr/ (default Solr connection)
294294
//
295295
// These can be overridden at runtime:
296-
// docker run -e SOLR_URL=http://custom-solr:8983/solr/ solr-mcp-server:0.0.1-SNAPSHOT
296+
// docker run -e SOLR_URL=http://custom-solr:8983/solr/ solr-mcp:0.0.1-SNAPSHOT
297297
jib {
298298
from {
299299
// Use Eclipse Temurin JRE 25 as the base image
@@ -317,7 +317,7 @@ jib {
317317
to {
318318
// Default image name (can be overridden with -Djib.to.image=...)
319319
// Format: repository/image-name:tag
320-
image = "solr-mcp-server:$version"
320+
image = "solr-mcp:$version"
321321

322322
// Tags to apply to the image
323323
// The version tag is applied by default, plus "latest" tag

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
* limitations under the License.
1616
*/
1717

18-
rootProject.name = "solr-mcp-server"
18+
rootProject.name = "solr-mcp"

sonar-project.properties

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
spring.application.name=solr-mcp-server
1+
spring.application.name=solr-mcp
22
spring.profiles.active=${PROFILES:stdio}
33
spring.ai.mcp.server.instructions=This server provides tools to interact with Apache Solr using Model Context Protocol (MCP) over STDIO and/or HTTP.
44
spring.ai.mcp.server.name=${spring.application.name}

src/test/java/org/apache/solr/mcp/server/DockerImageHttpIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
* ./gradlew jibDockerBuild
6464
* }</pre>
6565
*
66-
* <p>This will create the image: {@code solr-mcp-server:0.0.1-SNAPSHOT}
66+
* <p>This will create the image: {@code solr-mcp:0.0.1-SNAPSHOT}
6767
*
6868
* <p><strong>Test Architecture:</strong>
6969
*
@@ -86,7 +86,7 @@ class DockerImageHttpIntegrationTest {
8686
LoggerFactory.getLogger(DockerImageHttpIntegrationTest.class);
8787

8888
// Docker image name and tag from build.gradle.kts
89-
private static final String DOCKER_IMAGE = "solr-mcp-server:0.0.1-SNAPSHOT";
89+
private static final String DOCKER_IMAGE = "solr-mcp:0.0.1-SNAPSHOT";
9090
private static final String SOLR_IMAGE = "solr:9.9-slim";
9191
private static final int HTTP_PORT = 8080;
9292

src/test/java/org/apache/solr/mcp/server/DockerImageStdioIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
* ./gradlew jibDockerBuild
5555
* }</pre>
5656
*
57-
* <p>This will create the image: {@code solr-mcp-server:0.0.1-SNAPSHOT}
57+
* <p>This will create the image: {@code solr-mcp:0.0.1-SNAPSHOT}
5858
*
5959
* <p><strong>Test Architecture:</strong>
6060
*
@@ -77,7 +77,7 @@ class DockerImageStdioIntegrationTest {
7777
LoggerFactory.getLogger(DockerImageStdioIntegrationTest.class);
7878

7979
// Docker image name and tag from build.gradle.kts
80-
private static final String DOCKER_IMAGE = "solr-mcp-server:0.0.1-SNAPSHOT";
80+
private static final String DOCKER_IMAGE = "solr-mcp:0.0.1-SNAPSHOT";
8181
private static final String SOLR_IMAGE = "solr:9.9-slim";
8282

8383
// Network for container communication

0 commit comments

Comments
 (0)