@developkiko/desktop-commander

@developkiko/desktop-commander

MCP server for terminal operations and file editing, enabling AI assistants to manage files, run commands, and process large content with auto-chunking.

Category
访问服务器

README

🇷🇺 Русская версия

<br />

<div align="center"> <h1>🖥️ @developkiko/desktop-commander</h1> <p><strong>MCP server for terminal operations and file editing</strong></p> <p>Fork of <a href="https://github.com/wonderwhy-er/DesktopCommanderMCP">Desktop Commander</a> with critical fixes for large file handling</p>

<p> <a href="https://www.npmjs.com/package/@developkiko/desktop-commander"> <img src="https://img.shields.io/npm/v/@developkiko/desktop-commander?style=for-the-badge&logo=npm&color=cb3837" alt="npm version" /> </a> <a href="https://github.com/developkiko/DsktpCmndr/blob/main/LICENSE"> <img src="https://img.shields.io/github/license/developkiko/DsktpCmndr?style=for-the-badge&color=blue" alt="MIT License" /> </a> <a href="https://github.com/developkiko/DsktpCmndr"> <img src="https://img.shields.io/github/stars/developkiko/DsktpCmndr?style=for-the-badge&logo=github&color=gold" alt="GitHub Stars" /> </a> <br /> <a href="https://nodejs.org/"> <img src="https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen?style=for-the-badge&logo=node.js" alt="Node Version" /> </a> <a href="https://www.typescriptlang.org/"> <img src="https://img.shields.io/badge/built%20with-TypeScript-3178C6?style=for-the-badge&logo=typescript" alt="TypeScript" /> </a> <img src="https://img.shields.io/badge/MCP-server-6C47FF?style=for-the-badge&logo=anthropic" alt="MCP Server" /> </p> </div>


📋 Table of Contents


🧐 What is this?

Desktop Commander is an MCP (Model Context Protocol) server that gives AI assistants like Claude, Chatbox, Cursor, and others direct access to your computer's file system and terminal.

With it, an LLM agent can:

  • 📁 Create, read, edit, and delete files and folders
  • 🔍 Search for files and text across your project
  • 🖥️ Run terminal commands and Python scripts
  • 📄 Work with PDFs, Excel files, and images
  • ✏️ Perform surgical text replacements with edit_block

This is a maintained fork with critical bug fixes — see below.


✨ What's Fixed?

The original Desktop Commander had a critical issue: no content size limits in file operations. When an AI tried to write files larger than ~500 lines, the entire content was sent as a single MCP JSON-RPC message, causing:

❌ Unterminated string in JSON at position 37769

🔴 Problem 1: write_file buffer overflow

Before (original): Writing 5000 lines → 1 giant JSON-RPC string → stdio buffer overflows → JSON.parse crash

After (fixed): Content is automatically split into 30-line chunks, each written in a separate MCP call:

Chunk Mode Content
#1 rewrite Lines 1–30
#2 append Lines 31–60
#3 append Lines 61–90
... append ...
#167 append Lines 4971–5000

🔴 Problem 2: No size validation for read/write

Before: writeFile() could receive 500MB+ in one call → OOM. readFile() could load a 2GB file → heap overflow.

After: Explicit byte limits with clear error messages:

  • writeFile(): 10 MB max content size
  • readFileInternal(): 50 MB max file size
  • handleWriteFile(): 10,000 lines hard cap with auto-chunking up to that limit

🔴 Problem 3: Windows path handling

Paths are now properly normalized regardless of slash direction (/ vs \).


📦 Installation

Option A: Via npx (recommended)

npx @developkiko/desktop-commander@latest

Option B: Global install

npm install -g @developkiko/desktop-commander
desktop-commander

Option C: Local development

# Clone and build
git clone https://github.com/developkiko/DsktpCmndr.git
cd DsktpCmndr
npm install
npm run build

# Run directly
node dist/index.js

⚙️ Configuration in Chatbox AI

To use this server in Chatbox AI:

  1. Open Settings → MCP Servers
  2. Click Add MCP Server (or edit existing)
  3. Fill in:
Field Value
Name DsktpCmndr
Type stdio
Command npx
Args @developkiko/desktop-commander@latest
Env (leave empty unless needed)
  1. Save and restart Chatbox

Or, for the local build:

  • Command: node
  • Args: E:\LLM\mcps\DsktpCmndr\dist\index.js

🔧 Available Tools

# Tool Description
1 read_file Read files (text, PDF, Excel, images) with offset/length pagination
2 read_multiple_files Read multiple files at once
3 write_file Auto-chunking! Writes files with automatic splitting for large content
4 edit_block Surgical find-and-replace in files
5 create_directory Create folders (recursive)
6 list_directory List folder contents with configurable depth
7 move_file Move or rename files
8 get_file_info Get file metadata (size, dates, line count, sheets)
9 write_pdf Create and modify PDF files
10 start_process Run terminal commands and REPLs (Python, Node.js, etc.)
11 read_process_output Read process output with pagination
12 interact_with_process Send input to a running process
13 force_terminate Stop a running process
14 kill_process Kill a process by PID
15 start_search Search files by name or content (streaming)
16 get_config View server configuration
17 set_config_value Modify server configuration

💡 Usage Examples

📁 Creating a project structure

"Create folders for a React project: src/components, src/pages, src/hooks, public, and a blank README.md"

flowchart LR
    A["🖥️ You ask AI"] --> B["create_directory('src/components')"]
    A --> C["create_directory('src/pages')"]
    A --> D["create_directory('src/hooks')"]
    A --> E["create_directory('public')"]
    A --> F["write_file('README.md','# My Project')"]

🔍 Searching for text in files

"Find all .ts files in E:\WORK\my\GameDev that contain GameLoop and show the first 10 lines"

  1. start_search(path="E:\WORK\my\GameDev", pattern="GameLoop", searchType="content", filePattern="*.ts")
  2. get_more_search_results(sessionId)
  3. For each result: read_file(path, offset=0, length=10)

📊 Analyzing a large CSV

Bad approach: ❌ "Read this 500MB CSV file" → MCP buffer overflow

Good approach: ✅ "Read the first 5 lines of sales.csv to see headers, then start Python and analyze with pandas"

1. read_file("sales.csv", offset=0, length=5)  → shows headers
2. start_process("python -i")
3. import pandas as pd
4. df = pd.read_csv("E:/DATA/sales.csv")       ← Python reads directly
5. df.groupby("Region")["Amount"].sum()         ← analysis in Python

🐍 Running a Python script

"Run E:\scripts\backup.py and tell me what it outputs"

1. start_process("python E:\scripts\backup.py")
2. read_process_output(pid)

✏️ Replacing text across files

"Replace console.log with logger.info in all .js files in E:\WORK\app"

1. start_search(path="E:\WORK\app", pattern="console.log", filePattern="*.js")
2. For each match: edit_block(file, old="console.log", new="logger.info")

📚 Why This Fork?

The original Desktop Commander by wonderwhy-er is a fantastic project. This fork exists to:

  1. Fix the critical auto-chunking bug — large files would crash the MCP transport
  2. Add proper size validation — prevent OOM from accidental giant file reads/writes
  3. Provide ongoing maintenance — as an independent community fork
  4. Ensure Windows compatibility — proper path handling for Windows users

All credit for the original architecture goes to wonderwhy-er and contributors.


🔗 Links

Resource Link
📦 npm @developkiko/desktop-commander
🐙 GitHub github.com/developkiko/DsktpCmndr
🏠 Original Desktop Commander by wonderwhy-er
💬 MCP Protocol modelcontextprotocol.io

<div align="center"> <sub>Built with ❤️ by <strong>Kiko</strong> — MIT License</sub> </div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选