MCP Terminal Server logo

MCP Terminal Server

by RichardTheuws

Terminal server implementation for Model Context Protocol (MCP). It provides secure and controlled access to terminal commands and npm operations.

View on GitHub

Last updated: N/A

What is MCP Terminal Server?

This is a terminal server designed for use with the Model Context Protocol (MCP). It allows for the execution of shell commands and npm operations in a controlled and secure environment.

How to use MCP Terminal Server?

Install the package using npm install @modelcontextprotocol/server-terminal. Then, configure it within your MCP configuration file, specifying allowed commands, timeouts, working directories, and environment variables. You can then use the provided API to execute commands, install npm packages, and run npm scripts.

Key features of MCP Terminal Server

  • Execute shell commands with full control

  • Built-in npm operations (install, run scripts)

  • Timeout handling

  • Security through allowed commands list

  • Environment variables management

  • Working directory control

  • Typescript support

Use cases of MCP Terminal Server

  • Automated build processes

  • Remote server management

  • Secure command execution within a controlled environment

  • Running npm scripts remotely

FAQ from MCP Terminal Server

How do I install the server?

Use the command npm install @modelcontextprotocol/server-terminal.

How do I configure the allowed commands?

Specify the allowedCommands array in the config section of your MCP configuration.

What is the purpose of the defaultTimeout?

It sets the maximum execution time for commands, preventing them from running indefinitely.

Can I set environment variables for the commands?

Yes, you can configure environment variables in the environmentVariables section of the MCP configuration.

How do I execute a command?

Use the terminal.executeCommand method, providing the command and arguments.