Skip to main content
Glama
MCP PC Control Server

MCP PC Control Server

MCP PC Control Server

A powerful Model Context Protocol (MCP) server that provides comprehensive PC control capabilities including file operations, directory management, command execution, system inspection, and process management. Designed to give AI assistants (Claude, GPT, Gemini, etc.) full, efficient control over the host machine.

Features

File Operations

  • read_file - Read complete file contents with proper encoding

  • read_file_lines - Read a specific range of lines from a file (efficient for large files)

  • write_file - Create new files or overwrite existing ones

  • append_to_file - Append content to a file without overwriting it

  • edit_file - Make precise text-based edits with diff output

  • copy_file - Copy a file to a new location (source preserved)

  • delete_file - Remove files from the filesystem

  • move_file - Move or rename files and directories

  • get_file_info - Get detailed file metadata (size, timestamps, permissions, readability)

Directory Operations

  • create_directory - Create directories (supports nested creation)

  • list_directory - List directory contents with detailed information

  • delete_directory - Recursively delete directories and their contents

  • search_files - Recursively search for files matching name patterns

  • search_in_files - Grep-like search for text content within files, with optional file-pattern filtering and case-insensitive mode

System Operations

  • execute_command - Execute shell commands with optional working directory and configurable timeout

  • get_system_info - Get OS, CPU, memory, uptime, hostname, and network interface details

  • list_processes - List running processes with optional name filter

  • get_environment - Read environment variables (one or all)

Related MCP server: Enhanced File Operations MCP Server

Installation

  1. Clone or download this repository

  2. Install dependencies:

npm install
  1. Build the project:

npm run build

Usage

Running the Server

The server communicates via stdio and is designed to be used with MCP clients:

npm start

Configuration with Claude Desktop

Add this server to your Claude Desktop configuration file:

On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "pc-control": {
      "command": "node",
      "args": ["/absolute/path/to/first_mcp/build/index.js"]
    }
  }
}

Replace /absolute/path/to/first_mcp with the actual absolute path to this project directory.

Configuration with Other AI Clients

Any MCP-compatible client (Claude, Cursor, Windsurf, Continue, etc.) can connect to this server using the same stdio transport approach. Point the client at the built build/index.js with node.

Example with npx (Alternative)

{
  "mcpServers": {
    "pc-control": {
      "command": "npx",
      "args": ["-y", "mcp-pc-control-server"]
    }
  }
}

Available Tools

read_file

{ path: string }

read_file_lines

{
  path: string,
  start: number,  // 1-based, inclusive
  end?: number    // 1-based, inclusive (omit to read to end)
}

write_file

{ path: string, content: string }

append_to_file

{ path: string, content: string }

edit_file

{
  path: string,
  edits: [{ oldText: string, newText: string }]
}

copy_file

{ source: string, destination: string }

create_directory

{ path: string }

list_directory

{ path: string }

delete_file

{ path: string }

delete_directory

{ path: string }

move_file

{ source: string, destination: string }

get_file_info

{ path: string }

execute_command

{
  command: string,
  workingDirectory?: string,
  timeout?: number  // ms, default 30000
}

search_files

{ path: string, pattern: string }  // pattern supports * and **

search_in_files

{
  path: string,
  query: string,
  filePattern?: string,     // e.g. "*.ts"
  caseSensitive?: boolean   // default false
}

get_system_info

{}  // no arguments required

list_processes

{ filter?: string }  // optional substring filter on process name

get_environment

{ variable?: string }  // omit to get all env vars

Security Considerations

WARNING: This server provides powerful filesystem and command execution capabilities.

  • File Access: Can read, write, and delete any files the process has permissions for

  • Command Execution: Can execute arbitrary shell commands

  • No Sandboxing: Operations are not sandboxed or restricted

Recommendations:

  • Only use with trusted MCP clients

  • Run with minimal necessary permissions

  • Be cautious with the execute_command and delete_directory tools

  • Consider implementing additional access controls for production use

  • Review all operations in sensitive environments

Development

Build

npm run build

Watch Mode

npm run watch

Project Structure

.
├── src/
│   └── index.ts          # Main server implementation
├── build/                # Compiled JavaScript (generated)
├── package.json
├── tsconfig.json
└── README.md

License

MIT

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

Troubleshooting

Server not appearing in Claude Desktop

  1. Check that the path in claude_desktop_config.json is absolute and correct

  2. Verify the build directory exists and contains index.js

  3. Restart Claude Desktop after configuration changes

  4. Check Claude Desktop logs for errors

Permission Errors

  • Ensure the server process has necessary file system permissions

  • On Unix systems, check file/directory permissions with ls -la

  • Run with appropriate user privileges for the operations you need

Command Execution Issues

  • Verify the working directory exists and is accessible

  • Check that shell commands are appropriate for your operating system

  • Increase the timeout parameter for long-running commands

  • Some commands may require specific environment variables

Available Tools

11 tools
create_directoryA

Create a new directory or ensure a directory exists. Can create multiple nested directories in one operation. If the directory already exists, this operation will succeed silently.

Inputs: path (required).

delete_directoryA

Permanently delete a directory and all of its contents, including all files and subdirectories. This is a recursive operation that cannot be undone. Use with extreme caution.

Inputs: path (required).

delete_fileA

Permanently delete a file from the file system. This operation cannot be undone. The file is immediately removed from the storage device.

Inputs: path (required).

edit_fileA

Make line-based edits to a text file. Provide original lines and their replacements. Returns a git-style diff showing the changes made. Each edit replaces exact line sequences with new content.

Inputs: path (required), edits (required).

execute_commandA

Execute shell commands on the system. SECURITY WARNING: This tool provides direct system access. Only use with trusted commands. Commands run with the same permissions as the MCP server process.

Inputs: command (required), workingDirectory.

get_file_infoA

Retrieve detailed metadata about a file or directory, including size, creation time, modification time, access time, type, and permissions. This does not read file contents.

Inputs: path (required).

list_directoryA

Get a detailed listing of all files and directories in a specified path. Results include names, types (file/directory), sizes, and modification times. Useful for understanding directory structure and finding files.

Inputs: path (required).

move_fileA

Move or rename files and directories. Can move files between directories and rename them in a single operation. If the destination exists, the operation will fail.

Inputs: source (required), destination (required).

read_fileA

Read the complete contents of a file from the file system. Handles various text encodings and returns the full file content. Use this to examine file contents before editing.

Inputs: path (required).

search_filesA

Recursively search for files matching a pattern in a directory. Supports wildcards (* and **) and returns matching file paths. Useful for finding files by name or extension.

Inputs: path (required), pattern (required).

write_fileA

Create a new file or completely overwrite an existing file with new content. Use with caution as it will overwrite existing files without warning. Handles text content with proper encoding.

Inputs: path (required), content (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no ambiguity: create_directory vs. delete_directory, read_file vs. edit_file vs. write_file, list_directory vs. search_files, etc. The descriptions reinforce unique roles, such as get_file_info for metadata only and execute_command for shell operations, preventing misselection.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, such as create_directory, delete_file, and execute_command. This predictable naming scheme makes it easy for agents to understand and use the tools without confusion from mixed conventions.

    Tool Count5/5

    With 11 tools, the server is well-scoped for PC control, covering essential file system operations (CRUD for files/directories), metadata retrieval, searching, and command execution. Each tool earns its place without being overwhelming or insufficient for the domain.

    Completeness5/5

    The tool set provides complete coverage for file system management: create, read, edit, write, delete, move, list, search, and get info for files and directories, plus execute_command for broader system control. There are no obvious gaps, enabling agents to handle full workflows without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      D
      quality
      D
      maintenance
      Enables AI models to perform file system operations (reading, creating, and listing files) on a local file system through a standardized Model Context Protocol interface.
      3
      ISC
    • F
      license
      Not graded
      quality
      C
      maintenance
      A comprehensive Model Context Protocol server that provides over 50 file and system management tools for AI models, including navigation, file operations, search, compression, and system information capabilities.
      -
    • A
      license
      A
      quality
      D
      maintenance
      A comprehensive Model Context Protocol server that enables AI assistants to interact with and manage Windows systems, providing capabilities for file system operations, process management, system information retrieval, registry operations, service management, network diagnostics, and performance monitoring.
      7
      16 npm
      6
      Apache 2.0