Skip to content

Commit 7240893

Browse files
authored
Merge pull request #3 from MCDxAI/docs-update-command-prefix
Update command prefixes from / to . in documentation and error messages
2 parents 213ed2b + 77eaa9d commit 7240893

6 files changed

Lines changed: 61 additions & 61 deletions

File tree

CLAUDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This is a **Meteor Client addon** that bridges the **Model Context Protocol (MCP
1717
-**StarScript Integration**: Dynamic tool registration, argument conversion, result handling
1818
-**Async Execution**: Zero-blocking MCP calls via background threads (60+ FPS guaranteed)
1919
-**Gemini AI Integration**: Multi-turn conversations with automatic MCP tool calling
20-
-**Chat Commands**: Dynamic `/server:tool`, `/gemini`, and `/gemini-mcp` with help system
20+
-**Chat Commands**: Dynamic `.server:tool`, `.gemini`, and `.gemini-mcp` with help system
2121
-**GUI System**: Complete configuration screens for servers, tools, and Gemini settings
2222
-**Persistence**: NBT-based storage for all configurations
2323

@@ -143,9 +143,9 @@ MCPToolExecutor.execute()
143143

144144
#### Command Integration (`commands/`)
145145
- **`CommandUtils.java`**: Shared key=value/JSON parser plus chat output helpers for tool results
146-
- **`MCPToolCommand.java`**: Dynamic Brigadier command per MCP tool (`/server:tool …`) with help + suggestions
147-
- **`GeminiCommand.java`**: `/gemini "prompt"` chat command with async execution and per-player cooldown
148-
- **`GeminiMCPCommand.java`**: `/gemini-mcp "prompt"` with automatic MCP tool discovery and usage reporting
146+
- **`MCPToolCommand.java`**: Dynamic Brigadier command per MCP tool (`.server:tool …`) with help + suggestions
147+
- **`GeminiCommand.java`**: `.gemini "prompt"` chat command with async execution and per-player cooldown
148+
- **`GeminiMCPCommand.java`**: `.gemini-mcp "prompt"` with automatic MCP tool discovery and usage reporting
149149

150150
`MCPServers` mirrors StarScript registration by adding/removing `MCPToolCommand` instances whenever servers connect or disconnect, refreshing the Brigadier dispatcher to keep the chat tree accurate.
151151

GEMINI.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
**Core Purpose:**
88
1. **Connect:** Link Minecraft to external MCP servers (local or remote).
99
2. **Expose:** Make MCP tools available as StarScript functions (`{server.tool()}`).
10-
3. **Automate:** Use Gemini AI to intelligently orchestrate these tools via natural language (`/gemini-mcp`).
10+
3. **Automate:** Use Gemini AI to intelligently orchestrate these tools via natural language (`.gemini-mcp`).
1111

1212
## 2. Architecture & Data Flow
1313

@@ -42,9 +42,9 @@ graph TD
4242
MTE -->|Direct Call| MCPServer
4343
```
4444

45-
### 2.2 The "Enhanced" Gemini Flow (`/gemini-mcp`)
45+
### 2.2 The "Enhanced" Gemini Flow (`.gemini-mcp`)
4646

47-
When a user executes `/gemini-mcp "Get weather in Tokyo"`, the following sequence occurs in `GeminiExecutor`:
47+
When a user executes `.gemini-mcp "Get weather in Tokyo"`, the following sequence occurs in `GeminiExecutor`:
4848

4949
1. **Tool Collection:** The system retrieves all connected MCP servers and converts their tools into Gemini-compatible `FunctionDeclaration` objects using `MCPToGeminiBridge`.
5050
2. **Initial Request:** The prompt and tool definitions are sent to the Gemini API.
@@ -103,9 +103,9 @@ Once connected, tools are available globally:
103103
* `{weather.get_forecast("London", 3)}`
104104

105105
### 4.3 Chat Commands
106-
* `/gemini "Explain quantum physics"` (Simple text)
107-
* `/gemini-mcp "Check the weather in London and tell me if I need an umbrella"` (Uses connected tools)
108-
* `/time:get_current_time timezone="UTC"` (Auto-generated command for specific tool)
106+
* `.gemini "Explain quantum physics"` (Simple text)
107+
* `.gemini-mcp "Check the weather in London and tell me if I need an umbrella"` (Uses connected tools)
108+
* `.time:get_current_time timezone="UTC"` (Auto-generated command for specific tool)
109109

110110
## 5. Development
111111

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
</tr>
2929
<tr>
3030
<td><strong>Dynamic Chat Commands</strong></td>
31-
<td>Automatically registered <code>/serverName:toolName</code> commands with help and tab completion</td>
31+
<td>Automatically registered <code>.serverName:toolName</code> commands with help and tab completion</td>
3232
</tr>
3333
<tr>
3434
<td><strong>Gemini AI (Optional)</strong></td>
35-
<td>Direct requests with <code>/gemini</code> or MCP-enhanced requests with <code>/gemini-mcp</code></td>
35+
<td>Direct requests with <code>.gemini</code> or MCP-enhanced requests with <code>.gemini-mcp</code></td>
3636
</tr>
3737
</table>
3838

@@ -79,7 +79,7 @@
7979

8080
<table>
8181
<tr><td><code># Time queries</code></td></tr>
82-
<tr><td><code>/time:get_current_time timezone="UTC"</code></td></tr>
82+
<tr><td><code>.time:get_current_time timezone="UTC"</code></td></tr>
8383
</table>
8484

8585
<h2>Gemini AI Integration (Optional)</h2>
@@ -97,11 +97,11 @@
9797

9898
<table>
9999
<tr><td><strong>Simple prompts:</strong></td></tr>
100-
<tr><td><code>/gemini "Explain what StarScript is"</code></td></tr>
100+
<tr><td><code>.gemini "Explain what StarScript is"</code></td></tr>
101101
<tr><td><code>{gemini("What is the current Minecraft version?")}</code></td></tr>
102102
<tr><td><strong>MCP-enhanced prompts:</strong></td></tr>
103-
<tr><td><code>/gemini-mcp "Read my config.json and explain each setting"</code></td></tr>
103+
<tr><td><code>.gemini-mcp "Read my config.json and explain each setting"</code></td></tr>
104104
<tr><td><code>{gemini_mcp("Get the current time in Tokyo")}</code></td></tr>
105-
<tr><td>The <code>/gemini-mcp</code> command allows Gemini to automatically discover and call any connected MCP tool. Tool usage is reported in the response.</td></tr>
105+
<tr><td>The <code>.gemini-mcp</code> command allows Gemini to automatically discover and call any connected MCP tool. Tool usage is reported in the response.</td></tr>
106106
</table>
107107
</div>

ai_specs/COMMAND_INTEGRATION_SPEC.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
Add Minecraft chat command support for direct MCP tool invocation and Gemini AI interactions. This phase builds on the completed Gemini integration (Phase 2) and provides users with command-line access to:
66

7-
1. **Dynamic MCP Tool Commands**: Invoke any connected MCP server's tools via `/server:tool args`
8-
2. **Gemini Simple Command**: Quick AI queries via `/gemini "prompt"`
9-
3. **Gemini MCP Command**: AI queries with automatic MCP tool access via `/gemini-mcp "prompt"`
7+
1. **Dynamic MCP Tool Commands**: Invoke any connected MCP server's tools via `.server:tool args`
8+
2. **Gemini Simple Command**: Quick AI queries via `.gemini "prompt"`
9+
3. **Gemini MCP Command**: AI queries with automatic MCP tool access via `.gemini-mcp "prompt"`
1010

1111
**Design Philosophy**: Commands provide an alternative to StarScript expressions, offering:
1212
- Direct tool execution without StarScript syntax
@@ -20,7 +20,7 @@ Add Minecraft chat command support for direct MCP tool invocation and Gemini AI
2020

2121
### 1.1 MCP Tool Commands
2222

23-
**Pattern**: `/server_name:tool_name [arguments]`
23+
**Pattern**: `.server_name:tool_name [arguments]`
2424

2525
**Rationale**:
2626
- **Colon separator**: Clear namespace delimiter (inspired by Minecraft's `namespace:id` pattern)
@@ -58,16 +58,16 @@ Add Minecraft chat command support for direct MCP tool invocation and Gemini AI
5858

5959
### 1.2 Gemini Simple Command
6060

61-
**Pattern**: `/gemini "prompt"`
61+
**Pattern**: `.gemini "prompt"`
6262

6363
**Purpose**: Quick AI queries without MCP tool access
6464

6565
**Examples**:
6666

6767
```bash
68-
/gemini "What is the capital of France?"
69-
/gemini "Explain quantum computing in simple terms"
70-
/gemini "Write a haiku about Minecraft"
68+
.gemini "What is the capital of France?"
69+
.gemini "Explain quantum computing in simple terms"
70+
.gemini "Write a haiku about Minecraft"
7171
```
7272

7373
**Behavior**:
@@ -85,27 +85,27 @@ Add Minecraft chat command support for direct MCP tool invocation and Gemini AI
8585

8686
### 1.3 Gemini MCP Command
8787

88-
**Pattern**: `/gemini-mcp "prompt"`
88+
**Pattern**: `.gemini-mcp "prompt"`
8989

9090
**Purpose**: AI queries with automatic access to ALL connected MCP server tools
9191

9292
**Examples**:
9393

9494
```bash
9595
# Single tool usage
96-
/gemini-mcp "What's the weather in Tokyo?"
96+
.gemini-mcp "What's the weather in Tokyo?"
9797
# → Gemini calls weather:get_forecast(location="Tokyo")
9898
# → Returns formatted weather data
9999

100100
# Multi-tool workflow
101-
/gemini-mcp "If it's sunny in London tomorrow, schedule a picnic at 2pm"
101+
.gemini-mcp "If it's sunny in London tomorrow, schedule a picnic at 2pm"
102102
# → Gemini calls weather:get_forecast(location="London", days=1)
103103
# → Evaluates condition
104104
# → Calls calendar:schedule_meeting(time="14:00", topic="Picnic")
105105
# → Returns confirmation message
106106

107107
# Data analysis
108-
/gemini-mcp "Summarize our sales data from last month"
108+
.gemini-mcp "Summarize our sales data from last month"
109109
# → Gemini calls database:query_sales(period="last_month")
110110
# → Analyzes results
111111
# → Returns formatted summary
@@ -802,7 +802,7 @@ public void onInitialize() {
802802

803803
**Enhancement**: Add help subcommand for MCP tool commands
804804

805-
**Pattern**: `/server:tool help`
805+
**Pattern**: `.server:tool help`
806806

807807
**Implementation** (in `MCPToolCommand.build()`):
808808

@@ -979,7 +979,7 @@ private static Object coerceValue(String value, JsonNode paramSchema) {
979979

980980
### 5.3 Gemini API Rate Limiting
981981

982-
**Scenario**: User spams `/gemini` commands, hits API rate limit
982+
**Scenario**: User spams `.gemini` commands, hits API rate limit
983983

984984
**Handling**: Implement client-side cooldown
985985

@@ -1048,13 +1048,13 @@ MeteorExecutor.execute(() -> {
10481048
- [ ] Try running disconnected command (should fail gracefully)
10491049

10501050
**Gemini Commands**:
1051-
- [ ] Run `/gemini "What is 2+2?"` (simple query)
1052-
- [ ] Run `/gemini` without arguments (should show error)
1053-
- [ ] Run `/gemini` without API key configured (should show config prompt)
1054-
- [ ] Spam `/gemini` commands (verify cooldown works)
1051+
- [ ] Run `.gemini "What is 2+2?"` (simple query)
1052+
- [ ] Run `.gemini` without arguments (should show error)
1053+
- [ ] Run `.gemini` without API key configured (should show config prompt)
1054+
- [ ] Spam `.gemini` commands (verify cooldown works)
10551055

10561056
**Gemini MCP Commands**:
1057-
- [ ] Connect weather server, run `/gemini-mcp "What's the weather in Tokyo?"`
1057+
- [ ] Connect weather server, run `.gemini-mcp "What's the weather in Tokyo?"`
10581058
- [ ] Verify Gemini calls `weather:get_forecast` automatically
10591059
- [ ] Run with multiple servers connected (weather + calendar)
10601060
- [ ] Run complex prompt requiring multiple tool calls
@@ -1233,15 +1233,15 @@ src/main/java/com/cope/meteormcp/
12331233
### Gemini Simple Queries
12341234

12351235
```bash
1236-
/gemini "What is the capital of France?"
1236+
.gemini "What is the capital of France?"
12371237
> [Gemini] The capital of France is Paris.
12381238

1239-
/gemini "Explain quantum entanglement"
1239+
.gemini "Explain quantum entanglement"
12401240
> [Gemini] Quantum entanglement is a phenomenon where two or more
12411241
> particles become interconnected in such a way that the state of
12421242
> one particle instantly influences the state of the other...
12431243

1244-
/gemini "Write a haiku about Minecraft"
1244+
.gemini "Write a haiku about Minecraft"
12451245
> [Gemini] Blocks stack high above
12461246
> Creepers lurk in darkened caves
12471247
> Build and mine, survive
@@ -1253,22 +1253,22 @@ src/main/java/com/cope/meteormcp/
12531253

12541254
```bash
12551255
# Single tool call
1256-
/gemini-mcp "What's the weather like in London?"
1256+
.gemini-mcp "What's the weather like in London?"
12571257
> [Gemini MCP] Querying Gemini with 1 MCP servers...
12581258
> [Gemini MCP] The weather in London is currently cloudy with a
12591259
> temperature of 15°C and light rain expected later today.
12601260
> Tools used: weather:get_forecast
12611261

12621262
# Multi-tool workflow
1263-
/gemini-mcp "Check if it's sunny in Paris tomorrow, and if so, schedule a picnic at 2pm"
1263+
.gemini-mcp "Check if it's sunny in Paris tomorrow, and if so, schedule a picnic at 2pm"
12641264
> [Gemini MCP] Querying Gemini with 2 MCP servers...
12651265
> [Gemini MCP] Good news! The forecast for Paris tomorrow shows sunny
12661266
> weather with temperatures around 22°C. I've scheduled a picnic event
12671267
> for 2:00 PM tomorrow. Would you like me to send invitations?
12681268
> Tools used: weather:get_forecast, calendar:schedule_meeting
12691269
12701270
# Data analysis
1271-
/gemini-mcp "What were our top 3 products by sales last month?"
1271+
.gemini-mcp "What were our top 3 products by sales last month?"
12721272
> [Gemini MCP] Querying Gemini with 1 MCP servers...
12731273
> [Gemini MCP] Based on last month's sales data, your top 3 products were:
12741274
> 1. Widget Pro X - 1,234 units ($61,700)
@@ -1311,9 +1311,9 @@ src/main/java/com/cope/meteormcp/
13111311

13121312
### Why Two Gemini Commands Instead of Flags?
13131313

1314-
**Alternative**: Single `/gemini` command with `--mcp` flag
1314+
**Alternative**: Single `.gemini` command with `--mcp` flag
13151315

1316-
**Chosen Approach**: Separate `/gemini` and `/gemini-mcp` commands
1316+
**Chosen Approach**: Separate `.gemini` and `.gemini-mcp` commands
13171317

13181318
**Rationale**:
13191319
- **Simpler UX**: No need to remember flags
@@ -1388,12 +1388,12 @@ Allow users to create shorter aliases for frequently used commands:
13881388
Store recent command executions for quick re-run:
13891389

13901390
```bash
1391-
/gemini-history
1391+
.gemini-history
13921392
> Recent queries:
13931393
> 1. "What's the weather in Tokyo?"
13941394
> 2. "Schedule a meeting at 2pm"
13951395

1396-
/gemini-rerun 1 # Re-execute query #1
1396+
.gemini-rerun 1 # Re-execute query #1
13971397
```
13981398

13991399
---
@@ -1414,7 +1414,7 @@ Store command results for later use:
14141414

14151415
```bash
14161416
/weather:get_forecast "London" --save weather_data
1417-
/gemini-mcp "Analyze this weather data: ${weather_data}"
1417+
.gemini-mcp "Analyze this weather data: ${weather_data}"
14181418
```
14191419

14201420
---
@@ -1433,7 +1433,7 @@ Add new section after Gemini integration:
14331433
After connecting an MCP server, its tools become available as commands:
14341434

14351435
#### Syntax
1436-
/server_name:tool_name [arguments]
1436+
.server_name:tool_name [arguments]
14371437

14381438
#### Examples
14391439
# Positional arguments
@@ -1448,10 +1448,10 @@ After connecting an MCP server, its tools become available as commands:
14481448
### Gemini Commands
14491449

14501450
#### Simple Queries (No MCP Tools)
1451-
/gemini "What is the capital of France?"
1451+
.gemini "What is the capital of France?"
14521452

14531453
#### MCP-Enhanced Queries (Automatic Tool Access)
1454-
/gemini-mcp "What's the weather in Tokyo?"
1454+
.gemini-mcp "What's the weather in Tokyo?"
14551455

14561456
# Gemini automatically uses ALL connected MCP servers
14571457
# to answer your query intelligently
@@ -1460,7 +1460,7 @@ After connecting an MCP server, its tools become available as commands:
14601460

14611461
- **Dynamic Registration**: Commands appear/disappear as servers connect/disconnect
14621462
- **Autocomplete**: Tab-completion for command names and parameters
1463-
- **Help System**: `/command help` shows usage and parameter details
1463+
- **Help System**: `.command help` shows usage and parameter details
14641464
- **Async Execution**: Gemini commands run in background, don't block chat
14651465
- **Error Handling**: Clear error messages with suggested fixes
14661466

@@ -1484,11 +1484,11 @@ Add to features section:
14841484
-**MCP Server Management**: Connect, configure, and monitor MCP servers via GUI
14851485
-**StarScript Integration**: Use MCP tools in expressions `{server.tool()}`
14861486
-**Gemini AI Integration**: Intelligent prompts with `{gemini()}` and `{gemini_mcp()}`
1487-
-**Command System**: Direct tool execution via `/server:tool` commands
1488-
-**Gemini Commands**: Quick AI queries via `/gemini` and `/gemini-mcp`
1487+
-**Command System**: Direct tool execution via `.server:tool` commands
1488+
-**Gemini Commands**: Quick AI queries via `.gemini` and `.gemini-mcp`
14891489
-**Dynamic Registration**: Commands auto-register when servers connect
14901490
-**Autocomplete**: Tab-completion for commands and parameters
1491-
-**Help System**: Inline help with `/command help`
1491+
-**Help System**: Inline help with `.command help`
14921492

14931493
## Usage Examples
14941494

@@ -1502,10 +1502,10 @@ Add to features section:
15021502
### AI-Powered Queries
15031503
```bash
15041504
# Simple query
1505-
/gemini "Explain quantum physics"
1505+
.gemini "Explain quantum physics"
15061506

15071507
# Query with MCP tool access (automatic)
1508-
/gemini-mcp "Check weather in London and schedule picnic if sunny"
1508+
.gemini-mcp "Check weather in London and schedule picnic if sunny"
15091509
```
15101510

15111511
### StarScript Integration
@@ -1527,8 +1527,8 @@ This specification provides a complete blueprint for adding command system integ
15271527

15281528
**Dynamic Command Registration**: Commands auto-register/unregister with server state
15291529
**Flexible Argument Parsing**: Supports positional, named, and JSON arguments
1530-
**User-Friendly Syntax**: `/server:tool` pattern inspired by Minecraft conventions
1531-
**Gemini Command Access**: Both simple (`/gemini`) and enhanced (`/gemini-mcp`) modes
1530+
**User-Friendly Syntax**: `.server:tool` pattern inspired by Minecraft conventions
1531+
**Gemini Command Access**: Both simple (`.gemini`) and enhanced (`.gemini-mcp`) modes
15321532
**Async Execution**: Non-blocking API calls for responsive UI
15331533
**Help System**: Inline help with parameter details
15341534
**Robust Error Handling**: Graceful failures with clear messages

src/main/java/com/cope/meteormcp/commands/GeminiCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
3030
);
3131

3232
builder.executes(context -> {
33-
error("Prompt is required. Usage: /gemini \"prompt\"");
33+
error("Prompt is required. Usage: .gemini \"prompt\"");
3434
return 0;
3535
});
3636
}
3737

3838
int executeGemini(String prompt) {
3939
if (prompt == null || prompt.isBlank()) {
40-
error("Prompt is required. Usage: /gemini \"prompt\"");
40+
error("Prompt is required. Usage: .gemini \"prompt\"");
4141
return 0;
4242
}
4343

src/main/java/com/cope/meteormcp/commands/GeminiMCPCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
3333
);
3434

3535
builder.executes(context -> {
36-
error("Prompt is required. Usage: /gemini-mcp \"prompt\"");
36+
error("Prompt is required. Usage: .gemini-mcp \"prompt\"");
3737
return 0;
3838
});
3939
}
4040

4141
private int executeGeminiMCP(String prompt) {
4242
if (prompt == null || prompt.isBlank()) {
43-
error("Prompt is required. Usage: /gemini-mcp \"prompt\"");
43+
error("Prompt is required. Usage: .gemini-mcp \"prompt\"");
4444
return 0;
4545
}
4646

0 commit comments

Comments
 (0)