ProcExecMCP

ProcExecMCP

Stateless command execution and process management MCP server for Claude. Enables searching file contents, executing commands with safety limits, listing processes, and terminating processes.

Category
Visit Server

README

ProcExecMCP

Stateless command execution and process management MCP server for Claude

ProcExecMCP enables Claude (acting in an architectural role) to search code content, execute commands, monitor processes, and terminate processes. The server exposes 4 MCP tools using FastMCP with Python 3.11+, psutil for cross-platform process management, and system ripgrep for file content search.

Features

  • 🔍 search_file_contents: Search for patterns in file contents using ripgrep
  • execute_command: Execute commands safely with timeout and output limits
  • 📊 list_processes: List running processes with filtering and sorting
  • 🛑 kill_process: Terminate processes by PID

Security

  • ✅ No shell injection (no shell=True)
  • ✅ Mandatory timeouts on all operations
  • ✅ Resource limits prevent memory exhaustion
  • ✅ Path validation prevents traversal attacks
  • ✅ Sanitized error messages

For comprehensive security documentation, see SECURITY_ARCHITECTURE.md.

Prerequisites

Quick Start

1. Install Dependencies

# Clone repository
git clone https://github.com/Positronikal/ProcExecMCP.git ProcExecMCP
cd ProcExecMCP

# Install with uv
uv sync

2. Verify ripgrep

# Check if ripgrep is installed
rg --version

If not installed:

  • Windows: winget install BurntSushi.ripgrep.MSVC
  • macOS: brew install ripgrep
  • Linux: sudo apt install ripgrep

3. Configure Claude Desktop

Edit your Claude Desktop configuration file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Add ProcExecMCP to mcpServers:

{
  "mcpServers": {
    "procexec": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/ProcExecMCP",
        "run",
        "procexec"
      ],
      "env": {
        "PROCEXEC_TIMEOUT": "30000",
        "PROCEXEC_MAX_OUTPUT": "10485760",
        "PROCEXEC_ENABLE_KILL": "true",
        "PROCEXEC_RIPGREP_PATH": "/path/to/rg"
      }
    }
  }
}

Windows Example:

{
  "mcpServers": {
    "procexec": {
      "command": "C:\\Users\\YourName\\.local\\bin\\uv.exe",
      "args": [
        "--directory",
        "D:\\dev\\ProcExecMCP",
        "run",
        "procexec"
      ],
      "env": {
        "PROCEXEC_RIPGREP_PATH": "C:\\Program Files\\ripgrep\\rg.exe"
      }
    }
  }
}

4. Restart Claude Desktop

Close and reopen Claude Desktop to load the new MCP server.

5. Verify Installation

In Claude, try:

What MCP tools do you have available?

You should see all 4 ProcExecMCP tools listed.

Configuration

Environment Variables

  • PROCEXEC_TIMEOUT: Command timeout in milliseconds (default: 30000, range: 1000-300000)
  • PROCEXEC_MAX_OUTPUT: Maximum output size in bytes (default: 10485760 = 10MB)
  • PROCEXEC_BLOCKED_PATHS: Comma-separated list of paths to block access
  • PROCEXEC_ENABLE_KILL: Enable process termination tool (default: "true")
  • PROCEXEC_RIPGREP_PATH: Full path to ripgrep binary (use if not in PATH)

Security Considerations

  1. Blocked Paths: Configure PROCEXEC_BLOCKED_PATHS to protect sensitive directories
  2. Process Termination: Disable with PROCEXEC_ENABLE_KILL="false" if not needed
  3. Timeouts: Set appropriate limits to prevent runaway commands
  4. Privileges: Avoid running Claude Desktop with elevated privileges unless necessary

Usage Examples

Search for Code Patterns

Search for all TODO comments in my Python project at /path/to/project

Execute Analysis Tools

Run 'pylint src/' in my project directory and show the results

Monitor Processes

List all Python processes sorted by memory usage

Terminate Stuck Processes

Terminate process 1234 gracefully

Development

For development setup, running tests, modifying the server, and building documentation, see USING.md.

Documentation

Troubleshooting

ripgrep not found

Ensure ripgrep is installed and in PATH, or set PROCEXEC_RIPGREP_PATH environment variable.

Timeout errors

Increase timeout via PROCEXEC_TIMEOUT environment variable (milliseconds).

Permission denied

Check file/directory permissions or configure PROCEXEC_BLOCKED_PATHS.

For more troubleshooting guidance, see BUGS.md.

License

This project is licensed under the GNU General Public License version 3 or any later version (GPLv3+). See COPYING.md for the full license text.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

Support

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured