Terminal MCP Server logo

Terminal MCP Server

by weidwonder

Terminal MCP Server is a Model Context Protocol (MCP) server that allows executing commands on local or remote hosts. It provides a simple yet powerful interface for AI models and other applications to execute system commands.

View on GitHub

Last updated: N/A

What is Terminal MCP Server?

Terminal MCP Server is a Model Context Protocol (MCP) server designed to execute commands on local or remote machines. It offers a way for AI models and other applications to interact with the operating system through a command-line interface, supporting both local and remote execution via SSH.

How to use Terminal MCP Server?

To use the server, you can install it manually or via Smithery. Once installed, start the server in either stdio or SSE mode. Configure your AI assistant (Roo Code, Cline, Claude Desktop) to connect to the server using the provided configuration examples. Then, use the execute_command tool with the appropriate parameters to run commands locally or remotely.

Key features of Terminal MCP Server

  • Local Command Execution

  • Remote Command Execution via SSH

  • Session Persistence (20 minutes default)

  • Environment Variable Support

  • Multiple Connection Methods (stdio, SSE)

Use cases of Terminal MCP Server

  • Executing system commands from AI models

  • Automating tasks on remote servers

  • Maintaining a consistent environment for command sequences

  • Integrating command-line tools with AI assistants

FAQ from Terminal MCP Server

How do I execute a command on a remote host?

Provide the host, username, and command parameters to the execute_command tool. Ensure SSH key-based authentication is set up beforehand.

How do I maintain the environment between commands?

Use the session parameter. Commands with the same session name will share the same terminal environment for 20 minutes.

What happens if the SSH connection fails?

Check if SSH key-based authentication is properly configured, and verify that the SSH service is running on the remote host. Also, ensure the key file exists (default path: ~/.ssh/id_rsa).

How do I configure the server for SSE mode?

Start the server with the --sse flag and optionally customize the port, endpoint, and host using command-line options like --port, --endpoint, and --host.

What is the session timeout?

The session timeout is 20 minutes. After 20 minutes of inactivity, the session will be automatically closed.