Shell Execution MCP Server logo

Shell Execution MCP Server

by samihalawa

This is a Model Context Protocol (MCP) server that provides persistent shell command execution capabilities for Claude and other MCP-compatible AI assistants. It allows AI assistants to execute shell commands and maintain state between commands in the same session.

View on GitHub

Last updated: N/A

What is Shell Execution MCP Server?

The Shell Execution MCP Server is a Node.js application that enables AI assistants like Claude to execute shell commands persistently. It uses the Model Context Protocol (MCP) to communicate and node-pty to create a pseudo-terminal for maintaining session state.

How to use Shell Execution MCP Server?

First, clone the repository, install dependencies using npm install, and build the server using npm run build. Then, start the server with npm start. Finally, configure your MCP setup to include the server, providing the path to the Node.js executable and the server's entry point.

Key features of Shell Execution MCP Server

  • Persistent Shell Session

  • Background Execution

  • Cross-Platform Compatibility

  • Timeout Control

  • Session Reset

Use cases of Shell Execution MCP Server

  • Executing system commands from an AI assistant

  • Running background processes controlled by an AI

  • Automating tasks that require shell access

  • Integrating AI assistants with system administration tools

FAQ from Shell Execution MCP Server

What is MCP?

Model Context Protocol (MCP) is a communication protocol that allows AI assistants to interact with external tools and services.

What is node-pty?

node-pty is a Node.js package that provides pseudo-terminal interfaces, allowing the server to maintain state between shell commands.

How do I configure the server?

You need to add the server configuration to your MCP configuration file, specifying the command to execute (Node.js), arguments (path to the server's index.js), and other settings like port and environment variables.

What commands are available?

The server provides two main commands: execute-command to execute shell commands and reset-shell to reset the shell session.

What are the requirements for running the server?

You need Node.js 14+, the node-pty package, and an MCP-compatible application like Claude Desktop or Cursor.