How DesktopCommanderMCP Detects Development Tools: Process Detection System Explained
DesktopCommanderMCP uses a two-stage process detection system that executes native OS commands (ps aux on Unix, tasklist on Windows) and analyzes the output to identify installed development tools like Node.js, Python, Docker, and Xcode.
The process detection system for identifying development tools in wonderwhy-er/DesktopCommanderMCP enables the Model Context Protocol (MCP) server to provide real-time inventory of development environments. By combining native process enumeration with environment probing, the system answers critical workspace questions such as "What development tools are installed on this machine?" without requiring static configuration files.
How the Process Detection System Works
The detection mechanism operates through two distinct stages that transform raw operating system data into structured guidance about available development utilities.
Stage 1: Collecting Running Processes
The foundation of the system relies on the list_processes tool, which executes platform-specific commands to capture a complete snapshot of running applications.
On Unix-based systems (macOS and Linux), the tool runs ps aux to retrieve process identifiers, command names, CPU usage, and memory consumption. On Windows, it executes tasklist to achieve the same result. The implementation in src/tools/process.ts formats this raw output into a structured ServerResult that the MCP server can consume and return to clients.
This stage provides real-time data about every active process on the host, including development servers, compilers, and runtime environments that may not appear in static installation registries.
Stage 2: Analyzing and Identifying Development Tools
Once the process list is collected, the system analyzes it alongside static environment checks to build comprehensive tool guidance. The getDevelopmentToolGuidance function in src/utils/system-info.ts orchestrates this analysis by:
- Scanning command names for known development binaries (
node,python,git,code,docker) - Detecting runtime versions through
detectNodeInfoanddetectPythonInfo - Checking for Xcode Command Line Tools, Homebrew installations, and container runtimes (Docker/Podman)
- Correlating process presence with version information to confirm active versus merely installed tools
This enrichment transforms a flat list of processes into actionable intelligence about the development capabilities available on the machine.
Implementation Details and Key Files
The process detection system spans four critical files that handle execution, dispatch, analysis, and specialized detection:
src/tools/process.ts– Executes the native OS commands (ps auxortasklist) and structures the results for thelist_processestoolsrc/handlers/process-handlers.ts– Dispatches RPC calls forlist_processesandkill_processto their respective implementationssrc/utils/system-info.ts– ContainsgetDevelopmentToolGuidance,detectNodeInfo, anddetectPythonInfofor building the final tool inventorysrc/utils/process-detection.ts– Provides generic REPL prompt and completion detection utilities used by improved process tools
Together, these components create a cross-platform detection layer that works uniformly across Windows, macOS, and Linux without requiring platform-specific toolchains.
Code Examples for Tool Detection
The following TypeScript examples demonstrate how to interact with the process detection system programmatically:
// 1️⃣ Call the built-in "tools/list" RPC method to fetch all server-exposed tools
const toolsResponse = await client.call('tools/list');
console.log('Available tools:', toolsResponse.result.tools.map(t => t.name));
// 2️⃣ Use the "list_processes" tool to get the current process table
const procResponse = await client.call('tools/call', {
name: 'list_processes',
arguments: {}
});
console.log('Running processes:\n', procResponse.result.content[0].text);
// 3️⃣ Derive development-tool guidance from system-info
import { getSystemInfo, getDevelopmentToolGuidance } from './src/utils/system-info.js';
const sysInfo = await getSystemInfo(); // gathers OS, Node, Python, container data
const guidance = getDevelopmentToolGuidance(sysInfo);
console.log('Development-tool guidance:\n', guidance);
The output combines a human-readable process list with a concise summary of installed development tools, enabling automated environment assessment and tool provisioning decisions.
Summary
- DesktopCommanderMCP employs a two-stage detection process combining native OS commands with intelligent analysis
- The
list_processestool insrc/tools/process.tsprovides real-time process enumeration usingps auxortasklist - Environment detection in
src/utils/system-info.tsidentifies Node.js, Python, Xcode, Homebrew, Docker, and Podman installations - The system is cross-platform and on-demand, executing only when requested rather than maintaining persistent monitoring
- Development tool guidance integrates both running process detection and static environment checks for accurate capability reporting
Frequently Asked Questions
How does the process detection system handle different operating systems?
The system abstracts platform differences through conditional command execution. In src/tools/process.ts, the implementation detects the host operating system and executes ps aux for Unix-based systems (macOS and Linux) or tasklist for Windows. The parsing logic normalizes the differing output formats into a consistent structure, allowing downstream analysis in src/utils/system-info.ts to remain platform-agnostic.
What specific development tools can DesktopCommanderMCP detect?
According to the source code in src/utils/system-info.ts, the system specifically detects Node.js (via detectNodeInfo), Python (via detectPythonInfo), Xcode Command Line Tools, Homebrew, Docker, and Podman. It scans process names for binaries like node, python, git, code, and docker, then correlates these with version information and installation paths to confirm availability.
Is the process detection real-time or cached?
The detection is real-time and on-demand. Each call to list_processes or getSystemInfo executes fresh system queries rather than relying on cached data. This ensures that recently started development servers, newly installed tools, or terminated processes are accurately reflected in the guidance output, though it means the operations incur the latency of executing native OS commands.
Can the system distinguish between installed tools and actively running tools?
Yes. The getDevelopmentToolGuidance function combines two data sources: the active process list from list_processes (showing currently running tools) and static environment checks (showing installed but possibly inactive tools). For example, it can report that Docker is installed based on filesystem checks while noting that the Docker daemon is not currently running based on the absence of docker processes in the output from src/tools/process.ts.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →