@conquest-eth/tools 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
- # MCP for Conquest.eth v0
1
+ # Conquest.eth CLI
2
2
 
3
- A dual-mode CLI tool for interacting with the Conquest.eth blockchain game. It can run as an **MCP server** for AI assistant integration or execute **tools directly** from the command line.
3
+ A command-line tool for interacting with the Conquest.eth blockchain game. Execute game commands directly from your terminal to acquire planets, send fleets, resolve battles, and manage your empire.
4
4
 
5
5
  ## Features
6
6
 
7
- - **MCP Server Mode**: Integrate with AI assistants via the Model Context Protocol
8
7
  - **CLI Mode**: Execute game commands directly from your terminal
9
- - **Dynamic Command Generation**: CLI commands are auto-generated from tool definitions
10
8
  - **Comprehensive Game Tools**: Acquire planets, send fleets, resolve fleets, manage exits, and more
9
+ - **Dynamic Command Generation**: CLI commands are auto-generated from tool definitions
10
+ - **MCP Server Mode**: the cli provide an mcp command if you prefers to integrate your agent via Model Context Protocol
11
11
 
12
12
  ## Installation
13
13
 
@@ -17,15 +17,13 @@ npm i -g @conquest-eth/tools
17
17
 
18
18
  ## Usage
19
19
 
20
- ### CLI Mode (Direct Command Execution)
21
-
22
20
  Show help and available commands:
23
21
 
24
22
  ```bash
25
23
  ecli --help
26
24
  ```
27
25
 
28
- #### Global Options
26
+ ### Global Options
29
27
 
30
28
  | Option | Environment Variable | Description | Default |
31
29
  | --------------------------- | -------------------- | -------------------------------- | ---------- |
@@ -34,13 +32,7 @@ ecli --help
34
32
  | `--storage <type>` | `STORAGE_TYPE` | Storage backend: json or sqlite | json |
35
33
  | `--storage-path <path>` | `STORAGE_PATH` | Storage directory path | ./data |
36
34
 
37
- #### MCP Server Options
38
-
39
- | Option | Environment Variable | Description | Default |
40
- | ------------ | -------------------- | ---------------------------- | ------- |
41
- | `--ethereum` | `ETHEREUM_TOOLS` | Include tools-ethereum tools | false |
42
-
43
- #### Using Environment Variables
35
+ ### Using Environment Variables
44
36
 
45
37
  Set up your environment:
46
38
 
@@ -56,7 +48,7 @@ Then run commands without repeating options:
56
48
  ecli get_my_planets --radius 10
57
49
  ```
58
50
 
59
- #### Available Commands
51
+ ### Available Commands
60
52
 
61
53
  | Command | Description |
62
54
  | -------------------- | --------------------------------------- |
@@ -70,7 +62,7 @@ ecli get_my_planets --radius 10
70
62
  | `get_pending_fleets` | Get pending fleets |
71
63
  | `verify_exit_status` | Check a planet's exit status |
72
64
 
73
- #### Examples
65
+ ### Examples
74
66
 
75
67
  ```bash
76
68
  # Get your planets
@@ -94,26 +86,6 @@ ecli exit_planets --planet-ids 1,2,3
94
86
 
95
87
  See [`EXAMPLES.md`](./EXAMPLES.md) for more detailed usage examples.
96
88
 
97
- ### MCP Server Mode
98
-
99
- Start the MCP server for AI assistant integration:
100
-
101
- ```bash
102
- ecli mcp --rpc-url https://rpc.gnosischain.com --game-contract 0x322813fd9a801c5507c9de605d63cea4f2ce6c44
103
- ```
104
-
105
- Or use the MCP Inspector for testing:
106
-
107
- ```bash
108
- pnpm mcp:inspector ecli --game-contract 0xD833d4dBBb0C19aF1EEf76540d66E2076a5e9D72 --rpc-url https://rpc.gnosis.gateway.fm
109
- ```
110
-
111
- For Conquest 2025-1 edition, use:
112
-
113
- ```bash
114
- pnpm mcp:inspector ecli --game-contract 0xD833d4dBBb0C19aF1EEf76540d66E2076a5e9D72 --rpc-url https://rpc.gnosis.gateway.fm
115
- ```
116
-
117
89
  ## Architecture
118
90
 
119
91
  The CLI follows a dual-mode architecture:
@@ -213,6 +185,28 @@ pnpm format
213
185
  pnpm start
214
186
  ```
215
187
 
188
+ ## MCP Server Mode (Alternative)
189
+
190
+ As an alternative to direct CLI usage, `ecli` can also run as an MCP (Model Context Protocol) server for.
191
+
192
+ Start the MCP server:
193
+
194
+ ```bash
195
+ ecli --rpc-url https://rpc.gnosischain.com --game-contract 0x322813fd9a801c5507c9de605d63cea4f2ce6c44 mcp
196
+ ```
197
+
198
+ MCP-specific options:
199
+
200
+ | Option | Environment Variable | Description | Default |
201
+ | ------------ | -------------------- | ---------------------------- | ------- |
202
+ | `--ethereum` | `ETHEREUM_TOOLS` | Include tools-ethereum tools | false |
203
+
204
+ For testing with the MCP Inspector:
205
+
206
+ ```bash
207
+ pnpm mcp:inspector ecli --game-contract 0xD833d4dBBb0C19aF1EEf76540d66E2076a5e9D72 --rpc-url https://rpc.gnosis.gateway.fm mcp
208
+ ```
209
+
216
210
  ## License
217
211
 
218
212
  MIT
@@ -1 +1 @@
1
- {"version":3,"file":"get_planets_around.d.ts","sourceRoot":"","sources":["../../src/tools/get_planets_around.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AAe7C,eAAO,MAAM,kBAAkB;;;;;;;+BAuD7B,CAAC"}
1
+ {"version":3,"file":"get_planets_around.d.ts","sourceRoot":"","sources":["../../src/tools/get_planets_around.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AAe7C,eAAO,MAAM,kBAAkB;;;;;;;+BAyD7B,CAAC"}
@@ -50,7 +50,9 @@ export const get_planets_around = createTool({
50
50
  planetId: info.location.id,
51
51
  distance: Math.sqrt(Math.pow(info.location.x - center.x, 2) + Math.pow(info.location.y - center.y, 2)),
52
52
  location: info.location,
53
- ...state,
53
+ state,
54
+ stats: info.stats,
55
+ // ...state,
54
56
  })),
55
57
  },
56
58
  };
@@ -1 +1 @@
1
- {"version":3,"file":"get_planets_around.js","sourceRoot":"","sources":["../../src/tools/get_planets_around.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AAGrD,MAAM,MA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AO;gBACN,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC7D,CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conquest-eth/tools",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Tools for Conquest.eth, including mcp server",
5
5
  "author": "Ronan Sandford",
6
6
  "license": "MIT",
@@ -13,11 +13,12 @@
13
13
  ],
14
14
  "repository": {
15
15
  "type": "git",
16
- "url": "git+https://github.com/wighawag/tools-conquest-eth-v0.git"
16
+ "url": "git+https://github.com/wighawag/conquest-eth-for-lobsters",
17
+ "directory": "lobsters/tools"
17
18
  },
18
- "homepage": "https://github.com/wighawag/tools-conquest-eth-v0#readme",
19
+ "homepage": "https://github.com/wighawag/conquest-eth-for-lobsters/blob/main/lobsters/tools/README.md",
19
20
  "bugs": {
20
- "url": "https://github.com/wighawag/tools-conquest-eth-v0/issues"
21
+ "url": "https://github.com/wighawag/conquest-eth-for-lobsters/issues"
21
22
  },
22
23
  "publishConfig": {
23
24
  "access": "public"
@@ -59,7 +59,9 @@ export const get_planets_around = createTool<typeof schema, ConquestEnv>({
59
59
  Math.pow(info.location.x - center.x, 2) + Math.pow(info.location.y - center.y, 2),
60
60
  ),
61
61
  location: info.location,
62
- ...state,
62
+ state,
63
+ stats: info.stats,
64
+ // ...state,
63
65
  })),
64
66
  },
65
67
  };