Skip to content

Commit 28e6c9f

Browse files
committed
developer toolbox WIP
initial developer tools
1 parent 0598deb commit 28e6c9f

14 files changed

Lines changed: 3158 additions & 57 deletions

Cargo.lock

Lines changed: 1575 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,16 @@ schemars = { version = "0.8", features = ["derive"] }
1717
tokio = { version = "1", features = ["full"] }
1818
axum = "0.8"
1919
rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", branch = "main", features = ["schemars", "transport-io"] }
20+
21+
# Additional dependencies for developer module
22+
indoc = "2.0"
23+
include_dir = "0.7"
24+
ignore = "0.4"
25+
url = "2.5"
26+
shellexpand = "3.1"
27+
base64 = "0.22"
28+
image = "0.25"
29+
xcap = "0.0.12"
30+
serial_test = "3.1"
31+
tempfile = "3.10"
32+
regex = "1.10"

developer_tools.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
Extension: developer
2+
Tool: developer__shell
3+
Execute a command in the shell.
4+
5+
This will return the output and error concatenated into a single string, as
6+
you would see from running on the command line. There will also be an indication
7+
of if the command succeeded or failed.
8+
9+
Avoid commands that produce a large amount of output, and consider piping those outputs to files.
10+
If you need to run a long lived command, background it - e.g. `uvicorn main:app &` so that
11+
this tool does not run indefinitely.
12+
13+
**Important**: Each shell command runs in its own process. Things like directory changes or
14+
sourcing files do not persist between tool calls. So you may need to repeat them each time by
15+
stringing together commands, e.g. `cd example && ls` or `source env/bin/activate && pip install numpy`
16+
17+
**Important**: Use ripgrep - `rg` - when you need to locate a file or a code reference, other solutions
18+
may show ignored or hidden files. For example *do not* use `find` or `ls -r`
19+
- List files by name: `rg --files | rg <filename>`
20+
- List files that contain a regex: `rg '<regex>' -l`
21+
22+
Arguments (input schema):
23+
{
24+
"properties": {
25+
"command": {
26+
"type": "string"
27+
}
28+
},
29+
"required": [
30+
"command"
31+
],
32+
"type": "object"
33+
}
34+
35+
Tool: developer__text_editor
36+
Perform text editing operations on files.
37+
38+
The `command` parameter specifies the operation to perform. Allowed options are:
39+
- `view`: View the content of a file.
40+
- `write`: Create or overwrite a file with the given content
41+
- `str_replace`: Replace a string in a file with a new string.
42+
- `undo_edit`: Undo the last edit made to a file.
43+
44+
To use the write command, you must specify `file_text` which will become the new content of the file. Be careful with
45+
existing files! This is a full overwrite, so you must include everything - not just sections you are modifying.
46+
47+
To use the str_replace command, you must specify both `old_str` and `new_str` - the `old_str` needs to exactly match one
48+
unique section of the original file, including any whitespace. Make sure to include enough context that the match is not
49+
ambiguous. The entire original string will be replaced with `new_str`.
50+
51+
Arguments (input schema):
52+
{
53+
"properties": {
54+
"command": {
55+
"description": "Allowed options are: `view`, `write`, `str_replace`, undo_edit`.",
56+
"enum": [
57+
"view",
58+
"write",
59+
"str_replace",
60+
"undo_edit"
61+
],
62+
"type": "string"
63+
},
64+
"file_text": {
65+
"type": "string"
66+
},
67+
"new_str": {
68+
"type": "string"
69+
},
70+
"old_str": {
71+
"type": "string"
72+
},
73+
"path": {
74+
"description": "Absolute path to file or directory, e.g. `/repo/file.py` or `/repo`.",
75+
"type": "string"
76+
}
77+
},
78+
"required": [
79+
"command",
80+
"path"
81+
],
82+
"type": "object"
83+
}
84+
85+
Tool: developer__list_windows
86+
List all available window titles that can be used with screen_capture.
87+
Returns a list of window titles that can be used with the window_title parameter
88+
of the screen_capture tool.
89+
90+
Arguments (input schema):
91+
{
92+
"properties": {},
93+
"required": [],
94+
"type": "object"
95+
}
96+
97+
Tool: developer__screen_capture
98+
Capture a screenshot of a specified display or window.
99+
You can capture either:
100+
1. A full display (monitor) using the display parameter
101+
2. A specific window by its title using the window_title parameter
102+
103+
Only one of display or window_title should be specified.
104+
105+
Arguments (input schema):
106+
{
107+
"properties": {
108+
"display": {
109+
"default": 0,
110+
"description": "The display number to capture (0 is main display)",
111+
"type": "integer"
112+
},
113+
"window_title": {
114+
"default": null,
115+
"description": "Optional: the exact title of the window to capture. use the list_windows tool to find the available windows.",
116+
"type": "string"
117+
}
118+
},
119+
"required": [],
120+
"type": "object"
121+
}
122+
123+
Tool: developer__image_processor
124+
Process an image file from disk. The image will be:
125+
1. Resized if larger than max width while maintaining aspect ratio
126+
2. Converted to PNG format
127+
3. Returned as base64 encoded data
128+
129+
This allows processing image files for use in the conversation.
130+
131+
Arguments (input schema):
132+
{
133+
"properties": {
134+
"path": {
135+
"description": "Absolute path to the image file to process",
136+
"type": "string"
137+
}
138+
},
139+
"required": [
140+
"path"
141+
],
142+
"type": "object"
143+
}

src/counter.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ use serde::Deserialize;
33
use std::sync::Arc;
44

55
use rmcp::{
6-
Error as McpError, RoleServer, ServerHandler, model::*, schemars,
7-
service::RequestContext, tool,
6+
Error as McpError, RoleServer, ServerHandler, model::*, schemars, service::RequestContext, tool,
87
};
98
use serde_json::json;
109
use tokio::sync::Mutex;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Execute a command in the shell.
2+
3+
This will return the output and error concatenated into a single string, as
4+
you would see from running on the command line. There will also be an indication
5+
of if the command succeeded or failed.
6+
7+
Avoid commands that produce a large amount of output, and consider piping those outputs to files.
8+
If you need to run a long lived command, background it - e.g. `uvicorn main:app &` so that
9+
this tool does not run indefinitely.
10+
11+
**Important**: Each shell command runs in its own process. Things like directory changes or
12+
sourcing files do not persist between tool calls. So you may need to repeat them each time by
13+
stringing together commands, e.g. `cd example && ls` or `source env/bin/activate && pip install numpy`
14+
15+
**Important**: Use ripgrep - `rg` - when you need to locate a file or a code reference, other solutions
16+
may show ignored or hidden files. For example *do not* use `find` or `ls -r`
17+
- List files by name: `rg --files | rg <filename>`
18+
- List files that contain a regex: `rg '<regex>' -l`
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Execute a command in the shell.
2+
3+
This will return the output and error concatenated into a single string, as
4+
you would see from running on the command line. There will also be an indication
5+
of if the command succeeded or failed.
6+
7+
Avoid commands that produce a large amount of output, and consider piping those outputs to files.
8+
9+
**Important**: For searching files and code:
10+
11+
Preferred: Use ripgrep (`rg`) when available - it respects .gitignore and is fast:
12+
- To locate a file by name: `rg --files | rg example.py`
13+
- To locate content inside files: `rg 'class Example'`
14+
15+
Alternative Windows commands (if ripgrep is not installed):
16+
- To locate a file by name: `dir /s /b example.py`
17+
- To locate content inside files: `findstr /s /i "class Example" *.py`
18+
19+
Note: Alternative commands may show ignored/hidden files that should be excluded.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Perform text editing operations on files.
2+
3+
The `command` parameter specifies the operation to perform. Allowed options are:
4+
- `view`: View the content of a file.
5+
- `write`: Create or overwrite a file with the given content
6+
- `str_replace`: Replace a string in a file with a new string.
7+
- `undo_edit`: Undo the last edit made to a file.
8+
9+
To use the write command, you must specify `file_text` which will become the new content of the file. Be careful with
10+
existing files! This is a full overwrite, so you must include everything - not just sections you are modifying.
11+
12+
To use the str_replace command, you must specify both `old_str` and `new_str` - the `old_str` needs to exactly match one
13+
unique section of the original file, including any whitespace. Make sure to include enough context that the match is not
14+
ambiguous. The entire original string will be replaced with `new_str`.

0 commit comments

Comments
 (0)