desktop-commander

v0.2.95
@tokor/desktop-commander Checked 9 hours ago Published 8 days ago

MCP 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…

ParameterTypeDescription
key *string
value *
originstring

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…

ParameterTypeDescription
path *string
isUrlboolean
lengthnumber
offsetnumber
optionsobject
originstring
rangestring
sheetstring

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…

ParameterTypeDescription
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.…

ParameterTypeDescription
content *string
path *string
modestring
originstring

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…

ParameterTypeDescription
content *
path *string
optionsobject
outputPathstring

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…

ParameterTypeDescription
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…

ParameterTypeDescription
path *string
depthnumber
originstring

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 —…

ParameterTypeDescription
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…

ParameterTypeDescription
path *string

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…

ParameterTypeDescription
sessionId *string
lengthnumber
offsetnumber

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})…

ParameterTypeDescription
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 -…

ParameterTypeDescription
file_path *string
content
expected_replacementsnumber
new_stringstring
old_stringstring
optionsobject
originstring
rangestring

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…

ParameterTypeDescription
command *string
timeout_ms *number
max_runtime_sinteger
shellstring
verbose_timingboolean

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…

ParameterTypeDescription
pid *number
lengthnumber
offsetnumber
timeout_msnumber
verbose_timingboolean

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…

ParameterTypeDescription
input *string
pid *number
timeout_msnumber
verbose_timingboolean
wait_for_promptboolean

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.

ParameterTypeDescription
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…

ParameterTypeDescription
probe *string
interval_sinteger
tail_linesinteger
timeout_sinteger

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.

ParameterTypeDescription
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…

ParameterTypeDescription
maxResultsnumber
sincestring
toolNamestring