desktop-commander
v0.2.95MCP server for terminal operations and file editing
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_config
Get the complete server configuration as JSON. Config includes fields for: - blockedCommands (array of blocked shell commands) - defaultShell (shell to use for commands) - allowedDirectories (paths the server can access) - fileReadLineLimit (max lines for read_file, default 1000) - fileWriteLineLimit (max lines per write_file call, default 50) - telemetryEnabled (boolean for telemetry opt-in/out) - curre…
set_config_value
Set a specific configuration value by key. WARNING: Should be used in a separate chat from file operations and command execution to prevent security issues. Config keys include: - blockedCommands (array) - defaultShell (string) - allowedDirectories (array of paths) - fileReadLineLimit (number, max lines for read_file) - fileWriteL…
| Parameter | Type | Description |
|---|---|---|
key * | string | |
value * | ||
origin | string |
read_file
Read contents from files and URLs. Read PDF files and extract content as markdown and images. Prefer this over 'execute_command' with cat/type for viewing files. Supports partial file reading with: - 'offset' (start line, default: 0) * Positive: Start from line N (0-based indexing) * Negative: Read last N lines from end (tail behavior) - 'length' (max…
| Parameter | Type | Description |
|---|---|---|
path * | string | |
isUrl | boolean | |
length | number | |
offset | number | |
options | object | |
origin | string | |
range | string | |
sheet | string |
read_multiple_files
Read the contents of multiple files simultaneously. Each file's content is returned with its path as a reference. Handles text files normally and renders images as viewable content. Recognized image types: PNG, JPEG, GIF, WebP. Failed reads for individual files won't stop the entire operation. Only works within allowed directories. IMPORTANT: Always use…
| Parameter | Type | Description |
|---|---|---|
paths * | array |
write_file
Write or append to file contents. IMPORTANT: DO NOT use this tool to create PDF files. Use 'write_pdf' for all PDF creation tasks. DO NOT use this tool to edit DOCX files. Use 'edit_block' with old_string/new_string instead. To CREATE a new DOCX, use write_file with .docx extension — text content with markdown headings (#, ##, ###) is converted to styled DOCX paragraphs. CHUNKING IS STANDARD PRACTICE: Always write files in chunks of 25-30 lines maximum.…
| Parameter | Type | Description |
|---|---|---|
content * | string | |
path * | string | |
mode | string | |
origin | string |
write_pdf
Create a new PDF file or modify an existing one. THIS IS THE ONLY TOOL FOR CREATING AND MODIFYING PDF FILES. PDF WRITES CANNOT BE UNDONE: a PDF is binary, so no before/after content is captured for it and there is no version backup — neither reverse-editing nor restore can bring an overwritten PDF back. Writing onto an existing file is therefore REJECTED by this tool; always target a filename that does not exist yet. If the user explicitly wants…
| Parameter | Type | Description |
|---|---|---|
content * | ||
path * | string | |
options | object | |
outputPath | string |
create_directory
Create a new directory or ensure a directory exists. Can create multiple nested directories in one operation. Only works within allowed directories. IMPORTANT: Always use absolute paths for reliability. Paths are automatically normalized regardless of slash direction. 🐳 DOCKER: Prefer paths within mounted directories: /work, /home/runner. When users ask about file locations, check these mounted paths first. Relative paths may fail as they depen…
| Parameter | Type | Description |
|---|---|---|
path * | string |
list_directory
Get a detailed listing of all files and directories in a specified path. Use this instead of 'execute_command' with ls/dir commands. Results distinguish between files and directories with [FILE] and [DIR] prefixes. Supports recursive listing with the 'depth' parameter (default: 2): - depth=1: Only direct contents of the directory - depth=2: Contents plus one level of subdirectories…
| Parameter | Type | Description |
|---|---|---|
path * | string | |
depth | number | |
origin | string |
move_file
Move or rename files and directories. Can move files between directories and rename them in a single operation. Both source and destination must be within allowed directories. THE DESTINATION MUST NOT ALREADY EXIST: moving onto an existing path would destroy that file permanently (no backup, no undo, and the loss would not even show up as a tracked change), so this tool rejects it. Pick a destination name that is free, or —…
| Parameter | Type | Description |
|---|---|---|
destination * | string | |
source * | string |
delete_file
Delete a file. This is permanent — there is no version backup and no restore. If you may need to undo the deletion, read the file first so its content is in the conversation, then you can recreate it with write_file. That safety net only works for text-readable files: reading a PDF, image or other binary gives you extracted text, NOT something you can rebuild the original from — deleting one of those is unrecoverable. NEVE…
| Parameter | Type | Description |
|---|---|---|
path * | string |
start_search
Start a streaming search that can return results progressively. SEARCH STRATEGY GUIDE: Choose the right search type based on what the user is looking for: USE searchType="files" WHEN: - User asks for specific files: "find package.json", "locate config files" - Pattern looks like a filename: "*.js", "README.md", "test-*.tsx" - User wants to find files by name/extension: "all Typ…
| Parameter | Type | Description |
|---|---|---|
path * | string | |
pattern * | string | |
contextLines | number | |
earlyTermination | boolean | |
filePattern | string | |
ignoreCase | boolean | |
includeHidden | boolean | |
literalSearch | boolean | |
maxResults | number | |
searchType | string | |
timeout_ms | number |
get_more_search_results
Get more results from an active search with offset-based pagination. Supports partial result reading with: - 'offset' (start result index, default: 0) * Positive: Start from result N (0-based indexing) * Negative: Read last N results from end (tail behavior) - 'length' (max results to read, default: 100) * Used with positive offsets for range reading * Ignored when offset…
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | |
length | number | |
offset | number |
stop_search
Stop an active search. Stops the background search process gracefully. Use this when you've found what you need or if a search is taking too long. Similar to force_terminate for terminal processes. The search will still be available for reading final results until it's automatically cleaned up after 5 minutes. This command can be referenced as "DC: ..."…
| Parameter | Type | Description |
|---|---|---|
sessionId * | string |
list_searches
List all active searches. Shows search IDs, search types, patterns, status, and runtime. Similar to list_sessions for terminal processes. Useful for managing multiple concurrent searches. This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.
get_file_info
Retrieve detailed metadata about a file or directory including: - size - creation time - last modified time - permissions - type - lineCount (for text files) - lastLine (zero-indexed number of last line, for text files) - appendPosition (line number for appending, for text files) - sheets (for Excel files - array of {name, rowCount, colCount})…
| Parameter | Type | Description |
|---|---|---|
path * | string |
edit_block
Apply surgical edits to files. BEST PRACTICE: Make multiple small, focused edits rather than one large edit. Each edit_block call should change only what needs to be changed - include just enough context to uniquely identify the text being modified. FORMAT HANDLING (by extension): EXCEL FILES (.xlsx, .xls, .xlsm) - Range Update mode: Takes: - file_path: Path to the Excel file -…
| Parameter | Type | Description |
|---|---|---|
file_path * | string | |
content | ||
expected_replacements | number | |
new_string | string | |
old_string | string | |
options | object | |
origin | string | |
range | string |
start_process
Start a new terminal process with intelligent state detection. LIFETIME AND COMPLETION: - A process that is still running when this call returns is stopped automatically after 30 minutes. For long-running work (a dev server, a watcher, a long batch job) pass max_runtime_s with your realistic estimate, at most 86400 (one day). Do not pass the maximum by default. - To run something in the background (the user does not need…
| Parameter | Type | Description |
|---|---|---|
command * | string | |
timeout_ms * | number | |
max_runtime_s | integer | |
shell | string | |
verbose_timing | boolean |
read_process_output
Read output from a running or finished process with file-like pagination support. A finished process's full output stays readable by its PID until this local MCP restarts (the most recent 100 finished processes are kept), so you never need to run a command again just to see its result. USE IT TO PEEK, NOT TO WAIT: - Use this to look at a process's output so far (check that a server came up, get a URL or port it printed, see…
| Parameter | Type | Description |
|---|---|---|
pid * | number | |
length | number | |
offset | number | |
timeout_ms | number | |
verbose_timing | boolean |
interact_with_process
Send input to a running process and automatically receive the response. CRITICAL: THIS IS THE PRIMARY TOOL FOR ALL LOCAL FILE ANALYSIS For ANY local file analysis (CSV, JSON, data processing), ALWAYS use this instead of the analysis tool. The analysis tool CANNOT access local files and WILL FAIL - use processes for ALL file-based work. FILE ANALYSIS PRIORITY ORDER (MANDATORY): 1. ALWAYS FIRST: Use this…
| Parameter | Type | Description |
|---|---|---|
input * | string | |
pid * | number | |
timeout_ms | number | |
verbose_timing | boolean | |
wait_for_prompt | boolean |
force_terminate
Force terminate a running terminal session, including every child process it started (the whole process tree). Close REPLs and helper processes you no longer need with this; otherwise they keep running until their max_runtime_s limit stops them. This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.
| Parameter | Type | Description |
|---|---|---|
pid * | number |
list_sessions
List all active terminal sessions on this device. The list covers the whole machine: it includes processes started from other conversations and tasks, not only this one. Sessions started in this conversation are marked "started in this conversation". Shows session status including: - PID: Process identifier - Command: the command that started it (secrets masked, long commands truncated) - Runtime: How…
monitor
Wait on this device until a condition completes, then return the outcome. Use this to await slow local work (a build, a download, a long script) without polling yourself: the platform suspends the task at zero cost and resumes you automatically with this tool's result. The condition is a probe: a shell command run every interval_s seconds in the same shell as start_process (so use the same syntax); exit code 0 means the c…
| Parameter | Type | Description |
|---|---|---|
probe * | string | |
interval_s | integer | |
tail_lines | integer | |
timeout_s | integer |
list_processes
List all running processes. Returns process information including PID, command name, CPU usage, and memory usage. This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.
kill_process
Terminate a running process by PID. Use with caution as this will forcefully terminate the specified process. This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.
| Parameter | Type | Description |
|---|---|---|
pid * | number |
get_recent_tool_calls
Get recent tool call history with their arguments and outputs. Returns chronological list of tool calls made during this session. Useful for: - Onboarding new chats about work already done - Recovering context after chat history loss - Debugging tool call sequences Note: Does not track its own calls or other meta/query tools. History kept in memory (last…
| Parameter | Type | Description |
|---|---|---|
maxResults | number | |
since | string | |
toolName | string |