Home › All rules › Community › Quarkus Mcp Server Sse Copilot Instructions

Quarkus Mcp Server Sse Copilot Instructions

Quarkus MCP Server development standards and instructions, with Streamable HTTP (preferred) and legacy HTTP SSE transports

GitHub CopilotAny stackCommunity (MIT)

How to use

Save this as .github/instructions/quarkus-mcp-server-sse.instructions.md in your project, commit it, and GitHub Copilot will apply it to matching files. Review it first: community files can be opinionated or out of date.

Note: Review and test before use. Provided as is, without warranty. See Terms.

.github/instructions/quarkus-mcp-server-sse.instructions.mdDownload  
---
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)

More: Any stack rules · all community rules

Related rules

Agent safety guardrails Windsurf rules

Always-on Windsurf rules that stop agents from running destructive, costly, or externally visible actions without approval.

WindsurfAny stack

Universal vibe-coding guardrails

Always-on Cursor rules that keep any AI agent careful: plan first, small diffs, verify, never fake it.

CursorAny stack

Prototype-to-production hardening AGENTS.md

AGENTS.md checklist for turning a vibe-coded prototype into a production-ready app: security, data, tests, and ops.

AGENTS.mdAny stack

Ascii Simulation Game Cursor Rules

Cursor rules for ASCII simulation game development.

CursorAny stackCommunity (CC0)

Clean Code Cursor Rules

Guidelines for writing clean, maintainable, and human-readable code. Apply these rules when writing or reviewing code to ensure consistency and quality.

CursorAny stackCommunity (CC0)

Code Guidelines Cursor Rules

Cursor rules for code development with guidelines integration.

CursorAny stackCommunity (CC0)

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.