file_path stringlengths 3 280 | file_language stringclasses 66
values | content stringlengths 1 1.04M | repo_name stringlengths 5 92 | repo_stars int64 0 154k | repo_description stringlengths 0 402 | repo_primary_language stringclasses 108
values | developer_username stringlengths 1 25 | developer_name stringlengths 0 30 | developer_company stringlengths 0 82 |
|---|---|---|---|---|---|---|---|---|---|
scripts/validate-tools-sync.js | JavaScript | #!/usr/bin/env node
/**
* Validates that the tools listed in mcpb-bundle/manifest.json match
* the tools actually provided by the running MCP server
*
* This uses JSON-RPC to query the server directly, avoiding fragile regex parsing.
*/
import { readFile } from 'fs/promises';
import { join, dirname } from 'path'... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
scripts/view-fuzzy-logs.js | JavaScript | #!/usr/bin/env node
import { fuzzySearchLogger } from '../dist/utils/fuzzySearchLogger.js';
// Simple argument parsing
const args = process.argv.slice(2);
let count = 10;
// Parse --count or -c argument
for (let i = 0; i < args.length; i++) {
if (args[i] === '--count' || args[i] === '-c') {
count = parseInt(ar... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
setup-claude-server.js | JavaScript | import { homedir, platform } from 'os';
import fs from 'fs/promises';
import path from 'path';
import { join } from 'path';
import { readFileSync, writeFileSync, existsSync, appendFileSync, mkdirSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
import { exec } from "node:child_proce... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/command-manager.ts | TypeScript | import path from 'path';
import {configManager} from './config-manager.js';
import {capture} from "./utils/capture.js";
class CommandManager {
getBaseCommand(command: string) {
return command.split(' ')[0].toLowerCase().trim();
}
extractCommands(commandString: string): string[] {
try {
... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/config-manager.ts | TypeScript | import fs from 'fs/promises';
import path from 'path';
import { existsSync } from 'fs';
import { mkdir } from 'fs/promises';
import os from 'os';
import { VERSION } from './version.js';
import { CONFIG_FILE } from './config.js';
export interface ServerConfig {
blockedCommands?: string[];
defaultShell?: string;
a... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/config.ts | TypeScript | import path from 'path';
import os from 'os';
// Use user's home directory for configuration files
export const USER_HOME = os.homedir();
const CONFIG_DIR = path.join(USER_HOME, '.claude-server-commander');
// Paths relative to the config directory
export const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
expo... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/custom-stdio.ts | TypeScript | import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import process from "node:process";
interface LogNotification {
jsonrpc: "2.0";
method: "notifications/message";
params: {
level: "emergency" | "alert" | "critical" | "error" | "warning" | "notice" | "info" | "debug";
logge... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/error-handlers.ts | TypeScript | import { ServerResult } from './types.js';
import {capture} from "./utils/capture.js";
/**
* Creates a standard error response for tools
* @param message The error message
* @returns A ServerResult with the error message
*/
export function createErrorResponse(message: string): ServerResult {
capture('server_requ... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/handlers/edit-search-handlers.ts | TypeScript | import {
EditBlockArgsSchema
} from '../tools/schemas.js';
import { handleEditBlock } from '../tools/edit.js';
import { ServerResult } from '../types.js';
/**
* Handle edit_block command
* Uses the enhanced implementation with multiple occurrence support and fuzzy matching
*/
export { handleEditBlock }; | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/handlers/filesystem-handlers.ts | TypeScript | import {
readFile,
readMultipleFiles,
writeFile,
createDirectory,
listDirectory,
moveFile,
getFileInfo,
writePdf,
type FileResult,
type MultiFileResult
} from '../tools/filesystem.js';
import type { ReadOptions } from '../utils/files/base.js';
import { ServerResult } from '../ty... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/handlers/history-handlers.ts | TypeScript | import { toolHistory } from '../utils/toolHistory.js';
import { GetRecentToolCallsArgsSchema, TrackUiEventArgsSchema } from '../tools/schemas.js';
import { ServerResult } from '../types.js';
import { capture_ui_event } from '../utils/capture.js';
type TrackUiEventParams = Record<string, string | number | boolean | nul... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/handlers/index.ts | TypeScript | // Export all handlers from their respective files
export * from './filesystem-handlers.js';
export * from './terminal-handlers.js';
export * from './process-handlers.js';
export * from './edit-search-handlers.js';
export * from './search-handlers.js';
export * from './history-handlers.js';
| wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/handlers/process-handlers.ts | TypeScript | import {
listProcesses,
killProcess
} from '../tools/process.js';
import {
KillProcessArgsSchema
} from '../tools/schemas.js';
import { ServerResult } from '../types.js';
/**
* Handle list_processes command
*/
export async function handleListProcesses(): Promise<ServerResult> {
return listProcess... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/handlers/search-handlers.ts | TypeScript | import { searchManager } from '../search-manager.js';
import {
StartSearchArgsSchema,
GetMoreSearchResultsArgsSchema,
StopSearchArgsSchema
} from '../tools/schemas.js';
import { ServerResult } from '../types.js';
import { capture } from '../utils/capture.js';
/**
* Handle start_search command
*/
export async f... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/handlers/terminal-handlers.ts | TypeScript | import {
startProcess,
readProcessOutput,
interactWithProcess,
forceTerminate,
listSessions
} from '../tools/improved-process-tools.js';
import {
StartProcessArgsSchema,
ReadProcessOutputArgsSchema,
InteractWithProcessArgsSchema,
ForceTerminateArgsSchema,
ListSessionsArgsS... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/index.ts | TypeScript | #!/usr/bin/env node
import { FilteredStdioServerTransport } from './custom-stdio.js';
import { server, flushDeferredMessages } from './server.js';
import { commandManager } from './command-manager.js';
import { configManager } from './config-manager.js';
import { featureFlagManager } from './utils/feature-flags.js';
i... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/npm-scripts/remote.ts | TypeScript | import { MCPDevice } from '../remote-device/device.js';
import os from 'os';
export async function runRemote() {
const persistSession = process.argv.includes('--persist-session');
const disableNoSleep = process.argv.includes('--disable-no-sleep');
const verbose = process.argv.includes('--debug');
conso... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/npm-scripts/setup.ts | TypeScript | import { join, dirname } from 'path';
import { fileURLToPath, pathToFileURL } from 'url';
import { platform } from 'os';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const isWindows = platform() === 'win32';
// Helper function to properly convert file paths to URLs, especi... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/npm-scripts/uninstall.ts | TypeScript | import { join, dirname } from 'path';
import { fileURLToPath, pathToFileURL } from 'url';
import { platform } from 'os';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const isWindows = platform() === 'win32';
// Helper function to properly convert file paths to URLs, especi... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/npm-scripts/verify-ripgrep.ts | TypeScript | #!/usr/bin/env node
/**
* Verify ripgrep binary availability after installation
* This runs after npm install to warn users if ripgrep is not available
*/
import { getRipgrepPath } from '../utils/ripgrep-resolver.js';
async function verifyRipgrep() {
try {
const path = await getRipgrepPath();
console.lo... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/remote-device/desktop-commander-integration.ts | TypeScript | import { spawn } from 'child_process';
import path from 'path';
import fs from 'fs/promises';
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
import { fileURLToPath } from 'url';
import { captureRemote } from '../utils... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/remote-device/device-authenticator.ts | TypeScript | import open from 'open';
import os from 'os';
import crypto from 'crypto';
import { captureRemote } from '../utils/capture.js';
interface AuthSession {
access_token: string;
refresh_token: string | null;
device_id?: string;
}
interface DeviceAuthResponse {
device_code: string;
user_code: string;
... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/remote-device/device.ts | TypeScript | #!/usr/bin/env node
import { RemoteChannel } from './remote-channel.js';
import { DeviceAuthenticator } from './device-authenticator.js';
import { DesktopCommanderIntegration } from './desktop-commander-integration.js';
import { fileURLToPath } from 'url';
import os from 'os';
import fs from 'fs/promises';
import path... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/remote-device/remote-channel.ts | TypeScript | import { createClient, SupabaseClient, Session, UserResponse, User, RealtimeChannel } from '@supabase/supabase-js';
import { captureRemote } from '../utils/capture.js';
export interface AuthSession {
access_token: string;
refresh_token: string | null;
device_id?: string;
}
interface DeviceData {
user... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/remote-device/scripts/blocking-offline-update.js | JavaScript | #!/usr/bin/env node
/**
* Blocking script to update device status to offline
* Runs synchronously during shutdown to ensure DB update completes
*
* Usage: node blocking-offline-update.js <deviceId> <supabaseUrl> <supabaseKey> <accessToken> <refreshToken>
*/
import { createClient } from '@supabase/supabase-js';
... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/search-manager.ts | TypeScript | import { spawn, ChildProcess } from 'child_process';
import path from 'path';
import fs from 'fs/promises';
import { validatePath } from './tools/filesystem.js';
import { capture } from './utils/capture.js';
import { getRipgrepPath } from './utils/ripgrep-resolver.js';
import { isExcelFile } from './utils/files/index.j... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/server.ts | TypeScript | import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import {
CallToolRequestSchema,
ListToolsRequestSchema,
ListResourcesRequestSchema,
ReadResourceRequestSchema,
ListResourceTemplatesRequestSchema,
ListPromptsRequestSchema,
InitializeRequestSchema,
LATEST_PROTOCOL_VERSIO... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/terminal-manager.ts | TypeScript | import { spawn } from 'child_process';
import path from 'path';
import { TerminalSession, CommandExecutionResult, ActiveSession, TimingInfo, OutputEvent } from './types.js';
import { DEFAULT_COMMAND_TIMEOUT } from './config.js';
import { configManager } from './config-manager.js';
import {capture} from "./utils/capture... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/config.ts | TypeScript | import { configManager, ServerConfig } from '../config-manager.js';
import { SetConfigValueArgsSchema } from './schemas.js';
import { getSystemInfo } from '../utils/system-info.js';
import { currentClient } from '../server.js';
import { featureFlagManager } from '../utils/feature-flags.js';
/**
* Get the entire confi... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/edit.ts | TypeScript | /**
* Text file editing via search/replace with fuzzy matching support.
*
* TECHNICAL DEBT / ARCHITECTURAL NOTE:
* This file contains text editing logic that should ideally live in TextFileHandler.editRange()
* to be consistent with how Excel editing works (ExcelFileHandler.editRange()).
*
* Current inconsistenc... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/feedback.ts | TypeScript | import { ServerResult } from '../types.js';
import { usageTracker } from '../utils/usageTracker.js';
import { capture } from '../utils/capture.js';
import { configManager } from '../config-manager.js';
import { exec } from 'child_process';
import { promisify } from 'util';
import * as os from 'os';
const execAsync = p... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/filesystem.ts | TypeScript | import fs from "fs/promises";
import path from "path";
import os from 'os';
import fetch from 'cross-fetch';
import { capture } from '../utils/capture.js';
import { withTimeout } from '../utils/withTimeout.js';
import { configManager } from '../config-manager.js';
import { getFileHandler, TextFileHandler } from '../uti... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/fuzzySearch.ts | TypeScript | import { distance } from 'fastest-levenshtein';
import { capture } from '../utils/capture.js';
/**
* Recursively finds the closest match to a query string within text using fuzzy matching
* @param text The text to search within
* @param query The query string to find
* @param start Start index in the text (default... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/improved-process-tools.ts | TypeScript | import { terminalManager } from '../terminal-manager.js';
import { commandManager } from '../command-manager.js';
import { StartProcessArgsSchema, ReadProcessOutputArgsSchema, InteractWithProcessArgsSchema, ForceTerminateArgsSchema, ListSessionsArgsSchema } from './schemas.js';
import { capture } from "../utils/capture... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/mime-types.ts | TypeScript | // Simple MIME type detection based on file extension
export function getMimeType(filePath: string): string {
const extension = filePath.toLowerCase().split('.').pop() || '';
if (extension === "pdf") {
return "application/pdf";
}
// Image types - only the formats we can display
const imageTypes: Record<... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/pdf/extract-images.ts | TypeScript | import { getDocumentProxy, extractImages } from 'unpdf';
export interface ImageInfo {
/** Object ID within PDF */
objId: number;
width: number;
height: number;
/** Raw image data as base64 */
data: string;
/** MIME type of the image */
mimeType: string;
/** Original size in bytes be... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/pdf/index.ts | TypeScript | export { editPdf } from './manipulations.js';
export type { PdfOperations, PdfInsertOperation, PdfDeleteOperation } from './manipulations.js';
export { parsePdfToMarkdown, parseMarkdownToPdf } from './markdown.js';
export type { PdfMetadata, PdfPageItem } from './lib/pdf2md.js';
export { extractImagesFromPdf } from './... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/pdf/lib/pdf2md.ts | TypeScript | import { createRequire } from 'module';
import { generatePageNumbers } from '../utils.js';
import { extractImagesFromPdf, ImageInfo } from '../extract-images.js';
const require = createRequire(import.meta.url);
const { parse } = require('@opendocsg/pdf2md/lib/util/pdf');
const { makeTransformations, transform } = req... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/pdf/manipulations.ts | TypeScript | import fs from 'fs/promises';
import { createRequire } from 'module';
import type { PDFDocument as PDFDocumentType, PDFPage } from 'pdf-lib';
import { normalizePageIndexes } from './utils.js';
import { parseMarkdownToPdf } from './markdown.js';
import type { PdfInsertOperationSchema, PdfDeleteOperationSchema, PdfOperat... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/pdf/markdown.ts | TypeScript | import fs from 'fs/promises';
import { existsSync } from 'fs';
import { homedir } from 'os';
import { join } from 'path';
import { mdToPdf } from 'md-to-pdf';
import type { PageRange } from './lib/pdf2md.js';
import { PdfParseResult, pdf2md } from './lib/pdf2md.js';
const isUrl = (source: string): boolean =>
sourc... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/pdf/utils.ts | TypeScript |
/**
* Normalize page indexes, handling negative indices and removing duplicates
*/
export const normalizePageIndexes = (pageIndexes: number[], pageCount: number): number[] => {
const normalizedIndexes = pageIndexes
.map(idx => idx < 0 ? pageCount + idx : idx)
.filter(idx => idx >= 0 && idx < page... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/process.ts | TypeScript | import { exec } from 'child_process';
import { promisify } from 'util';
import os from 'os';
import { ProcessInfo, ServerResult } from '../types.js';
import { KillProcessArgsSchema } from './schemas.js';
const execAsync = promisify(exec);
export async function listProcesses(): Promise<ServerResult> {
const command ... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/prompts.ts | TypeScript | import { ServerResult } from '../types.js';
import { usageTracker } from '../utils/usageTracker.js';
import { capture } from '../utils/capture.js';
import * as fs from 'fs/promises';
import * as path from 'path';
import { fileURLToPath } from 'url';
// Get the directory path for ES modules
const __filename = fileURLTo... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/schemas.ts | TypeScript | import { z } from "zod";
// Config tools schemas
export const GetConfigArgsSchema = z.object({});
export const SetConfigValueArgsSchema = z.object({
key: z.string(),
value: z.union([
z.string(),
z.number(),
z.boolean(),
z.array(z.string()),
z.null(),
]),
});
// Empty schemas
export const Li... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/tools/usage.ts | TypeScript | import { ServerResult } from '../types.js';
import { usageTracker } from '../utils/usageTracker.js';
/**
* Get usage statistics for debugging and analysis
*/
export async function getUsageStats(): Promise<ServerResult> {
try {
const summary = await usageTracker.getUsageSummary();
return {
conten... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/types.ts | TypeScript | import { ChildProcess } from 'child_process';
import { FilteredStdioServerTransport } from './custom-stdio.js';
import type { PreviewFileType } from './ui/file-preview/shared/preview-file-types.js';
declare global {
var mcpTransport: FilteredStdioServerTransport | undefined;
var disableOnboarding: boolean | undefi... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/types/caffeinate.d.ts | TypeScript | declare module 'caffeinate' {
interface CaffeinateOptions {
pid?: number;
timeout?: number;
}
function caffeinate(options?: CaffeinateOptions): Promise<number>;
export default caffeinate;
} | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/contracts.ts | TypeScript | /**
* Central constants and shape contracts for UI resource identifiers. It gives one source of truth for URIs/tool metadata shared between server handlers and UI loaders.
*/
export const FILE_PREVIEW_RESOURCE_URI = 'ui://desktop-commander/file-preview';
export const CONFIG_EDITOR_RESOURCE_URI = 'ui://desktop-command... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/file-preview/index.html | HTML | <!doctype html>
<!--
Host page for the File Preview MCP UI. It establishes the root structure and script/style loading required to render text, markdown, and HTML previews safely.
-->
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>D... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/file-preview/shared/preview-file-types.ts | TypeScript | /**
* File-type inference rules used by preview flows to choose render strategy. It maps extension/path hints into supported preview modes and explicit unsupported states.
*/
import path from 'path';
export type PreviewFileType = 'markdown' | 'text' | 'html' | 'unsupported';
export const MARKDOWN_PREVIEW_EXTENSIONS... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/file-preview/src/app.ts | TypeScript | /**
* Top-level controller for the File Preview app. It routes structured content into the appropriate renderer, handles host events, and coordinates user-facing state changes.
*/
import { formatJsonIfPossible, inferLanguageFromPath, renderCodeViewer } from './components/code-viewer.js';
import { renderHtmlPreview } ... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/file-preview/src/components/code-viewer.ts | TypeScript | /**
* Code/text viewer renderer responsible for escaping, optional formatting, and syntax-highlight output wrappers. It provides a safe default for non-rich preview content.
*/
import { highlightSource } from './highlighting.js';
const EXTENSION_LANGUAGE_MAP: Record<string, string> = {
js: 'javascript',
cjs:... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/file-preview/src/components/highlighting.ts | TypeScript | /**
* Syntax highlighting integration layer around highlight.js. It registers supported languages and provides safe helpers for highlighted or plain escaped output.
*/
import { escapeHtml as sharedEscapeHtml } from '../../../shared/escape-html.js';
import hljs from 'highlight.js/lib/core';
import bash from 'highlight... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/file-preview/src/components/html-renderer.ts | TypeScript | /**
* HTML preview renderer with guardrails for display modes. It controls when to show rendered HTML versus source text and ensures fallback behavior is predictable.
*/
import { renderCodeViewer } from './code-viewer.js';
import { escapeHtml } from './highlighting.js';
import type { HtmlPreviewMode } from '../types.... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/file-preview/src/components/markdown-renderer.ts | TypeScript | /**
* Markdown rendering pipeline for preview mode. It configures markdown-it and highlighting so markdown content is rendered consistently with code block support.
*/
// markdown-it is intentionally typed locally here to avoid maintaining global ambient module declarations.
// @ts-expect-error markdown-it does not p... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/file-preview/src/components/toolbar.ts | TypeScript | /**
* Toolbar component for preview controls (view mode, metadata, actions). It isolates UI control rendering and event plumbing from core preview orchestration.
*/
import type { HtmlPreviewMode, PreviewStructuredContent } from '../types.js';
import { renderToolHeader } from '../../../shared/tool-header.js';
functio... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/file-preview/src/main.ts | TypeScript | /**
* Browser bootstrap entrypoint for File Preview UI. It starts the app lifecycle and keeps initialization logic separate from runtime feature code.
*/
import { bootstrapApp } from './app.js';
bootstrapApp();
| wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/file-preview/src/types.ts | TypeScript | /**
* Type definitions for File Preview structured content, rendering modes, and host message contracts. These types keep render decisions and RPC payload handling explicit.
*/
import type { PreviewFileType } from '../shared/preview-file-types.js';
export interface PreviewStructuredContent {
fileName: string;
... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/resources.ts | TypeScript | /**
* Server-side UI resource loading helpers for MCP responses. It resolves packaged UI assets, reads files safely, and exposes structured resource payloads to clients.
*/
import fs from 'fs/promises';
import path from 'path';
import { fileURLToPath } from 'url';
import { FILE_PREVIEW_RESOURCE_URI } from './contract... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/shared/escape-html.ts | TypeScript | /**
* Shared HTML escaping helper for UI string interpolation.
*/
export function escapeHtml(value: string): string {
return value
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''');
}
| wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/shared/host-lifecycle.ts | TypeScript | /**
* Cross-tool lifecycle helpers for host readiness, teardown, and event subscriptions. It standardizes app lifecycle behavior across UI surfaces.
*/
import type { RpcClient } from './rpc-client.js';
interface UiHostLifecycleOptions {
appName: string;
appVersion?: string;
getRootElement?: () => Element | nul... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/shared/rpc-client.ts | TypeScript | /**
* Shared RPC client abstraction for window-message communication with the MCP host. It handles request IDs, timeouts, error normalization, and trust checks.
*/
interface RpcErrorShape {
message?: unknown;
}
interface PendingRequest {
resolve: (value: unknown) => void;
reject: (error: Error) => void;
time... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/shared/theme-adaptation.ts | TypeScript | /**
* Theme synchronization utilities that adapt embedded UI styles to host light/dark context. It centralizes theme event handling and class/token updates.
*/
type ThemeMode = 'light' | 'dark';
type JsonObject = Record<string, unknown>;
function isObject(value: unknown): value is JsonObject {
return typeof value... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/shared/tool-header.ts | TypeScript | /**
* Reusable header renderer for MCP tool UIs. It provides a consistent title/description/status pattern so each app presents uniform top-of-page context.
*/
import { escapeHtml } from './escape-html.js';
export interface ToolHeaderConfig {
pillLabel: string;
pillClassName?: string;
title: string;
subtitle... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/shared/tool-shell.ts | TypeScript | /**
* Shared shell behavior for collapsible sections and common UI affordances. It keeps repeated interaction patterns consistent across tool apps.
*/
const EXPAND_ICON = '<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M7 10l5 5 5-5z"></path></svg>';
const COLLAPSE_ICON = '<svg viewBox="0 0 24... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/shared/widget-state.ts | TypeScript | /**
* Widget state persistence for MCP Apps hosts.
*
* ChatGPT has a special extension (window.openai.widgetState) for persisting
* widget state across page refreshes. Other hosts use the standard MCP Apps
* pattern where ui/notifications/tool-result is re-sent when needed.
*
* This module provides a simple ab... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/styles/apps/file-preview.css | CSS | /*
* App-specific styling for File Preview layouts and render containers.
*/
:root {
--code-bg: var(--panel);
--code-text: var(--color-text-primary, var(--text));
--hljs-keyword: var(--color-text-accent, #8b5cf6);
--hljs-string: var(--color-text-success, #059669);
--hljs-comment: var(--color-text-tertiary, ... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/styles/base.css | CSS | /*
* Global UI design tokens and base element styling shared by all MCP tool apps. It establishes color, spacing, typography, and accessibility-friendly defaults.
*/
:root {
color-scheme: light dark;
--bg: transparent;
--panel: var(--color-background-primary, Canvas);
--panel-subtle: var(--color-background-te... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/ui/styles/components/tool-header.css | CSS | /*
* Reusable styles for the shared tool header component. It provides consistent spacing, alignment, and action presentation across apps.
*/
.toolbar {
display: flex;
gap: 10px;
align-items: center;
justify-content: space-between;
padding: 8px 10px;
border: 1px solid var(--border);
border-radius: 12px;... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/ab-test.ts | TypeScript | import { configManager } from '../config-manager.js';
import { featureFlagManager } from './feature-flags.js';
/**
* A/B Test controlled feature flags
*
* Experiments are defined in remote feature flags JSON (v2 format with weights):
* {
* "flags": {
* "experiments": {
* "OnboardingPreTool": {
* ... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/capture.ts | TypeScript | import { platform } from 'os';
import * as https from 'https';
import { configManager } from '../config-manager.js';
import { currentClient } from '../server.js';
let VERSION = 'unknown';
try {
const versionModule = await import('../version.js');
VERSION = versionModule.VERSION;
} catch {
// Continue witho... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/dockerPrompt.ts | TypeScript | import { configManager } from '../config-manager.js';
import { usageTracker } from './usageTracker.js';
/**
* Docker MCP Gateway prompt utilities
* Handles detection and messaging for users using Docker MCP Gateway
*/
/**
* Check if user should be prompted about Docker MCP Gateway
*/
export async function should... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/feature-flags.ts | TypeScript | import fs from 'fs/promises';
import path from 'path';
import { existsSync } from 'fs';
import { CONFIG_FILE } from '../config.js';
import { logger } from './logger.js';
interface FeatureFlags {
version?: string;
flags?: Record<string, any>;
}
class FeatureFlagManager {
private flags: Record<string, any> = {};
... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/files/base.ts | TypeScript | /**
* Base interfaces and types for file handling system
* All file handlers implement the FileHandler interface
*/
// ============================================================================
// Core Interfaces
// ============================================================================
/**
* Base interfac... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/files/binary.ts | TypeScript | /**
* Binary file handler
* Handles binary files that aren't supported by other handlers (Excel, Image)
* Uses isBinaryFile for content-based detection
* Returns instructions to use start_process with appropriate tools
*/
import fs from "fs/promises";
import path from "path";
import { isBinaryFile } from 'isbinar... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/files/excel.ts | TypeScript | /**
* Excel file handler using ExcelJS
* Handles reading, writing, and editing Excel files (.xlsx, .xls, .xlsm)
*/
import ExcelJS from 'exceljs';
import fs from 'fs/promises';
import {
FileHandler,
ReadOptions,
FileResult,
EditResult,
FileInfo,
ExcelSheet
} from './base.js';
// File size li... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/files/factory.ts | TypeScript | /**
* Factory pattern for creating appropriate file handlers
* Routes file operations to the correct handler based on file type
*
* Each handler implements canHandle() which can be sync (extension-based)
* or async (content-based like BinaryFileHandler using isBinaryFile)
*/
import { FileHandler } from './base.j... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/files/image.ts | TypeScript | /**
* Image file handler
* Handles reading image files and converting to base64
*/
import fs from "fs/promises";
import {
FileHandler,
ReadOptions,
FileResult,
FileInfo
} from './base.js';
/**
* Image file handler implementation
* Supports: PNG, JPEG, GIF, WebP, BMP, SVG
*/
export class ImageFil... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/files/index.ts | TypeScript | /**
* File handling system
* Exports all file handlers, interfaces, and utilities
*/
// Base interfaces and types
export * from './base.js';
// Factory function
export { getFileHandler, isExcelFile, isImageFile } from './factory.js';
// File handlers
export { TextFileHandler } from './text.js';
export { ImageFile... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/files/pdf.ts | TypeScript | /**
* PDF File Handler
* Implements FileHandler interface for PDF documents
*/
import fs from 'fs/promises';
import { FileHandler, FileResult, FileInfo, ReadOptions, EditResult } from './base.js';
import { parsePdfToMarkdown, parseMarkdownToPdf, editPdf } from '../../tools/pdf/index.js';
/**
* File handler for PD... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/files/text.ts | TypeScript | /**
* Text file handler
* Handles reading, writing, and editing text files
*
* Binary detection is handled at the factory level (factory.ts) using isBinaryFile.
* This handler only receives files that have been confirmed as text.
*
* TECHNICAL DEBT:
* This handler is missing editRange() - text search/replace lo... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/fuzzySearchLogger.ts | TypeScript | import fs from 'fs/promises';
import path from 'path';
import os from 'os';
export interface FuzzySearchLogEntry {
timestamp: Date;
searchText: string;
foundText: string;
similarity: number;
executionTime: number;
exactMatchCount: number;
expectedReplacements: number;
fuzzyThreshold: nu... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/lineEndingHandler.ts | TypeScript | /**
* Line ending types
*/
export type LineEndingStyle = '\r\n' | '\n' | '\r';
/**
* Detect the line ending style used in a file - Optimized version
* This algorithm uses early termination for maximum performance
*/
export function detectLineEnding(content: string): LineEndingStyle {
for (let i = 0; i < conte... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/logger.ts | TypeScript | /**
* Centralized logging utility for Desktop Commander
* Ensures all logging goes through proper channels based on initialization state
*/
import type { FilteredStdioServerTransport } from '../custom-stdio.js';
// Global reference to the MCP transport (set in index.ts)
declare global {
var mcpTransport: Filtere... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/open-browser.ts | TypeScript | import { execFile, spawn } from 'child_process';
import os from 'os';
import { logToStderr } from './logger.js';
/**
* Open a URL in the default browser (cross-platform)
* Uses execFile/spawn with args array to avoid shell injection
*/
export async function openBrowser(url: string): Promise<void> {
const platform... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/process-detection.ts | TypeScript | /**
* REPL and Process State Detection Utilities
* Detects when processes are waiting for input vs finished vs running
*/
export interface ProcessState {
isWaitingForInput: boolean;
isFinished: boolean;
isRunning: boolean;
detectedPrompt?: string;
lastOutput: string;
}
// Common REPL prompt patterns
cons... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/ripgrep-resolver.ts | TypeScript | import { execSync } from 'child_process';
import { existsSync, chmodSync } from 'fs';
import path from 'path';
import os from 'os';
let cachedRgPath: string | null = null;
/**
* Resolve ripgrep binary path with multiple fallback strategies
* This handles cases where @vscode/ripgrep postinstall fails in npx environm... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/system-info.ts | TypeScript | import os from 'os';
import fs from 'fs';
import path from 'path';
import { execSync } from 'child_process';
export interface DockerMount {
hostPath: string;
containerPath: string;
type: 'bind' | 'volume';
readOnly: boolean;
description: string;
}
export interface ContainerInfo {
// New enhanc... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/toolHistory.ts | TypeScript | import { ServerResult } from '../types.js';
import * as fs from 'fs';
import * as path from 'path';
import * as os from 'os';
export interface ToolCallRecord {
timestamp: string;
toolName: string;
arguments: any;
output: ServerResult;
duration?: number;
}
interface FormattedToolCallRecord extends Omit<ToolC... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/trackTools.ts | TypeScript | import * as fs from 'fs';
import * as path from 'path';
import { TOOL_CALL_FILE, TOOL_CALL_FILE_MAX_SIZE } from '../config.js';
// Ensure the directory for the log file exists
const logDir = path.dirname(TOOL_CALL_FILE);
await fs.promises.mkdir(logDir, { recursive: true });
/**
* Track tool calls and save them to a ... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/usageTracker.ts | TypeScript | import { configManager } from '../config-manager.js';
import { capture } from './capture.js';
export interface ToolUsageStats {
// Tool category counters
filesystemOperations: number;
terminalOperations: number;
editOperations: number;
searchOperations: number;
configOperations: number;
processOperations... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/welcome-onboarding.ts | TypeScript | import { configManager } from '../config-manager.js';
import { hasFeature } from './ab-test.js';
import { featureFlagManager } from './feature-flags.js';
import { openWelcomePage } from './open-browser.js';
import { logToStderr } from './logger.js';
import { capture } from './capture.js';
/**
* Handle welcome page di... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/utils/withTimeout.ts | TypeScript |
/**
* Executes a promise with a timeout. If the promise doesn't resolve or reject within
* the specified timeout, returns the provided default value.
*
* @param operation The promise to execute
* @param timeoutMs Timeout in milliseconds
* @param operationName Name of the operation (for logs)
* @param defaultVal... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
src/version.ts | TypeScript | export const VERSION = '0.2.35';
| wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
test-listener-bug.js | JavaScript | #!/usr/bin/env node
/**
* Test to verify that read_process_output doesn't break future calls
* by removing TerminalManager's listeners with removeAllListeners
*
* Expected behavior:
* 1. Start Node.js REPL
* 2. Send command with interact_with_process
* 3. Call read_process_output - should work
* 4. Send anothe... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
test/ab-test.test.js | JavaScript | /**
* Unit tests for A/B test feature flag system
* Tests that missing/empty experiments config doesn't break anything
*/
import assert from 'assert';
// Mock the dependencies before importing ab-test
let mockExperiments = {};
let mockConfigValues = {};
// Mock featureFlagManager
const mockFeatureFlagManager = {
... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
test/enhanced-repl-example.js | JavaScript | /**
* This example demonstrates how to use the enhanced terminal commands
* for REPL (Read-Eval-Print Loop) environments.
*/
import {
executeCommand,
readOutput,
forceTerminate
} from '../dist/tools/execute.js';
import { sendInput } from '../dist/tools/enhanced-send-input.js';
// Example of starting and inte... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
test/modified-test.js | JavaScript | /**
* Test performance with large files of different line ending types
* This is a modified version to work with the 100-line limit
*/
async function testLargeFilePerformance() {
console.log('\nTest 6: Performance with large files');
const LARGE_FILE_LF = path.join(TEST_DIR, 'large_lf.txt');
const LARGE_FIL... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
test/repl-via-terminal-example.js | JavaScript | /**
* This example demonstrates how to use terminal commands to interact with a REPL environment
* without needing specialized REPL tools.
*/
import {
executeCommand,
readOutput,
forceTerminate
} from '../dist/tools/execute.js';
import { sendInput } from '../dist/tools/send-input.js';
// Example of starting ... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga | |
test/run-all-tests.js | JavaScript | /**
* Main test runner script
* Runs all test modules and provides comprehensive summary
*/
import { spawn } from 'child_process';
import path from 'path';
import fs from 'fs/promises';
import { fileURLToPath } from 'url';
// Get directory name
const __filename = fileURLToPath(import.meta.url);
const __dirname = p... | wonderwhy-er/DesktopCommanderMCP | 5,467 | This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities | TypeScript | wonderwhy-er | Eduard Ruzga |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.