- Explore MCP Servers
- moon-phases-quarkus-mcp-sse-server
Moon Phases Quarkus Mcp Sse Server
What is Moon Phases Quarkus Mcp Sse Server
moon-phases-quarkus-mcp-sse-server is a Model Context Protocol (MCP) Server-Sent Events server implemented in Java using the Quarkus framework. It calculates the current phase of the moon or the phase on a specified date.
Use cases
Use cases include providing moon phase data for astronomy apps, integrating with weather applications to enhance user experience, and educational tools for teaching about lunar cycles.
How to use
To use the server, you can run it in development mode using ‘./mvnw quarkus:dev’. To package the application, use ‘./mvnw clean package’ which generates a ‘quarkus-run.jar’ file. You can also create a native executable with ‘./mvnw clean package -Dnative’.
Key features
Key features include real-time calculation of moon phases, support for Server-Sent Events, and the ability to run in both JVM and native modes. It is built on the efficient Quarkus framework.
Where to use
moon-phases-quarkus-mcp-sse-server can be used in applications requiring astronomical data, such as mobile apps, educational platforms, or any software needing lunar phase information.
Overview
What is Moon Phases Quarkus Mcp Sse Server
moon-phases-quarkus-mcp-sse-server is a Model Context Protocol (MCP) Server-Sent Events server implemented in Java using the Quarkus framework. It calculates the current phase of the moon or the phase on a specified date.
Use cases
Use cases include providing moon phase data for astronomy apps, integrating with weather applications to enhance user experience, and educational tools for teaching about lunar cycles.
How to use
To use the server, you can run it in development mode using ‘./mvnw quarkus:dev’. To package the application, use ‘./mvnw clean package’ which generates a ‘quarkus-run.jar’ file. You can also create a native executable with ‘./mvnw clean package -Dnative’.
Key features
Key features include real-time calculation of moon phases, support for Server-Sent Events, and the ability to run in both JVM and native modes. It is built on the efficient Quarkus framework.
Where to use
moon-phases-quarkus-mcp-sse-server can be used in applications requiring astronomical data, such as mobile apps, educational platforms, or any software needing lunar phase information.
Content
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 Dockerfile
s.
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