Persistent shell execution MCP server

Persistent shell execution MCP server

mcp-server-shell-exec•bysamihalawa

An MCP server that runs shell commands in a stateful session, supporting background execution and configurable timeouts.

License: Not specified•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Maintains a persistent shell session so environment variables and working directory carry over between commands.
  • •Runs commands in the background with process management.
  • •Allows configurable timeouts so commands do not hang indefinitely.
  • •Provides a reset-shell tool that kills the current session and starts a new one.

BEST FOR

  • •Executing and inspecting filesystem commands like listing directory contents.
  • •Starting long-running processes in the background.
  • •Running commands that need a custom timeout window.

ABOUT MCP-SERVER-SHELL-EXEC

Persistent shell execution MCP server is cataloged as an MCP server attributed to samihalawa. An MCP server that runs shell commands in a stateful session, supporting background execution and configurable timeouts. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Persistent shell execution MCP server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Does the server keep shell state between commands?

Yes, the server maintains a persistent shell session so environment variables and working directory persist between commands.

Can commands be run in the background or with a timeout?

Yes, the execute-command tool accepts a runInBackground option and a timeoutMs value, with a default timeout of 30000 milliseconds.

Upstream README

View this exact version on GitHub

README.md · d43318f9fc29 · Fetched 2026-11-13 11:00:54 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

Shell Execution MCP Server

A Model Context Protocol (MCP) server that provides persistent shell command execution capabilities for Claude and other MCP-compatible AI assistants.

Features

  • Persistent Shell Session: Maintains state between commands in the same session
  • Background Execution: Run commands in the background with proper process management
  • Cross-Platform: Works on macOS, Linux, and Windows with the appropriate shell
  • Timeout Control: Configure command execution timeouts to prevent hanging
  • Session Reset: Ability to reset the shell session if needed

Installation

# Clone the repository
git clone https://github.com/samihalawa/mcp-server-shell-exec.git
cd mcp-server-shell-exec

# Install dependencies
npm install

# Make the server executable
chmod +x server.js

Usage

Starting the Server

npm start

Configuration

Add the server to your MCP configuration:

macOS/Linux

{
  "mcpServers": {
    "shell-exec-server": {
      "command": "/path/to/node",
      "args": [
        "/absolute/path/to/mcp-server-shell-exec/server.js"
      ]
    }
  }
}

Windows

{
  "mcpServers": {
    "shell-exec-server": {
      "command": "node",
      "args": [
        "C:\\path\\to\\mcp-server-shell-exec\\server.js"
      ]
    }
  }
}

Available Tools

execute-command

Execute a shell command in the persistent shell session.

Parameters:

  • command (string, required): The shell command to execute
  • runInBackground (boolean, optional): Whether to run the command in the background. Default: false
  • timeoutMs (number, optional): Timeout in milliseconds for the command. Default: 30000

Returns:

  • success (boolean): Whether the command executed successfully
  • output (string): Output from the command execution

reset-shell

Reset the shell session. This will kill the current session and start a new one.

Parameters: None

Returns:

  • success (boolean): Whether the shell was reset successfully
  • message (string): Status message

Example Usage

  1. Execute a simple command:

    execute-command(command: "ls -la")
    
  2. Run a long-running command in the background:

    execute-command(command: "sleep 60 && echo 'Done'", runInBackground: true)
    
  3. Execute a command with a custom timeout:

    execute-command(command: "find / -name '*.js'", timeoutMs: 60000)
    
  4. Reset the shell session:

    reset-shell()
    

How It Works

The server uses Node.js to create a shell process that maintains state between commands. This allows for:

  • Environment variables to persist between commands
  • Working directory to remain consistent
  • Background processes to continue running
  • Interactive commands that require stdin/stdout

Requirements

  • Node.js 14+
  • Compatible with Claude Desktop, Cursor, and other MCP-compatible applications

Troubleshooting

If you encounter issues with the MCP server, check the following:

Common Error: Tool Execution Failed

If you see "Tool execution failed" errors, check:

  1. That the server is running correctly
  2. That your configuration file uses absolute paths
  3. That you have restarted your client application after changing the configuration

Testing the Server

You can test the server directly by sending a command:

echo '{"id":"test1","jsonrpc":"2.0","method":"execute-command","params":{"command":"echo \"Hello World\""}}' | node server.js

This should return a properly formatted JSON response with the output.

Configuration Path Issues

Double-check the paths in your configuration:

  • Use absolute paths instead of relative paths
  • For Windows users, use forward slashes (/) or escaped backslashes (\) in the path
  • Verify the server file path is correct

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Persistent shell execution MCP server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-server-shell-exec)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools