Skip to content

Commit e8166b4

Browse files
authored
Update README files (#71)
1 parent 91469d7 commit e8166b4

File tree

2 files changed

+118
-45
lines changed

2 files changed

+118
-45
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ The new commands will be available in new Gemini CLI sessions. The following com
4949
- `/modify` - Manages a structured modification session with automated planning.
5050
- `/commit` - Automates pre-commit checks and generates a descriptive commit message.
5151

52+
### 3. Available Tools
53+
54+
This extension also installs an MCP server (`flutter_launcher`) that provides tools for starting, stopping, and interacting with Flutter applications. This server is started automatically, and the following tools are made available:
55+
56+
- `launch_app`: Launches a Flutter application on a specified device.
57+
- `stop_app`: Stops a running Flutter application.
58+
- `list_devices`: Lists all available devices that can run Flutter applications.
59+
- `get_app_logs`: Retrieves the logs from a running Flutter application.
60+
- `list_running_apps`: Lists all Flutter applications currently running that were started by this extension.
61+
5262
## 💡 Usage
5363

5464
This extension provides powerful commands to automate key phases of the development lifecycle.

flutter_launcher_mcp/README.md

Lines changed: 108 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ The server exposes the following tools:
4747

4848
Launches a Flutter application with specified arguments and returns its DTD URI and process ID.
4949

50-
- **Description:** Launches a Flutter application and returns its DTD URI.
5150
- **Input Schema:**
5251

5352
```json
@@ -60,11 +59,11 @@ Launches a Flutter application with specified arguments and returns its DTD URI
6059
},
6160
"target": {
6261
"type": "string",
63-
"description": "The main entry point file of the application."
62+
"description": "The main entry point file of the application. Defaults to \"lib/main.dart\"."
6463
},
6564
"device": {
6665
"type": "string",
67-
"description": "The device ID to launch the application on."
66+
"description": "The device ID to launch the application on. To get a list of available devices to present as choices, use the list_devices tool."
6867
}
6968
},
7069
"required": ["root", "device"]
@@ -90,34 +89,10 @@ Launches a Flutter application with specified arguments and returns its DTD URI
9089
}
9190
```
9291

93-
- **Example Call (Conceptual):**
94-
95-
```dart
96-
// Assuming 'client' is an initialized ServerConnection from dart_mcp
97-
final launchResult = await client.callTool(
98-
CallToolRequest(
99-
name: 'launch_app',
100-
arguments: {
101-
'root': '/path/to/your/flutter/project',
102-
'device': 'emulator-5554',
103-
},
104-
),
105-
);
106-
107-
if (!launchResult.isError) {
108-
final dtdUri = launchResult.structuredContent!['dtdUri'] as String;
109-
final pid = launchResult.structuredContent!['pid'] as int;
110-
print('Flutter app launched! DTD URI: $dtdUri, PID: $pid');
111-
} else {
112-
print('Failed to launch Flutter app: ${launchResult.content.first.text}');
113-
}
114-
```
115-
11692
#### `stop_app`
11793

118-
Kills a running Flutter process managed by this server.
94+
Kills a running Flutter process started by the `launch_app` tool.
11995

120-
- **Description:** Kills a running Flutter process managed by this server.
12196
- **Input Schema:**
12297

12398
```json
@@ -148,23 +123,111 @@ Kills a running Flutter process managed by this server.
148123
}
149124
```
150125

151-
- **Example Call (Conceptual):**
152-
153-
```dart
154-
// Assuming 'client' is an initialized ServerConnection from dart_mcp
155-
// and 'launchedPid' is the PID obtained from a previous launchFlutter call
156-
final killResult = await client.callTool(
157-
CallToolRequest(
158-
name: 'stop_app',
159-
arguments: {'pid': launchedPid},
160-
),
161-
);
162-
163-
if (!killResult.isError) {
164-
final success = killResult.structuredContent!['success'] as bool;
165-
print('Kill process result: $success');
166-
} else {
167-
print('Failed to kill process: ${killResult.content.first.text}');
126+
#### `list_devices`
127+
128+
Lists available Flutter devices.
129+
130+
- **Input Schema:**
131+
132+
```json
133+
{
134+
"type": "object"
135+
}
136+
```
137+
138+
- **Output Schema:**
139+
140+
```json
141+
{
142+
"type": "object",
143+
"properties": {
144+
"devices": {
145+
"type": "array",
146+
"description": "A list of available device IDs.",
147+
"items": {
148+
"type": "string"
149+
}
150+
}
151+
},
152+
"required": ["devices"]
153+
}
154+
```
155+
156+
#### `get_app_logs`
157+
158+
Returns the collected logs for a given flutter run process id. Can only retrieve logs started by the `launch_app` tool.
159+
160+
- **Input Schema:**
161+
162+
```json
163+
{
164+
"type": "object",
165+
"properties": {
166+
"pid": {
167+
"type": "integer",
168+
"description": "The process ID of the flutter run process running the application."
169+
}
170+
},
171+
"required": ["pid"]
172+
}
173+
```
174+
175+
- **Output Schema:**
176+
177+
```json
178+
{
179+
"type": "object",
180+
"properties": {
181+
"logs": {
182+
"type": "array",
183+
"description": "The collected logs for the process.",
184+
"items": {
185+
"type": "string"
186+
}
187+
}
188+
},
189+
"required": ["logs"]
190+
}
191+
```
192+
193+
#### `list_running_apps`
194+
195+
Returns the list of running app process IDs and associated DTD URIs for apps started by the `launch_app` tool.
196+
197+
- **Input Schema:**
198+
199+
```json
200+
{
201+
"type": "object"
202+
}
203+
```
204+
205+
- **Output Schema:**
206+
207+
```json
208+
{
209+
"type": "object",
210+
"properties": {
211+
"apps": {
212+
"type": "array",
213+
"description": "A list of running applications started by the launch_app tool.",
214+
"items": {
215+
"type": "object",
216+
"properties": {
217+
"pid": {
218+
"type": "integer",
219+
"description": "The process ID of the application."
220+
},
221+
"dtdUri": {
222+
"type": "string",
223+
"description": "The DTD URI of the application."
224+
}
225+
},
226+
"required": ["pid", "dtdUri"]
227+
}
228+
}
229+
},
230+
"required": ["apps"]
168231
}
169232
```
170233

0 commit comments

Comments
 (0)