Thursday, December 3, 2026 | London 11°C · Drizzle
DailyGlimpse

AI

Desktop Commander MCP: A Step-by-Step Guide to Installing and Securing Local AI Control

Alex Hitt 2 min read

Desktop Commander MCP is an open-source tool that connects Anthropic's Claude Desktop to your local terminal and file system via the Model Context Protocol. This guide walks through installation from the GitHub repository, setting access restrictions, and testing the setup.

Overview

Desktop Commander MCP, created by developer wonderwhy-er, allows Claude Desktop to execute commands and read files on your local machine. It's designed for users who want AI-powered automation while maintaining control over what the model can access.

Installation Requirements

Before installing, ensure you have Node.js installed (version 18 or later). You'll also need Claude Desktop, which can be downloaded from Anthropic's website. The tool uses NPX (Node Package eXecute) for a lightweight, dependency-free installation.

Step 1: Install Desktop Commander MCP

Open a terminal and run:

npx @anthropic-ai/desktop-commander-mcp

This command downloads and starts the MCP server locally. The first run may take longer as it caches the package.

Step 2: Configure Claude Desktop

After starting the MCP server, restart Claude Desktop. The application should automatically detect the new tool. You can verify by typing a command like "list files in current directory" in Claude.

Step 3: Restrict Access for Security

To limit which directories Claude can access, set the ALLOWED_DIRECTORIES environment variable. For example, to allow only the Documents folder:

ALLOWED_DIRECTORIES=/home/user/Documents npx @anthropic-ai/desktop-commander-mcp

Multiple directories can be separated by colons on Linux/Mac or semicolons on Windows. This prevents the AI from reading sensitive system files.

Step 4: Test the Setup

Open Claude Desktop and ask it to perform a simple file operation within the allowed directory, such as creating a test file or reading a text document. If the tool is configured correctly, Claude will execute the command and return the result.

Troubleshooting

  • MCP server not detected: Ensure Node.js is in your PATH and that you restarted Claude Desktop.
  • Permission errors: Check that the allowed directory paths are absolute and exist.
  • Port conflicts: The server runs on port 3000 by default; change with the PORT environment variable.

For more details, visit the official GitHub repository.

React