Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ server.log

# Local planning/documentation directories
plans/
planning/

# Test output files
test/test_output/
1 change: 1 addition & 0 deletions .serena/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/cache
42 changes: 42 additions & 0 deletions .serena/memories/code_style_conventions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Desktop Commander MCP - Code Style and Conventions

## TypeScript Configuration
- Target: ES2022+
- Modules: ESNext with .js extensions in imports
- Strict mode enabled
- Node.js >= 18.0.0 required

## Code Style
- **Naming Convention**:
- camelCase for variables and functions
- PascalCase for classes and interfaces
- UPPER_SNAKE_CASE for constants
- **File Organization**:
- Tools in `src/tools/` directory
- Handlers in `src/handlers/` directory
- Utilities in `src/utils/` directory
- Schemas centralized in `src/tools/schemas.ts`

## Key Patterns
- **Zod Schemas**: All inputs validated with Zod schemas
- **Error Handling**: Comprehensive try-catch with detailed error messages
- **Logging**: Usage tracking and audit logging throughout
- **Type Safety**: Strong TypeScript typing, avoid `any`
- **MCP Protocol**: Follow MCP SDK patterns for tool registration

## Architecture Patterns
- **Tool-based**: Each feature implemented as MCP tools
- **Handler Pattern**: Request handlers separate from tool logic
- **Schema-first**: Define Zod schemas before implementation
- **Async/Await**: Consistent async patterns throughout

## Documentation
- JSDoc comments for public functions
- README.md with comprehensive examples
- Inline comments for complex logic
- Error messages should be user-friendly

## Testing
- Test files in `test/` directory
- Integration tests for MCP tools
- Manual testing with MCP inspector
37 changes: 37 additions & 0 deletions .serena/memories/project_overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Desktop Commander MCP - Project Overview

## Purpose
Desktop Commander is a Model Context Protocol (MCP) server that extends Claude Desktop with comprehensive terminal and file system capabilities. It allows Claude to execute shell commands, manage processes, perform file operations, and edit code directly on the user's system.

## Tech Stack
- **Language**: TypeScript
- **Runtime**: Node.js (>=18.0.0)
- **Framework**: MCP SDK (@modelcontextprotocol/sdk)
- **Build System**: TypeScript compiler with custom scripts
- **Key Dependencies**:
- MCP SDK for protocol handling
- @vscode/ripgrep for file searching
- fastest-levenshtein for fuzzy matching
- zod for schema validation

## Project Structure
- `src/`: Main source code
- `tools/`: Tool implementations (filesystem, terminal, config, etc.)
- `handlers/`: Request handlers for different operations
- `utils/`: Utility functions and helpers
- `server.ts`: Main MCP server setup
- `index.ts`: Entry point
- `test/`: Test files and examples
- `scripts/`: Build and utility scripts
- `dist/`: Compiled JavaScript output

## Key Features
- Terminal command execution with process management
- Full filesystem operations (read, write, search)
- Code editing with surgical text replacements
- Configuration management
- Audit logging
- Usage analytics
- Docker support for isolated execution

## Version: 0.2.11
55 changes: 55 additions & 0 deletions .serena/memories/suggested_commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Desktop Commander MCP - Development Commands

## Essential Commands

### Build & Development
```bash
npm run build # Compile TypeScript to dist/
npm run watch # Watch mode for development
npm run start # Run the compiled server
npm run start:debug # Run with Node.js debugger
npm run clean # Remove dist/ directory
```

### Setup & Installation
```bash
npm run setup # Build and configure Claude Desktop
npm run setup:debug # Setup with debug mode enabled
npm run remove # Uninstall from Claude Desktop
```

### Testing
```bash
npm run test # Run all tests
npm run test:debug # Run tests with debugger
```

### MCP Inspector
```bash
npm run inspector # Launch MCP inspector tool
```

### Fuzzy Search Logs
```bash
npm run logs:view # View recent fuzzy search logs
npm run logs:analyze # Analyze log patterns
npm run logs:clear # Clear all logs
npm run logs:export # Export logs to CSV/JSON
```

### Version Management
```bash
npm run sync-version # Sync versions across files
npm run bump # Bump patch version
npm run bump:minor # Bump minor version
npm run bump:major # Bump major version
```

## System-Specific Commands (Darwin/macOS)
- `find`: Use for file searching
- `grep`: Text pattern searching
- `ls`: Directory listing
- `cd`: Directory navigation
- `git`: Version control operations
- `killall`: Process termination
- `open`: Application launching
45 changes: 45 additions & 0 deletions .serena/memories/task_completion_checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Desktop Commander MCP - Task Completion Checklist

## When a Task is Completed

### Code Quality
- [ ] Run `npm run build` to ensure TypeScript compilation succeeds
- [ ] Check for TypeScript errors and warnings
- [ ] Verify imports use correct .js extensions for ESM compatibility
- [ ] Ensure proper error handling with try-catch blocks

### Testing
- [ ] Run `npm run test` to execute integration tests
- [ ] Test manually with `npm run inspector` if needed
- [ ] Verify tool functionality in Claude Desktop

### Schema Validation
- [ ] Update Zod schemas in `src/tools/schemas.ts` if needed
- [ ] Ensure all new parameters are properly validated
- [ ] Test schema validation with invalid inputs

### Documentation
- [ ] Update tool descriptions and examples
- [ ] Add JSDoc comments for new functions
- [ ] Update README.md if new features added

### Version Management
- [ ] Run `npm run bump` for patch versions
- [ ] Run `npm run bump:minor` for new features
- [ ] Run `npm run bump:major` for breaking changes

### Deployment Preparation
- [ ] Ensure `dist/` directory is properly generated
- [ ] Verify all required files are in the `files` array in package.json
- [ ] Test installation with `npm run setup`

### Performance & Logging
- [ ] Check that usage tracking is properly implemented
- [ ] Verify audit logging is working for new tools
- [ ] Test memory usage for large operations

## Before Committing
- [ ] Clean build: `npm run clean && npm run build`
- [ ] All tests pass: `npm run test`
- [ ] No TypeScript errors or warnings
- [ ] Manual testing in Claude Desktop works correctly
68 changes: 68 additions & 0 deletions .serena/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# language of the project (csharp, python, rust, java, typescript, go, cpp, or ruby)
# * For C, use cpp
# * For JavaScript, use typescript
# Special requirements:
# * csharp: Requires the presence of a .sln file in the project folder.
language: typescript

# whether to use the project's gitignore file to ignore files
# Added on 2025-04-07
ignore_all_files_in_gitignore: true
# list of additional paths to ignore
# same syntax as gitignore, so you can use * and **
# Was previously called `ignored_dirs`, please update your config if you are using that.
# Added (renamed) on 2025-04-07
ignored_paths: []

# whether the project is in read-only mode
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
# Added on 2025-04-18
read_only: false


# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
# Below is the complete list of tools for convenience.
# To make sure you have the latest list of tools, and to view their descriptions,
# execute `uv run scripts/print_tool_overview.py`.
#
# * `activate_project`: Activates a project by name.
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
# * `create_text_file`: Creates/overwrites a file in the project directory.
# * `delete_lines`: Deletes a range of lines within a file.
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
# * `execute_shell_command`: Executes a shell command.
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
# * `initial_instructions`: Gets the initial instructions for the current project.
# Should only be used in settings where the system prompt cannot be set,
# e.g. in clients you have no control over, like Claude Desktop.
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
# * `insert_at_line`: Inserts content at a given line in a file.
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
# * `list_memories`: Lists memories in Serena's project-specific memory store.
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
# * `read_file`: Reads a file within the project directory.
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
# * `remove_project`: Removes a project from the Serena configuration.
# * `replace_lines`: Replaces a range of lines within a file with new content.
# * `replace_symbol_body`: Replaces the full definition of a symbol.
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
# * `search_for_pattern`: Performs a search for a pattern in the project.
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
# * `switch_modes`: Activates modes by providing a list of their names
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
excluded_tools: []

# initial prompt for the project. It will always be given to the LLM upon activating the project
# (contrary to the memories, which are loaded on demand).
initial_prompt: ""

project_name: "DesktopCommanderMCP"
19 changes: 19 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This document provides answers to the most commonly asked questions about Claude
- [How do I install Claude Desktop Commander?](#how-do-i-install-claude-desktop-commander)
- [How do I update to the latest version?](#how-do-i-update-to-the-latest-version)
- [Which operating systems does it support?](#which-operating-systems-does-it-support)
- [How do I get started after installing Desktop Commander?](#how-do-i-get-started-after-installing-desktop-commander)

- [Features & Capabilities](#features--capabilities)
- [What can I do with Claude Desktop Commander?](#what-can-i-do-with-claude-desktop-commander)
Expand Down Expand Up @@ -172,6 +173,24 @@ Claude Desktop Commander works with:

Work is in progress to improve WSL (Windows Subsystem for Linux) integration and add SSH support for remote servers.

### How do I get started after installing Desktop Commander?

After installation, Desktop Commander includes intelligent onboarding to help new users discover its capabilities:

**Automatic Onboarding:** When you're a new user (fewer than 10 successful commands), Claude will automatically offer helpful getting-started guidance and tutorials after you use Desktop Commander successfully.

**Manual Onboarding:** You can also request onboarding help at any time by simply asking Claude:
- "Help me get started with Desktop Commander"
- "Show me Desktop Commander examples"
- "What can I do with Desktop Commander?"

**Starter Examples:** Claude will show you beginner-friendly tutorials like:
- Organizing your Downloads folder
- Analyzing CSV files
- Setting up GitHub Actions
- Exploring codebases
- And more hands-on examples

## Features & Capabilities

### What can I do with Claude Desktop Commander?
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Work with code and text, run processes, and automate tasks, going far beyond oth
## Table of Contents
- [Features](#features)
- [How to install](#how-to-install)
- [Getting Started](#getting-started)
- [Usage](#usage)
- [Handling Long-Running Commands](#handling-long-running-commands)
- [Work in Progress and TODOs](#roadmap)
Expand Down Expand Up @@ -378,6 +379,28 @@ Close and restart Claude Desktop to complete the removal.
**Need help?**
- Join our Discord community: https://discord.com/invite/kQ27sNnZr7

## Getting Started

Once Desktop Commander is installed and Claude Desktop is restarted, you're ready to supercharge your Claude experience!

### 🚀 New User Onboarding

Desktop Commander includes intelligent onboarding to help you discover what's possible:

**For New Users:** When you're just getting started (fewer than 10 successful commands), Claude will automatically offer helpful getting-started guidance and practical tutorials after you use Desktop Commander successfully.

**Request Help Anytime:** You can ask for onboarding assistance at any time by simply saying:
- *"Help me get started with Desktop Commander"*
- *"Show me Desktop Commander examples"*
- *"What can I do with Desktop Commander?"*

Claude will then show you beginner-friendly tutorials and examples, including:
- 📁 Organizing your Downloads folder automatically
- 📊 Analyzing CSV/Excel files with Python
- ⚙️ Setting up GitHub Actions CI/CD
- 🔍 Exploring and understanding codebases
- 🤖 Running interactive development environments

## Usage

The server provides a comprehensive set of tools organized into several categories:
Expand Down
Loading