You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pure Java implementation of the [Agent Client Protocol (ACP)](https://agentclientprotocol.com/) specification for building both clients and agents.
4
6
5
7
## Overview
6
8
7
-
The Agent Client Protocol (ACP) standardizes communication between code editors and coding agents. This SDK enables Java applications to:
9
+
The Agent Client Protocol (ACP) standardizes communication between code editors and coding agents. This SDK provides two modules:
10
+
11
+
-**Client** — connect to and interact with ACP-compliant agents
12
+
-**Agent** — build ACP-compliant agents in Java
13
+
14
+
Three API styles for building agents:
8
15
9
-
-**Connect to** ACP-compliant agents (Client SDK)
10
-
-**Build** ACP-compliant agents in Java (Agent SDK)
16
+
| Style | Best for | Example |
17
+
|-------|----------|---------|
18
+
|[**Annotation-based**](#2-hello-world-agent-annotation-based)| Least boilerplate — `@AcpAgent`, `@Prompt` annotations |[Jump to example](#2-hello-world-agent-annotation-based)|
19
+
|[**Sync**](#3-hello-world-agent-sync)| Simple blocking handlers with plain return values |[Jump to example](#3-hello-world-agent-sync)|
20
+
|[**Async**](#4-hello-world-agent-async)| Reactive applications using Project Reactor `Mono`|[Jump to example](#4-hello-world-agent-async)|
11
21
12
22
**Key Features:**
13
-
- Java 17+, reactive (Project Reactor), type-safe
14
-
- Async and sync APIs
15
-
- Stdio and WebSocket transports
23
+
- Java 17+, type-safe, stdio and WebSocket transports
16
24
- Capability negotiation and structured error handling
17
-
-**[Annotation-based agents](acp-agent-support/README.md)** - Spring MVC-style `@AcpAgent`, `@Prompt` annotations
25
+
-For a hands-on walkthrough, see the **[ACP Java Tutorial](https://github.com/markpollack/acp-java-tutorial)**
18
26
19
27
## Installation
20
28
21
-
> **Note:** Not yet published to Maven Central. For now, build and install locally using `./mvnw install`.
29
+
Published to Maven Central:
22
30
23
31
```xml
24
32
<dependency>
@@ -52,7 +60,7 @@ For WebSocket server support (agents accepting WebSocket connections):
52
60
53
61
### 1. Hello World Client
54
62
55
-
Connect to an ACP agent and send a prompt:
63
+
Connect to an ACP agent and send a prompt ([tutorial](https://github.com/markpollack/acp-java-tutorial/tree/main/module-01-first-contact)):
56
64
57
65
```java
58
66
importcom.agentclientprotocol.sdk.client.*;
@@ -78,9 +86,45 @@ var response = client.prompt(new PromptRequest(
78
86
client.close();
79
87
```
80
88
81
-
### 2. Hello World Agent (Sync)
89
+
### 2. Hello World Agent (Annotation-Based)
90
+
91
+
The simplest way to build an agent — use annotations ([tutorial](https://github.com/markpollack/acp-java-tutorial/tree/main/module-12-echo-agent)):
Create a minimal ACP agent using the sync API (recommended for simplicity):
127
+
The builder API with blocking handlers and plain return values ([tutorial](https://github.com/markpollack/acp-java-tutorial/tree/main/module-13-agent-handlers)):
For reactive applications, use the async API with Project Reactor ([tutorial](https://github.com/markpollack/acp-java-tutorial/tree/main/module-22-async-agent)):
Send real-time updates to the client during prompt processing (tutorial: [client-side](https://github.com/markpollack/acp-java-tutorial/tree/main/module-05-streaming-updates), [agent-side](https://github.com/markpollack/acp-java-tutorial/tree/main/module-14-sending-updates)).
Agents can request file operations from the client. The `context` parameter provides access to all agent capabilities.
248
+
Agents can request file operations from the client ([tutorial](https://github.com/markpollack/acp-java-tutorial/tree/main/module-15-agent-requests)). The `context` parameter provides access to all agent capabilities.
Check what features the peer supports before using them:
287
+
Check what features the peer supports before using them ([tutorial](https://github.com/markpollack/acp-java-tutorial/tree/main/module-17-capability-negotiation)):
272
288
273
289
```java
274
290
// Client: check agent capabilities after initialize
|[`acp-test`](https://central.sonatype.com/artifact/com.agentclientprotocol/acp-test)| In-memory transport and mock utilities for testing |
396
+
|[`acp-websocket-jetty`](https://central.sonatype.com/artifact/com.agentclientprotocol/acp-websocket-jetty)| Jetty-based WebSocket server transport for agents |
For a hands-on, progressive introduction to the SDK, see the **[ACP Java Tutorial](https://github.com/markpollack/acp-java-tutorial)** -- 30 modules covering client basics, agent development, streaming, testing, and IDE integration.
Copy file name to clipboardExpand all lines: acp-agent-support/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# ACP Agent Support Module
2
2
3
-
The `acp-agent-support` module provides a Spring MVC-style annotation-based programming model for building ACP agents. It eliminates boilerplate code while maintaining full compatibility with the builder-based API from `acp-core`.
3
+
The `acp-agent-support` module provides an annotation-based programming model for building ACP agents. It eliminates boilerplate code while maintaining full compatibility with the builder-based API from `acp-core`.
0 commit comments