A high-performance MCP (Model Context Protocol) server for terminal command execution and file system operations, written in Rust.
Built with the official rmcp SDK.
- Command Execution - Execute terminal commands with configurable timeouts
- Command History - Track recent command executions with timestamps and status
- Directory Navigation - Navigate and list directory contents
- File Operations - Read, write, and manipulate file contents with row-level precision
- Cross-Platform - Works on Windows, macOS, and Linux
- Security - Blocks dangerous commands like
rm -rf / - Fast - Native compiled binary with async I/O
git clone https://github.com/bangrocket/rustterm-mcp.git
cd rustterm-mcp
cargo build --releaseThe binary will be at target/release/rustterm-mcp.
Check the Releases page for pre-built binaries.
Add to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"rustterm": {
"command": "/path/to/rustterm-mcp"
}
}
}Add to your Cursor MCP configuration (.cursor/mcp.json):
{
"mcpServers": {
"rustterm": {
"command": "/path/to/rustterm-mcp"
}
}
}| Tool | Description |
|---|---|
execute_command |
Execute a terminal command with optional timeout |
get_command_history |
Retrieve recent command execution history |
get_current_directory |
Get the current working directory |
change_directory |
Change the current working directory |
list_directory |
List files and directories |
read_file |
Read file contents with optional row selection and JSON parsing |
write_file |
Write content to a file (overwrite or append) |
insert_file_content |
Insert content at specific row(s) |
delete_file_content |
Delete row(s) or substrings within rows |
update_file_content |
Update/replace content at specific row(s) |
Execute a terminal command with optional timeout.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
command |
string | Yes | - | The command to execute |
timeout |
integer | No | 30 | Timeout in seconds |
Example:
{"command": "ls -la", "timeout": 10}Retrieve recent command execution history.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
count |
integer | No | 10 | Number of entries (max 50) |
Get the current working directory. No parameters required.
Change the current working directory.
| Parameter | Type | Required | Description |
|---|---|---|---|
path |
string | Yes | Path to change to (absolute or relative) |
List files and directories.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path |
string | No | Current dir | Path to list |
Read file contents with optional filtering.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path |
string | Yes | - | Path to the file |
start_row |
integer | No | - | Starting row (0-based) |
end_row |
integer | No | - | Ending row (0-based, inclusive) |
as_json |
boolean | No | false | Parse and pretty-print as JSON |
Write content to a file.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path |
string | Yes | - | Path to the file |
content |
string | Yes | - | Content to write |
mode |
string | No | "overwrite" | "overwrite" or "append" |
Insert content at specific row(s).
| Parameter | Type | Required | Description |
|---|---|---|---|
path |
string | Yes | Path to the file |
content |
string | Yes | Content to insert |
row |
integer | No* | Single row number (0-based) |
rows |
array | No* | Multiple row numbers |
*Must specify either row or rows
Delete row(s) or substrings.
| Parameter | Type | Required | Description |
|---|---|---|---|
path |
string | Yes | Path to the file |
row |
integer | No* | Single row number (0-based) |
rows |
array | No* | Multiple row numbers |
substring |
string | No | Delete only this substring within rows |
*Must specify either row or rows
Update/replace content at specific row(s).
| Parameter | Type | Required | Description |
|---|---|---|---|
path |
string | Yes | Path to the file |
content |
string | Yes | New content |
row |
integer | No* | Single row number (0-based) |
rows |
array | No* | Multiple row numbers |
substring |
string | No | Replace only this substring within rows |
*Must specify either row or rows
| Environment Variable | Description | Default |
|---|---|---|
RUST_LOG |
Log level (trace, debug, info, warn, error) | info |
The server blocks potentially dangerous commands including:
rm -rf /rm -rf /*mkfs- Fork bombs (
:(){:|:&};:)
File operations are limited to 10 MB to prevent memory exhaustion.
- Rust 1.70+ (install via rustup)
cargo buildcargo build --releaseThe release build includes LTO and is stripped for minimal binary size.
MIT - see LICENSE
Contributions are welcome! Please feel free to submit a Pull Request.