Cover image
Try Now
2025-04-04

Este proyecto utiliza Quarkus y el Protocolo de contexto del modelo] para implementar una aplicación agente simple utilizando múltiples servidores MCP y Quarkus + Langchain4j.

3 years

Works with Finder

1

Github Watches

2

Github Forks

1

Github Stars

Quarkus + MCP = Agentic

This project uses Quarkus, the Supersonic Subatomic Java Framework and the Model Context Protocol to implement a simple agentic app using multiple MCP servers and Quarkus + LangChain4j.

If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .

Running the application in dev mode

You'll need node and npm installed (this is used to start mcp services). Follow the recommended way to install for your system.

You will also need a container environment available (e.g. Podman or Docker) if you want to see built-in telemetry, which you can access once the app is up by going to the Dev UI and finding the Grafana link. If you don't have a container environment, comment out the part in application.properties dealing with telemetry.

Create a directory called playground at the root folder of your clone if you wish to use the filesystem MCP server (or change the name in application.properties to some other name, but the directory must exist)

Several of the MCP services require API keys. Here are links to get the keys:

Once you have all that, the easiest way is to create a file called .env in your clone (this file is listed in .gitignore so won't be pushed to GitHub if you fork this repo and make the file). The .env file should look like:

quarkus.langchain4j.mcp.bravesearch.environment.BRAVE_API_KEY=<YOUR BRAVE API KEY HERE>
quarkus.langchain4j.mcp.googlemaps.environment.GOOGLE_MAPS_API_KEY=<YOUR GMAPS API KEY HERE>
quarkus.langchain4j.mcp.slack.environment.SLACK_BOT_TOKEN=<YOUR SLACK BOT TOKEN HERE>
quarkus.langchain4j.mcp.slack.environment.SLACK_TEAM_ID=<YOUR SLACK TEAM ID HERE>
quarkus.langchain4j.openai.api-key=<YOUR OPENAI API KEY HERE>

These variables will automatically be included when you run Quarkus in Dev mode. You can also put them directly in application.properties but be careful not to check them into a public source repository!

For production use, these should obviously be treated differently, stored in secure places like vaults or kubernetes Secrets, and injected as environment variables at runtime.

But for testing, you can run your application in dev mode that enables live coding using:

./mvnw compile quarkus:dev

In Dev mode, you can use the Dev UI to chat with the LLM you've configured by going to "Extensions" and clicking "Chat" to chat. You'll find the system message pre-filled in from the content from Bot.java

NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.

Testing the app

There is a simple frontend application to test the assistant - access http://localhost:8080 and you should see:

landing page

Click on the chat box icon at the lower left and issue some sample prompts to see how it uses agent reasoning to invoke the various tools:

My name is John Doe. I am a member of a team of 2 myself and Daniel Jane. I like Asian food, while Daniel is on a strict gluten-free diet.

Please find one good restaurant in Atlanta, GA with the highest rating that meets
the team's dietary needs and preferences. Then, invite the team to a lunch
at 12pm next Wednesday using the slack channel "#lunchtime".
In your message, include the name and description of the restaurant, the time and
date of the lunch, and driving directions from Georgia World Congress Center.
Also create an ICS calendar file for me to use in my calendar in the
"playground/calendar" directory.`

And some simpler follow-up prompts like:

  • What was the reasoning you used to arrive at that recommendation?
  • How did you choose the restaurant?
  • What actions did you take for each step and which tools did you use?
  • Why did you search for gluten-free restaurants?
  • What did you remember about each person on the team?

In Dev mode, you can also use the Dev UI to chat with the LLM you've configured by going to "Extensions" and clicking "Chat" to chat. You'll find the system message pre-filled in from the content from Bot.java

NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.

Packaging and running the application

The application can be packaged using:

./mvnw 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 package -Dquarkus.package.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 package -Dnative

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

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

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

If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.

Related Guides

  • LangChain4j Model Context Protocol client (guide): Provides the Model Context Protocol client-side implementation for LangChain4j
  • LangChain4j OpenAI (guide): Provides the basic integration with LangChain4j

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • OffchainLabs
  • Implementación de la prueba de estaca Ethereum

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

    Reviews

    3.4 (7)
    Avatar
    user_tSCpuCqc
    2025-04-23

    As a dedicated user of quarkus-mcp-agentic, I am thoroughly impressed with its performance and ease of integration. James Falkner has created a robust solution for modern cloud applications. The documentation is clear, and the agentic features significantly enhance my development workflow. I highly recommend checking it out on GitHub!

    Avatar
    user_OHCKk4Mi
    2025-04-23

    As a dedicated user of Quarkus MCP Agentic, I must say this product has revolutionized my app development. Created by James Falkner, it's seamlessly integrated with modern Java frameworks and incredibly user-friendly. The documentation and support on GitHub are top-notch, making the learning curve easy to manage. Highly recommended for any developer looking to optimize their workflow!

    Avatar
    user_sNQPDRan
    2025-04-23

    I've been using quarkus-mcp-agentic and it has dramatically improved my development workflow. James Falkner did an excellent job with this tool. It's well-documented and integrates seamlessly into my Quarkus projects. Highly recommend it to anyone looking to enhance their Quarkus applications! Check it out at https://github.com/jamesfalkner/quarkus-mcp-agentic.

    Avatar
    user_p7BO2XuH
    2025-04-23

    As a dedicated user of the quarkus-mcp-agentic, I am thoroughly impressed by its seamless integration and exceptional performance. This tool by jamesfalkner simplifies my development workflow significantly, offering robust features that enhance productivity. Its user-friendly interface and comprehensive documentation make it accessible even to those newer to Quarkus. Highly recommend checking it out!

    Avatar
    user_3o2uNzPO
    2025-04-23

    I've been using quarkus-mcp-agentic by jamesfalkner for a while now, and it has significantly streamlined my development workflow. The integration with Quarkus is seamless, and the agentic capabilities make managing microservices a breeze. Highly recommended for anyone looking to enhance their microservices setup! Check it out at: https://github.com/jamesfalkner/quarkus-mcp-agentic.

    Avatar
    user_YEOQt7bf
    2025-04-23

    As a loyal user of MCP applications, I found Quarkus-MCP-Agentic truly exceptional. Developed by jamesfalkner, this tool is user-friendly and incredibly efficient. Whether you are a beginner or a seasoned professional, it provides valuable assistance in managing your projects. The GitHub repository (https://github.com/jamesfalkner/quarkus-mcp-agentic) offers comprehensive resources, making it easier to get started and leverage its full potential. Highly recommended!

    Avatar
    user_FJwehCqs
    2025-04-23

    I have been using quarkus-mcp-agentic by jamesfalkner for a while now, and it has significantly improved my microservices management. The seamless integration with Quarkus and the efficient agent framework make it a must-have for any developer working in modern cloud environments. Highly recommend checking it out on GitHub!