Skip to main content
rule official · GitHub

quarkus-mcp-server-sse — GitHub Copilot rule for Quarkus

This rule guides development of Quarkus MCP servers, from tool methods to project structure. Use it in Java projects with a Quarkus MCP Server extension.

Install into GitHub Copilot · Manually: put the files in place All methods and platforms ↓
.github/instructions/quarkus-mcp-server-sse.instructions.md
Open on GitHub

What quarkus-mcp-server-sse does

The rule applies to Java source files and Quarkus settings in application.properties, application.yml, and application.yaml. It targets Java 21 and Quarkus, recommending Streamable HTTP through mcp-server-http; HTTP/SSE remains an option for existing projects. For a new server, it points to mcp-server-http rather than the legacy mcp-server-sse, which is absent from recent Quarkus platform BOMs.

Its guidance separates MCP tools, services, and repositories, and calls for constructor injection, immutable Record models, and public @Tool methods in CDI beans. Tool methods should validate inputs and return error messages instead of null. Expected business failures should use ToolCallException; business logic belongs in the service layer, not in the tool method.

This rule is intended for projects that use a Quarkus MCP Server extension. Starting a new project with mcp-server-sse can make the Quarkus CLI fall back to an older platform stream, so the recommended HTTP extension matters when choosing the setup.

What it helps with

  • organize a Quarkus MCP server into tool, service, and repository layers
  • define MCP tools as CDI bean methods with @Tool
  • handle expected tool failures with ToolCallException
  • validate tool inputs and cover edge cases

Example prompts for the agent

  • Create a Java 21 Quarkus MCP server using Streamable HTTP and follow this rule.
  • Move this MCP tool's business logic into the service layer, keeping the tool method focused on the call.
  • Review the @Tool methods for input validation and expected business errors handled with ToolCallException.

How to install quarkus-mcp-server-sse

Manually: put the files in place

.github/instructions/quarkus-mcp-server-sse.instructions.md

The applyTo field sets which files it applies to

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about quarkus-mcp-server-sse

How do I install quarkus-mcp-server-sse in GitHub Copilot?

Add .github/instructions/quarkus-mcp-server-sse.instructions.md to your repository.

What does quarkus-mcp-server-sse do?

It sets development conventions for Quarkus MCP servers, including code structure, tool methods, and error handling.

Which transport should I use for a new Quarkus MCP server?

The rule recommends Streamable HTTP with mcp-server-http. HTTP/SSE is retained for existing projects, while mcp-server-sse is absent from recent Quarkus platform BOMs.

Source text

quarkus-mcp-server-sse.instructions.md · MIT
---
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

```bash
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 · MIT · github/awesome-copilot

Similar IDE rules

All IDE rules for Backend and APIs →

From the same set928

The whole set →
ruby-on-rails Sets Rails architecture guidelines for GitHub Copilot across all Ruby files. It enforces thin controllers, service objects, and safe query patterns. ★ 40,418repo stars ruby-mcp-server This rule sets patterns for Ruby MCP servers built with the official mcp gem. Use it when adding tools, resources, prompts, or transports. ★ 40,418repo stars r Tells Copilot how to write R: follow the file's style, avoid unsafe calls, keep paths project-relative. Useful when a repo has .R, .Rmd or .qmd files. ★ 40,418repo stars quarkus Sets coding conventions for Quarkus applications in GitHub Copilot. Guides dependency injection, REST stack selection, and database testing. ★ 40,418repo stars qa-engineering-best-practices A GitHub Copilot instruction file covering test strategy, the test pyramid, naming, assertions and bug reports. Useful when Copilot writes or reviews tests in your repo. ★ 40,418repo stars python-mcp-server Instructions for GitHub Copilot to build Model Context Protocol servers using Python SDK v2. Keeps generation aligned with the 2026-07-28 protocol spec. ★ 40,418repo stars powershell A GitHub Copilot rule that pushes it toward idiomatic PowerShell scripts following Microsoft's cmdlet guidelines. Useful when your repo has .ps1 and .psm1 files. ★ 40,418repo stars powershell-pester-6 Directs GitHub Copilot to follow Pester v6 testing patterns in PowerShell. Useful when writing test suites in *.Tests.ps1 without outdated v5 habits. ★ 40,418repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor