Dev MCP
|
Experimental
この機能は現在、実験的です。 |
概要
Quarkus アプリケーションを dev モードで実行すると、Model Context Protocol (MCP) サーバーを公開できます。これは、Dev UI の MCP ツール (呼び出し可能なメソッド) で使用されるメソッドと、 MCP リソース によって公開されるデータを提示します。
Connecting a coding agent (Recommended)
The recommended way to connect an AI coding agent to your Quarkus application is through the Quarkus Agent MCP server. This standalone MCP server provides a complete development experience and is the preferred integration method for all AI coding agents.
The Quarkus Agent MCP server offers significant advantages over direct connection:
-
Project scaffolding — Create new Quarkus applications with customizable extensions
-
Application lifecycle management — Start, stop, and restart your application, with automatic recovery from crashes
-
Dev MCP proxy — Access all Dev MCP tools from the running application
-
Documentation search — Semantic search across Quarkus documentation using embeddings
-
Extension skills — Get extension-specific coding patterns, best practices, and testing guidelines
-
Version management — Check for updates and get upgrade reports
The Quarkus Agent MCP server requires JBang. Make sure JBang is installed before configuring your agent:
jbang version
If JBang is not installed, follow the instructions at jbang.dev/download.
Most coding agents use stdio transport — for example, with Claude Code:
claude mcp add quarkus-agent -- jbang quarkus-agent-mcp@quarkusio
Open the Dev UI settings dialog and select the Dev MCP tab to see configuration snippets for all supported agents and IDEs (Claude Code, OpenCode, Cline, Goose, Zed, VS Code, Cursor, Claude Desktop, Windsurf, and JetBrains IDEs).
Direct connection (Advanced)
For advanced use cases or when you need to connect an MCP client directly to a running application without the Quarkus Agent, you can connect to the Dev MCP endpoint directly.
Open the Dev UI settings dialog, select the Dev MCP tab, and enable Dev MCP.
The connection details (default http://localhost:8080/q/dev-mcp) and per-agent configuration snippets are available under the Direct connection section.
Any MCP client that supports the Streamable Protocol, version 2025‑03‑26 can connect using that URL. After a client connects, it will appear on the tab.
| Direct connection does not provide application lifecycle management, documentation search, or extension skills. For full Quarkus development support, use the Quarkus Agent MCP server. |
エクステンション開発者向けガイド
エクステンションは、Dev MCP サーバーに追加のツールやリソースを提供できます。統合方法は Dev UI への提供と似ていますが、説明 (description) が必須です。単一の JSON‑RPC サービスを Dev UI と Dev MCP の両方に使用できます。説明のないメソッドは Dev UI にのみ表示され、説明のあるメソッドは両方に表示されます。
Extension skills
Extensions can ship a quarkus-skill.md file to provide AI coding agents with extension-specific coding guidelines, testing patterns, and common pitfalls. During the Quarkus build, all skill files are automatically discovered, composed with extension metadata (name, description, guide URL, categories), and aggregated into a single io.quarkus:quarkus-extension-skills JAR following the Agent Skills specification. This JAR is published to Maven Central with each Quarkus release and is compatible with SkillsJars.
Adding a skill file to your extension
Place a quarkus-skill.md file in your extension’s deployment module at:
my-extension/deployment/src/main/resources/META-INF/quarkus-skill.md
That’s it. No pom.xml changes are needed. The Quarkus build automatically discovers all quarkus-skill.md files across all extensions and aggregates them into the quarkus-extension-skills artifact.
If your extension’s runtime module has a description field in META-INF/quarkus-extension.yaml, it will be included in the composed skill’s YAML frontmatter to help AI agents discover and understand your extension. The categories field under metadata is also included, allowing AI agents to group skills by category. While optional, providing a description and categories is recommended:
name: "My Extension"
description: "A concise description of what this extension does"
artifact: ${project.groupId}:${project.artifactId}:${project.version}
metadata:
guide: "https://quarkus.io/guides/my-extension"
categories:
- "web"
The file should contain concise, actionable Markdown content. Focus on what an AI agent needs to know to use your extension correctly:
-
Key patterns — how to use the main APIs, annotations, and CDI beans.
-
Testing — how to write tests using
@QuarkusTest, Dev Services, and extension-specific test utilities. -
Common pitfalls — mistakes that agents (and developers) frequently make.
Example for a hypothetical extension:
### Data Access
- Inject `MyClient` with `@Inject` — it is an `@ApplicationScoped` CDI bean.
- Use `client.query("...")` for read operations.
- Always wrap write operations in `@Transactional`.
### Testing
- Use `@QuarkusTest` — Dev Services starts a backing service automatically.
- Inject `MyClient` in tests for direct assertions.
### Common Pitfalls
- Do NOT create `MyClient` manually with `new` — always let CDI inject it.
- Do NOT set the connection URL without a `%prod.` profile prefix — this disables Dev Services.
What gets composed
The skill file content is not shipped as-is. During the Quarkus build, the aggregate-skills goal scans the source tree for all quarkus-skill.md files and composes each one with extension metadata to produce a SKILL.md file at META-INF/skills/{extension-name}/SKILL.md inside the aggregated JAR. The composed document follows the Agent Skills specification and includes:
-
YAML frontmatter — the skill name, extension description from
quarkus-extension.yaml, license, guide URL, and categories as structured metadata for agent discovery. -
Skill body — the patterns, testing guidelines, and pitfalls authored by the extension developer.
-
Dev MCP tools — the skill is automatically enriched with an "Available Dev MCP Tools" section listing each MCP tool the extension enables by default, including tool names, descriptions, and parameters. Tools are discovered from runtime methods annotated with both
@JsonRpcDescriptionand@DevMCPEnableByDefault, and from deployment processor classes annotated with@DevMcpBuildTimeTool.
Example of a composed SKILL.md:
---
name: quarkus-my-extension
description: "A brief description of the extension from quarkus-extension.yaml"
license: Apache-2.0
metadata:
guide: https://quarkus.io/guides/my-extension
categories: "web, data"
---
### Data Access
...
### Available Dev MCP Tools
| Tool | Description | Parameters |
|------|-------------|------------|
| `quarkus-my-extension_getData` | Get current status | — |
| `quarkus-my-extension_updateValue` | Update a value | `name` (required): The name, `value` (required): The new value |
The Dev MCP tools section is appended during the Quarkus build by the aggregate-skills Maven goal. Only tools that are enabled by default are included. All modules are scanned via Jandex on compiled classes. The enriched skills are baked into the quarkus-extension-skills JAR published with each Quarkus release.
For runtime methods, add both @JsonRpcDescription and @DevMCPEnableByDefault annotations on the method (see [MCP Tools against the Runtime classpath]).
For deployment build-time actions, annotate the processor class with @DevMcpBuildTimeTool:
@DevMcpBuildTimeTool(name = "updateProperty", (1)
description = "Update a configuration property", (2)
params = {
@DevMcpParam(name = "name", description = "The property name"), (3)
@DevMcpParam(name = "value", description = "The new value")
})
public class ConfigurationProcessor {
// ...
}
| 1 | The tool name, matching the methodName in the builder chain. |
| 2 | A human-readable description of what this tool does. |
| 3 | Parameter descriptions. Use required = false for optional parameters. |
The annotation is repeatable — add one per tool on the same class. This is the deployment-classpath counterpart of @JsonRpcDescription + @DevMCPEnableByDefault used on runtime methods.
What NOT to put in the skill file
-
Extension description or guide links — these are automatically added from
quarkus-extension.yaml. -
Configuration properties — reference the guide instead. A link is auto-generated.
-
Obvious instructions — focus on Quarkus-specific patterns and gotchas, not generic advice.
MCP ツール
ツールは、クライアントが呼び出すことができるメソッドに対応します。メソッドとそのパラメーターに説明を指定することで、任意の JSON‑RPC メソッドをツールとして公開できます。ツールはランタイムまたはデプロイメントのクラスパスのいずれかで実行できます。
ランタイムクラスパスに対する MCP ツール
実行時の情報やアクション (ログレベルの変更など) を公開するには、ランタイムモジュールまたは runtime-dev モジュールで JSON‑RPC サービス を定義し、メソッドとパラメーターに @JsonRpcDescription アノテーションを付けます。
public class MyExtensionRPCService {
@JsonRpcDescription("Update a specific logger's level in this Quarkus application") (1)
public JsonObject updateLogLevel(
@JsonRpcDescription("The logger name as defined in the logging implementation") String loggerName,
@JsonRpcDescription("The new log level") String levelValue) { (2)
// implementation…
}
}
| 1 | メソッドの説明。 |
| 2 | 各パラメーターの説明。 |
デフォルトではこのツールは無効になっており、ユーザーは Dev UI で有効にする必要があります。メソッドに @DevMCPEnableByDefault アノテーションを付けることで、このデフォルトを変更できます。
デプロイメントモジュールで JSON‑RPC サービスを登録する必要があります。
@BuildStep
JsonRPCProvidersBuildItem registerRpcService() { (1)
return new JsonRPCProvidersBuildItem(MyExtensionRPCService.class); (2)
}
| 1 | JsonRPCProvidersBuildItem を生成します。 |
| 2 | ランタイムモジュールまたは runtime-dev モジュール内の、メソッドを含むクラスを指定します。 |
Dev MCP では @JsonRpcDescription が必須です。これがない場合、メソッドは Dev UI でのみ利用可能になります。メソッドはプリミティブ、String、JsonObject、JsonArray、または JSON にシリアライズ可能な任意の POJO を返すことができます。非同期メソッド (Uni、CompletionStage、または @NonBlocking アノテーションが付いたメソッド) もサポートされています。
デプロイメントクラスパスに対する MCP ツール
デプロイメントクラスパス上で アクションを実行 する必要がある場合があります (設定ファイルの書き込みなど)。その場合、JSON‑RPC サービスは作成せず、代わりに BuildTimeActionBuildItem を介してサプライヤーを提供します。
@BuildStep(onlyIf = IsLocalDevelopment.class)
BuildTimeActionBuildItem createBuildTimeActions() {
BuildTimeActionBuildItem actions = new BuildTimeActionBuildItem();
actions.actionBuilder()
.methodName("updateProperty")
.description("Update a configuration/property in the Quarkus application") (1)
.parameter("name", "The name of the configuration/property to update") (2)
.parameter("value", "The new value for the configuration/property")
.function(map -> {
Map<String, String> values = Collections.singletonMap(
map.get("name"), map.get("value"));
updateConfig(values);
return true;
})
.build();
return actions;
}
| 1 | メソッドの説明。 |
| 2 | 各パラメーターの説明。 |
function 内のコードはデプロイメントクラスパスで実行されます。この関数は、プレーンな値、または非同期処理のための CompletionStage もしくは CompletableFuture を返すことができます。
By default this tool will be disabled, and the user has to enable it in Dev UI. You can change this default by adding .enableMcpFunctionByDefault() in the builder method.
MCP リソース
リソースとは、エクステンションによって公開されるデータのことです。リソースを作成するには 2 つの方法があります。
ビルド時データに対する MCP リソース
Dev UI にすでに公開されているビルド時データは、Dev MCP でも利用可能にできます。addBuildTimeData() を呼び出すときに説明を指定してください。
footerPageBuildItem.addBuildTimeData(
"jokes",
jokesBuildItem.getJokes(),
"Some funny jokes that the user might enjoy"
);
追加の description 引数は新しいものです。これがない場合、データは Dev UI にのみ表示されます。指定されると、jokes データは MCP リソースになりますが、デフォルトではこのリソースは無効になっています。説明の後の別のパラメーターとして true を渡すことで、デフォルトを有効に変更できます。ユーザーはどのみち Dev UI でこれを変更できるため、これは単に適切なデフォルト設定にすぎません。
footerPageBuildItem.addBuildTimeData(
"jokes",
jokesBuildItem.getJokes(),
"Some funny jokes that the user might enjoy",
true
);
記録された値に対する MCP リソース
記録された値 (レコーダーによって実行時に生成されたデータ) を MCP リソースとして公開するには、デプロイメントモジュールで ビルド時アクション を定義します。アクションには説明を含める必要があります。
@BuildStep(onlyIf = IsLocalDevelopment.class)
BuildTimeActionBuildItem createBuildTimeActions() {
BuildTimeActionBuildItem item = new BuildTimeActionBuildItem(); (1)
item.actionBuilder() (2)
.methodName("getMyRecordedValue")
.description("A well‑thought‑out description") (3)
.runtime(runtimeValue) (4)
.build();
return item;
}
| 1 | BuildTimeActionBuildItem を返すか、生成します。 |
| 2 | ビルダーを使用してアクションを設定します。 |
| 3 | 人間が読み取り可能な説明を設定します。 |
| 4 | レコーダーによって返される実行時の値を指定します。 |
By default this resource will be disabled, and the user has to enable it in Dev UI. You can change this default by adding .enableMcpFunctionByDefault() in the builder method.