quarkus-mcp-server

Quarkus MCP Server: Simplify LLM integration with external data using this efficient MCP server extension.

quarkus-mcp-server
quarkus-mcp-server Capabilities Showcase

quarkus-mcp-server Solution Overview

Quarkus MCP Server is an extension designed to simplify the creation of MCP (Model Context Protocol) servers. As an implementation of the MCP server component, it enables seamless integration between LLM applications and external data sources or tools, acting as a "USB-C" interface for AI models.

This extension offers both declarative and programmatic APIs, allowing developers to define server functionalities like prompts, resources, and tools using CDI bean annotations. It supports HTTP/SSE and STDIO for data transmission. By using Quarkus MCP Server, developers can empower their LLM applications to securely access and leverage external data and tools, enhancing their capabilities. Integration is streamlined through LangChain4j, which provides MCP client functionalities, including low-level APIs and complete integration with AI applications. This facilitates the development of robust and context-aware AI solutions.

quarkus-mcp-server Key Capabilities

Declarative Server Feature Definition

The Quarkus MCP Server simplifies the creation of MCP server functionalities by using a declarative approach. Developers can define prompts, resources, and tools by annotating CDI bean methods. This eliminates the need for complex configuration or boilerplate code, allowing developers to focus on the core logic of their AI integrations. The annotations handle the registration and exposure of these features through the MCP protocol. This approach significantly reduces development time and improves code readability.

For example, a developer can expose a function that converts a string to lowercase as an MCP tool by simply annotating a Java method with @Tool(description = "Converts the string value to lower case"). The Quarkus MCP Server automatically handles the communication and data serialization required to make this tool accessible to AI models via the MCP protocol. This declarative style promotes a cleaner and more maintainable codebase.

HTTP/SSE and STDIO Transport Support

Quarkus MCP Server supports both HTTP/SSE and STDIO transport mechanisms, providing flexibility in how AI models communicate with the server. HTTP/SSE (Server-Sent Events) offers a standard web-based approach, suitable for scenarios where the AI model and server are running in different environments or require asynchronous communication. STDIO (Standard Input/Output) provides a more direct communication channel, ideal for local development or when the AI model and server are tightly coupled.

The choice of transport mechanism can be configured via Maven dependency. This allows developers to select the most appropriate option based on their specific deployment requirements and network constraints. For instance, when integrating with LangChain4j, HTTP/SSE might be preferred for its compatibility with web-based AI applications, while STDIO could be used for local testing and debugging.

Seamless Integration with LangChain4j

The Quarkus MCP Server is designed for seamless integration with LangChain4j, a popular framework for building AI-powered applications. LangChain4j provides MCP client functionalities, including low-level programmatic APIs and high-level integrations for AI applications. This allows developers to easily connect their LangChain4j-based AI models to the Quarkus MCP Server and leverage its exposed resources, tools, and prompts.

This integration simplifies the process of building end-to-end AI solutions by providing a well-defined and standardized interface between the AI model and external data sources. For example, a LangChain4j application can use the MCP client to invoke a tool exposed by the Quarkus MCP Server to perform data transformation or access external APIs, enabling more complex and sophisticated AI workflows.