Quarkus MCP Server

Quarkus MCP Server

Sets conventions for building MCP servers in Java with Quarkus, covering project structure, tool definitions, error handling and transports.


applyTo: '**/*.java, */application.properties, */application.yml, */application.yaml'
description: 'Quarkus MCP Server development standards and instructions, with Streamable HTTP (preferred) and legacy HTTP SSE transports'


Quarkus MCP Server

Apply these instructions only when the project uses a Quarkus MCP Server extension (mcp-server-http, or the legacy mcp-server-sse).

Build MCP servers with Java 21, Quarkus, and Streamable HTTP transport (legacy HTTP SSE is also supported).

Stack

  • Java 21 with Quarkus Framework
  • MCP Server Extension: mcp-server-http (io.quarkiverse.mcp:quarkus-mcp-server-http), which serves both transports: legacy HTTP/SSE at http://localhost:8080/mcp/sse and Streamable HTTP (preferred; SSE is deprecated in the MCP spec) at http://localhost:8080/mcp
  • mcp-server-sse is not managed by recent Quarkus platform BOMs (verified: absent from 3.40.1); the Quarkus CLI silently falls back to an older platform stream when asked for it. Use it only to keep an existing project that already depends on it.
  • CDI for dependency injection

Quick Start

quarkus create app --no-code -x rest-client-jackson,qute,mcp-server-http your-domain-mcp-server

Structure

  • Use standard Java naming conventions (PascalCase classes, camelCase methods)
  • Organize in packages: model, repository, service, mcp
  • Use Record types for immutable data models
  • State management for immutable data must be managed by repository layer
  • Add Javadoc for public methods

MCP Tools

  • Must be public methods in @ApplicationScoped CDI beans
  • Use @Tool(name="tool_name", description="clear description")
  • Never return null - return error messages instead
  • Always validate parameters and handle errors gracefully

Architecture

  • Separate concerns: MCP tools → Service layer → Repository
  • Use constructor injection (@Inject is optional on a single constructor)
  • Make data operations thread-safe
  • Use Optional<T> to avoid null pointer exceptions

Common Issues

  • Don't put business logic in MCP tools (use service layer)
  • For expected business errors throw io.quarkiverse.mcp.server.ToolCallException (its message becomes a failed tool result); don't let other unhandled exceptions escape, as they are reported as generic internal errors
  • Don't forget to validate input parameters
  • Test with edge cases (null, empty inputs)

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 13,363 prompts

More by @OpenSourceBuffGuy

See all
Black and white typographic profile portrait poster prompt image

Black and white typographic profile portrait poster

Creates a black and white typographic poster of a side-profile portrait built from ink-rough silhouette blocks, with your own text fused into the neck and body.

image-prompt, poster, typography, black-and-white, portrait, editorial, placeholders, template, text-rendering, ink-drawing, printmaking, negative-space, vertical-format, minimalist, logo, graphic-design, gpt-image, chatgpt, for-designers, for-artists, quick, silhouette, symmetry

Bearded hero sprints from exploding armored vehicle in rain prompt image

Bearded hero sprints from exploding armored vehicle in rain

Generates a seven-second action sequence of a bearded hero fleeing an exploding armored vehicle in a rainy alley, with timed beats, camera moves and negatives.

video-prompt, action, timed-beats, multi-shot, handheld, camera-movement, tracking-shot, cinematic, night-scene, rain, visual-effects, dramatic-lighting, motion-blur, negative-prompt, man, kling, photorealistic, cityscape, moody, trailer

Kaohsiung watercolor collage travel poster at sunset prompt image

Kaohsiung watercolor collage travel poster at sunset

Draws a vertical watercolour and photo-collage travel poster of Kaohsiung at sunset, with exact text strings placed in each corner and teal-beige overlays.

image-prompt, poster, watercolor, collage, typography, text-rendering, travel, cityscape, landmarks, vertical-format, pastel, golden-hour, illustration, ocean, graphic-design, gpt-image, chatgpt, for-designers, for-travelers

Reviews

Loading reviews…

Discussion

Loading comments…