moon-phases-quarkus-mcp-sse-server

Moon phases MCP server, using Server-Sent Events, implemented in Java with the Quarkus framework

GitHub Stars

2

User Rating

Not Rated

Favorites

0

Views

2

Forks

0

Issues

0

README
MoonPhase MCP SSE server

This project uses Quarkus framework.
It creates a Model Context Protocol (MCP) Server-Sent Event server to calculate the current phase of the moon, or the phase at a given date.

The algorithm has been translated to Java thanks to Gemini,
from this repository offering implementations in various languages.

[!NOTE]
Read more about this project in this article:
Building an MCP server with Quarkus and deploying on Google Cloud Run

Running the application in dev mode

You can run your application in dev mode that enables live coding using:

./mvnw quarkus:dev
Packaging and running the application

The application can be packaged using:

./mvnw clean package

It produces the quarkus-run.jar file in the target/quarkus-app/ directory.
Be aware that it’s not an über-jar as the dependencies are copied into the target/quarkus-app/lib/ directory.

The application is now runnable using java -jar target/quarkus-app/quarkus-run.jar.

If you want to build an über-jar, execute the following command:

./mvnw clean package -Dquarkus.package.jar.type=uber-jar

The application, packaged as an über-jar, is now runnable using java -jar target/*-runner.jar.

Creating a native executable

You can create a native executable using:

./mvnw clean package -Dnative

Or, if you don't have GraalVM installed, you can run the native executable build in a container using:

./mvnw clean package -Dnative -Dquarkus.native.container-build=true

You can then execute your native executable with: ./target/moonphase-1.0-SNAPSHOT-runner

Deploying to Cloud Run

You can containerize your application with the provided Dockerfiles.
Copy the Dockerfile.jvm from src/main/docker/ at the root of your project.

[!NOTE]
If you don't have an account on Google Cloud yet, you can create an account with a free trial
and benefit from $300 of credits.

Build the project with Cloud Build:

gcloud builds submit --tag gcr.io/YOUR_PROJECT_ID/moonphases

And deploy it to Cloud Run with:

gcloud run deploy moonphases --allow-unauthenticated --image gcr.io/YOUR_PROJECT_ID/moonphases

You'll be asked along the way to activate the required cloud APIs.


This project is licensed under the Apache 2 license.

[!NOTE]
This is not an official Google project

Author Information
Guillaume Laforge

Developer Advocate at Google for Google Cloud Platform, and co-founder of the Apache Groovy programming language project.

GoogleParis, France

559

Followers

119

Repositories

46

Gists

0

Total Contributions