Skip to content

Commit 9eef73e

Browse files
committed
Better handling of docker tools in startup scripts.
1 parent cea2256 commit 9eef73e

File tree

16 files changed

+393
-88
lines changed

16 files changed

+393
-88
lines changed

README.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,21 @@ export ANTHROPIC_API_KEY="your_anthropic_key"
5555
#### **Kotlin Examples**
5656
```bash
5757
cd scripts/kotlin
58-
./shell.sh # Unix/Linux/macOS
59-
shell.cmd # Windows
58+
./shell.sh # Unix/Linux/macOS - Basic features
59+
shell.cmd # Windows - Basic features
60+
61+
./shell.sh --docker-tools # Unix/Linux/macOS - With Docker integration
62+
shell.cmd --docker-tools # Windows - With Docker integration
6063
```
6164

6265
#### **Java Examples**
6366
```bash
6467
cd scripts/java
65-
./shell.sh # Unix/Linux/macOS
66-
shell.cmd # Windows
68+
./shell.sh # Unix/Linux/macOS - Basic features
69+
shell.cmd # Windows - Basic features
70+
71+
./shell.sh --docker-tools # Unix/Linux/macOS - With Docker integration
72+
shell.cmd --docker-tools # Windows - With Docker integration
6773
```
6874

6975
---
@@ -380,28 +386,33 @@ See:
380386

381387
### **Interactive Shell Mode** (Default)
382388
```bash
383-
cd scripts/kotlin && ./shell.sh
389+
cd scripts/kotlin && ./shell.sh # Basic features
390+
cd scripts/kotlin && shell.cmd # Basic features (Windows)
384391
# or
385-
cd scripts/java && ./shell.sh
392+
cd scripts/java && ./shell.sh # Basic features
393+
cd scripts/java && shell.cmd # Basic features (Windows)
386394
```
387395

388396
Uses Maven profile: `enable-shell`
389397

390398
### **Shell with MCP Client Support**
391399
```bash
392-
cd scripts/kotlin && ./shell_mcp_client.sh
400+
cd scripts/kotlin && ./shell.sh --docker-tools # Advanced Docker integration
401+
cd scripts/kotlin && shell.cmd --docker-tools # Advanced Docker integration (Windows)
393402
# or
394-
cd scripts/java && ./shell_mcp_client.sh # Unix/Linux/macOS
395-
cd scripts/java && shell_mcp_client.cmd # Windows
403+
cd scripts/java && ./shell.sh --docker-tools # Advanced Docker integration
404+
cd scripts/java && shell.cmd --docker-tools # Advanced Docker integration (Windows)
396405
```
397406

398407
Uses Maven profile: `enable-shell-mcp-client`
399408

400409
### **MCP Server Mode**
401410
```bash
402411
cd scripts/kotlin && ./mcp_server.sh
412+
cd scripts/kotlin && mcp_server.cmd # Windows
403413
# or
404-
cd scripts/java && ./mcp_server.cmd
414+
cd scripts/java && ./mcp_server.sh
415+
cd scripts/java && mcp_server.cmd # Windows
405416
```
406417

407418
Uses Maven profile: `enable-agent-mcp-server`
@@ -465,10 +476,12 @@ Your agents become available as tools:
465476

466477
### **MCP Client Support**
467478

468-
Enable your agents to use external MCP tools:
479+
Enable your agents to use external MCP tools by using the `--docker-tools` parameter:
469480

470-
```kotlin
471-
@EnableAgents(mcpServers = [McpServers.DOCKER_DESKTOP, McpServers.DOCKER])
481+
```bash
482+
# Enable Docker Desktop MCP integration
483+
cd scripts/kotlin && ./shell.sh --docker-tools
484+
cd scripts/java && ./shell.sh --docker-tools
472485
```
473486

474487
This allows your agents to:
@@ -591,12 +604,10 @@ embabel-agent-examples/
591604
├── examples-common/ # 🔧 Shared services & utilities
592605
├── scripts/ # 🚀 Quick-start scripts
593606
│ ├── kotlin/
594-
│ │ ├── shell.sh # Launch basic shell
595-
│ │ ├── shell_mcp_client.sh # Launch shell with MCP client
607+
│ │ ├── shell.sh # Launch shell (with --docker-tools option)
596608
│ │ └── mcp_server.sh # Launch MCP server
597609
│ ├── java/
598-
│ │ ├── shell.sh # Launch basic shell
599-
│ │ ├── shell_mcp_client.cmd # Launch shell with MCP client
610+
│ │ ├── shell.sh # Launch shell (with --docker-tools option)
600611
│ │ └── mcp_server.sh # Launch MCP server
601612
│ ├── support/ # Shared script utilities
602613
│ └── README.md # 📖 Scripts documentation
@@ -611,4 +622,4 @@ Licensed under the Apache License 2.0. See [LICENSE](LICENSE) for details.
611622

612623
**🎉 Happy coding with Spring Framework and agentic AI!**
613624

614-
### 🌟 May the Force be with your agents! 🌟
625+
### 🌟 May the Force be with your agents! 🌟

examples-java/README.md

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ This module contains Java implementations of Embabel Agent examples, demonstrati
1212
### Running Examples
1313

1414
```bash
15-
# Interactive Shell Mode (recommended for development)
15+
# Interactive Shell Mode - Basic features (recommended for development)
1616
cd ../scripts/java
1717
./shell.sh # Unix/Linux/macOS
1818
shell.cmd # Windows
1919

20+
# Interactive Shell Mode - With Docker integration
21+
cd ../scripts/java
22+
./shell.sh --docker-tools # Unix/Linux/macOS
23+
shell.cmd --docker-tools # Windows
24+
2025
# Or run directly with Maven
2126
mvn spring-boot:run -Dspring-boot.run.main-class=com.embabel.example.AgentShellApplication
2227
```
@@ -26,14 +31,15 @@ mvn spring-boot:run -Dspring-boot.run.main-class=com.embabel.example.AgentShellA
2631
```
2732
examples-java/
2833
├── src/main/java/com/embabel/example/
29-
│ ├── AgentShellApplication.java # Interactive shell with Star Wars logging
30-
│ ├── AgentMcpApplication.java # MCP server for Claude Desktop integration
31-
│ └── horoscope/ # 🌟 Horoscope news finder example
32-
│ ├── StarNewsFinder.java # Main agent implementation
33-
│ ├── model/ # Domain models
34-
│ └── service/ # Supporting services
34+
│ ├── AgentShellApplication.java # Basic shell with Star Wars logging
35+
│ ├── AgentShellMcpClientApplication.java # Shell with Docker integration
36+
│ ├── AgentMcpApplication.java # MCP server for Claude Desktop integration
37+
│ └── horoscope/ # 🌟 Horoscope news finder example
38+
│ ├── StarNewsFinder.java # Main agent implementation
39+
│ ├── model/ # Domain models
40+
│ └── service/ # Supporting services
3541
└── src/main/resources/
36-
└── application.yml # Configuration
42+
└── application.yml # Configuration
3743
```
3844

3945
## 🎯 Available Example
@@ -106,6 +112,7 @@ spring:
106112
107113
### Interactive Shell (Development)
108114
115+
**Basic Shell Mode:**
109116
```java
110117
import com.embabel.agent.config.annotation.LoggingThemes;
111118

@@ -125,6 +132,27 @@ Features:
125132
- Real-time execution feedback
126133
- Debug options with `-p` and `-r` flags
127134

135+
**Shell with Docker Integration:**
136+
```java
137+
@SpringBootApplication
138+
@EnableAgentShell
139+
@EnableAgents(
140+
loggingTheme = LoggingThemes.STAR_WARS,
141+
mcpServers = {McpServers.DOCKER_DESKTOP}
142+
)
143+
public class AgentShellMcpClientApplication {
144+
public static void main(String[] args) {
145+
SpringApplication.run(AgentShellMcpClientApplication.class, args);
146+
}
147+
}
148+
```
149+
150+
Features:
151+
- All basic shell features
152+
- Docker Desktop MCP integration
153+
- Container execution capabilities
154+
- Enhanced tool access
155+
128156
### MCP Server (Integration)
129157
```java
130158
@SpringBootApplication
@@ -231,6 +259,7 @@ class StarNewsFinderTest {
231259
| `ClassNotFoundException` | Run `mvn clean install` from project root |
232260
| `Port already in use` | Change port with `--server.port=8081` |
233261
| `Bean creation error` | Check Spring profile configuration |
262+
| `WARNING: Only Basic Agent features` | Use `--docker-tools` parameter to enable Docker integration |
234263

235264
## 📊 Comparison with Kotlin Examples
236265

@@ -261,4 +290,4 @@ When adding new Java examples:
261290

262291
## 📄 License
263292

264-
Licensed under Apache License 2.0. See [LICENSE](../../LICENSE) for details.
293+
Licensed under Apache License 2.0. See [LICENSE](../../LICENSE) for details.

examples-kotlin/README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ export ANTHROPIC_API_KEY="your_anthropic_key"
5555
#### **Kotlin Examples**
5656
```bash
5757
cd scripts/kotlin
58-
./shell.sh # Unix/Linux/macOS
59-
shell.cmd # Windows
58+
./shell.sh # Unix/Linux/macOS - Basic features
59+
shell.cmd # Windows - Basic features
60+
61+
./shell.sh --docker-tools # Unix/Linux/macOS - With Docker integration
62+
shell.cmd --docker-tools # Windows - With Docker integration
6063
```
6164

6265
---
@@ -315,28 +318,24 @@ data class AssertionCheck(
315318

316319
### **Interactive Shell Mode** (Default)
317320
```bash
318-
cd scripts/kotlin && ./shell.sh
319-
# or
320-
cd scripts/java && ./shell.sh
321+
cd scripts/kotlin && ./shell.sh # Basic features
322+
cd scripts/kotlin && shell.cmd # Basic features (Windows)
321323
```
322324

323325
Uses Maven profile: `enable-shell`
324326

325327
### **Shell with MCP Client Support**
326328
```bash
327-
cd scripts/kotlin && ./shell_mcp_client.sh
328-
# or
329-
cd scripts/java && ./shell_mcp_client.sh # Unix/Linux/macOS
330-
cd scripts/java && shell_mcp_client.cmd # Windows
329+
cd scripts/kotlin && ./shell.sh --docker-tools # Advanced Docker integration
330+
cd scripts/kotlin && shell.cmd --docker-tools # Advanced Docker integration (Windows)
331331
```
332332

333333
Uses Maven profile: `enable-shell-mcp-client`
334334

335335
### **MCP Server Mode**
336336
```bash
337337
cd scripts/kotlin && ./mcp_server.sh
338-
# or
339-
cd scripts/java && ./mcp_server.cmd
338+
cd scripts/kotlin && mcp_server.cmd # Windows
340339
```
341340

342341
## 🌐 **MCP (Model Context Protocol) Support**
@@ -364,10 +363,11 @@ Your agents become available as tools:
364363

365364
### **MCP Server Support**
366365

367-
Enable your agents to connect to external MCP servers:
366+
Enable your agents to connect to external MCP servers using the `--docker-tools` parameter:
368367

369-
```kotlin
370-
@EnableAgents(mcpServers = [McpServers.DOCKER_DESKTOP])
368+
```bash
369+
# Enable Docker Desktop MCP integration
370+
cd scripts/kotlin && ./shell.sh --docker-tools
371371
```
372372

373373
This allows your agents to:
@@ -465,6 +465,7 @@ fun main(args: Array<String>) {
465465
| **Tests fail** | Check API keys are set in test environment |
466466
| **Application class not found** | Check Maven profile matches application class |
467467
| **MCP server fails to start** | Check port availability and Docker Desktop status |
468+
| **WARNING: Only Basic Agent features** | Use `--docker-tools` parameter to enable Docker integration |
468469

469470
---
470471

@@ -485,8 +486,7 @@ embabel-agent-examples/
485486
├── examples-common/ # 🔧 Shared services & utilities
486487
├── scripts/ # 🚀 Quick-start scripts
487488
│ ├── kotlin/
488-
│ │ ├── shell.sh # Launch basic shell
489-
│ │ ├── shell_mcp_client.sh # Launch shell with MCP client
489+
│ │ ├── shell.sh # Launch shell (with --docker-tools option)
490490
│ │ └── mcp_server.sh # Launch MCP server
491491
│ ├── support/ # Shared script utilities
492492
│ └── README.md # 📖 Scripts documentation

0 commit comments

Comments
 (0)