Quarkus MCP Server
The production-ready way to build Model Context Protocol servers in Java.
Quarkus MCP Server brings enterprise-grade reliability and performance to MCP server development. Build native executables with instant startup times, leverage build-time optimization for minimal resource usage, and deploy AI-powered tools that scale.
In a Glance
Create a tool in seconds with declarative annotations:
import io.quarkiverse.mcp.server.Tool;
public class WeatherTools {
@Tool(description = "Get current weather for a city")
String getWeather(String city) {
return "Sunny, 25°C in " + city;
}
}
That’s it. No configuration files, no boilerplate, no manual registration. The @Tool annotation does it all.
Why Quarkus MCP Server?
Build-Time Magic
Quarkus analyzes your code at build time, not runtime. Tools, resources, and prompts are discovered and validated during compilation. This means:
-
Instant startup : Native executables start in milliseconds
-
Minimal memory : Production servers run on ~30MB of RAM
-
Zero reflection : Everything is known at build time
Production Ready, Out of the Box
-
Multiple transports : STDIO, HTTP, SSE, WebSocket all supported
-
Enterprise integration : Full CDI support with dependency injection, interceptors, and decorators
-
Security built-in : Integrate with Quarkus Security for authentication and authorization
-
Reactive by default : Built on Eclipse Vert.x for non-blocking I/O, also supports virtual threads
-
Comprehensive testing - McpAssured testing library for all transport types
Protocol Support
This project implements the Model Context Protocol specification 2025-11-25.
Full support for:
-
Tools - Expose callable functions to AI clients
-
Resources - Share data and files with templates and subscriptions
-
Prompts - Provide reusable prompt templates
-
Sampling - Request LLM completions from clients
-
Elicitation - Request additional information from clients
-
Progress - Send progress notifications during long-running operations
-
Cancellation - Handle client-requested cancellations gracefully
-
Roots - Discover client working directories
Getting Started
Choose your transport and create your first MCP server:
# STDIO transport (for local clients like Claude Desktop)
mvn io.quarkus:quarkus-maven-plugin:3.27.2:create \
-Dextensions="io.quarkiverse.mcp:quarkus-mcp-server-stdio:1.9.0"
# HTTP transport (for web-based clients)
mvn io.quarkus:quarkus-maven-plugin:3.27.2:create \
-Dextensions="io.quarkiverse.mcp:quarkus-mcp-server-http:1.9.0"
Then follow one of our tutorials:
-
Build a native MCP server with STDIO - Perfect for desktop integrations
-
Build an HTTP-based MCP server - Ideal for web services
Key Features
Declarative Tool Definition
Use annotations to define tools with minimal code:
@Tool(description = "Calculate the sum of two numbers")
int add(
@ToolArg(description = "First number") int a,
@ToolArg(description = "Second number") int b
) {
return a + b;
}
JSON schema generation, parameter validation, and error handling are automatic.
Multiple Server Configurations
Run multiple isolated MCP servers in a single application:
public class MultiServerTools {
@Tool(description = "Public API")
String publicTool() {
return "Available to all clients";
}
@McpServer("admin")
@Tool(description = "Admin API")
String adminTool() {
return "Requires authentication";
}
}
Each server can have different endpoints, security policies, and features.
Community & Support
-
Questions? Ask on Quarkus Discussions
-
Found a bug? Open an issue
-
Want to contribute? Go to the GitHub Project, and open your first pull request