Track MCP LogoTrack MCP
Track MCP LogoTrack MCP

The world's largest repository of Model Context Protocol servers. Discover, explore, and submit MCP tools.

Product

  • Categories
  • Top MCP
  • New & Updated
  • Submit MCP

Company

  • About

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2026 TrackMCP. All rights reserved.

Built with ❤️ by Krishna Goyal

    Terminal Mcp Server

    Make LLM can control your PC or Server with ssh or terminal.

    24 stars
    TypeScript
    Updated Sep 17, 2025

    Table of Contents

    • Notice 注意事项
    • Features
    • Installation
    • Installing via Smithery
    • Manual Installation
    • Usage
    • Starting the Server
    • Starting the Server in SSE Mode
    • Testing with MCP Inspector
    • The execute_command Tool
    • Parameters
    • Examples
    • Executing a Command Locally
    • Executing a Command on a Remote Host
    • Configuring with AI Assistants
    • Configuring with Roo Code
    • For stdio mode (local connection)
    • For SSE mode (remote connection)
    • Configuring with Cline
    • For stdio mode (local connection)
    • For SSE mode (remote connection)
    • Configuring with Claude Desktop
    • For stdio mode (local connection)
    • For SSE mode (remote connection)
    • Best Practices
    • Command Execution
    • SSH Connection
    • Session Management
    • Error Handling
    • Important Notes

    Table of Contents

    • Notice 注意事项
    • Features
    • Installation
    • Installing via Smithery
    • Manual Installation
    • Usage
    • Starting the Server
    • Starting the Server in SSE Mode
    • Testing with MCP Inspector
    • The execute_command Tool
    • Parameters
    • Examples
    • Executing a Command Locally
    • Executing a Command on a Remote Host
    • Configuring with AI Assistants
    • Configuring with Roo Code
    • For stdio mode (local connection)
    • For SSE mode (remote connection)
    • Configuring with Cline
    • For stdio mode (local connection)
    • For SSE mode (remote connection)
    • Configuring with Claude Desktop
    • For stdio mode (local connection)
    • For SSE mode (remote connection)
    • Best Practices
    • Command Execution
    • SSH Connection
    • Session Management
    • Error Handling
    • Important Notes

    Documentation

    Terminal MCP Server

    smithery badge

    Notice 注意事项

    Current Project not in maintance anymore. I recommend you guys to use more advanced command tool —— Desktop Commander

    当前项目已经不在维护。我建议大家用更先进的终端MCP工具 Desktop Commander

    *中文文档*

    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, either on the local machine or on remote hosts via SSH.

    Features

    • Local Command Execution: Execute commands directly on the local machine
    • Remote Command Execution: Execute commands on remote hosts via SSH
    • Session Persistence: Support for persistent sessions that reuse the same terminal environment for a specified time (default 20 minutes)
    • Environment Variables: Set custom environment variables for commands
    • Multiple Connection Methods: Connect via stdio or SSE (Server-Sent Events)

    Installation

    Installing via Smithery

    To install terminal-mcp-server for Claude Desktop automatically via Smithery:

    bash
    npx -y @smithery/cli install @weidwonder/terminal-mcp-server --client claude

    Manual Installation

    bash
    # Clone the repository
    git clone https://github.com/weidwonder/terminal-mcp-server.git
    cd terminal-mcp-server
    
    # Install dependencies
    npm install
    
    # Build the project
    npm run build

    Usage

    Starting the Server

    bash
    # Start the server using stdio (default mode)
    npm start
    
    # Or run the built file directly
    node build/index.js

    Starting the Server in SSE Mode

    The SSE (Server-Sent Events) mode allows you to connect to the server remotely via HTTP.

    bash
    # Start the server in SSE mode
    npm run start:sse
    
    # Or run the built file directly with SSE flag
    node build/index.js --sse

    You can customize the SSE server with the following command-line options:

    OptionDescriptionDefault
    --port or -pThe port to listen on8080
    --endpoint or -eThe endpoint path/sse
    --host or -hThe host to bind tolocalhost

    Example with custom options:

    bash
    # Start SSE server on port 3000, endpoint /mcp, and bind to all interfaces
    node build/index.js --sse --port 3000 --endpoint /mcp --host 0.0.0.0

    This will start the server and listen for SSE connections at http://0.0.0.0:3000/mcp.

    Testing with MCP Inspector

    bash
    # Start the MCP Inspector tool
    npm run inspector

    The execute_command Tool

    The execute_command tool is the core functionality provided by Terminal MCP Server, used to execute commands on local or remote hosts.

    Parameters

    ParameterTypeRequiredDescription
    commandstringYesThe command to execute
    hoststringNoThe remote host to connect to. If not provided, the command will be executed locally
    usernamestringRequired when host is specifiedThe username for SSH connection
    sessionstringNoSession name, defaults to "default". The same session name will reuse the same terminal environment for 20 minutes
    envobjectNoEnvironment variables, defaults to an empty object

    Examples

    Executing a Command Locally

    json
    {
      "command": "ls -la",
      "session": "my-local-session",
      "env": {
        "NODE_ENV": "development"
      }
    }

    Executing a Command on a Remote Host

    json
    {
      "host": "example.com",
      "username": "user",
      "command": "ls -la",
      "session": "my-remote-session",
      "env": {
        "NODE_ENV": "production"
      }
    }

    Configuring with AI Assistants

    Configuring with Roo Code

    1. Open VSCode and install the Roo Code extension

    2. Open the Roo Code settings file: ~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json

    3. Add the following configuration:

    For stdio mode (local connection)

    json
    {
      "mcpServers": {
        "terminal-mcp": {
          "command": "node",
          "args": ["/path/to/terminal-mcp-server/build/index.js"],
          "env": {}
        }
      }
    }

    For SSE mode (remote connection)

    json
    {
      "mcpServers": {
        "terminal-mcp-sse": {
          "url": "http://localhost:8080/sse",
          "headers": {}
        }
      }
    }

    Replace localhost:8080/sse with your actual server address, port, and endpoint if you've customized them.

    Configuring with Cline

    1. Open the Cline settings file: ~/.cline/config.json

    2. Add the following configuration:

    For stdio mode (local connection)

    json
    {
      "mcpServers": {
        "terminal-mcp": {
          "command": "node",
          "args": ["/path/to/terminal-mcp-server/build/index.js"],
          "env": {}
        }
      }
    }

    For SSE mode (remote connection)

    json
    {
      "mcpServers": {
        "terminal-mcp-sse": {
          "url": "http://localhost:8080/sse",
          "headers": {}
        }
      }
    }

    Configuring with Claude Desktop

    1. Open the Claude Desktop settings file: ~/Library/Application Support/Claude/claude_desktop_config.json

    2. Add the following configuration:

    For stdio mode (local connection)

    json
    {
      "mcpServers": {
        "terminal-mcp": {
          "command": "node",
          "args": ["/path/to/terminal-mcp-server/build/index.js"],
          "env": {}
        }
      }
    }

    For SSE mode (remote connection)

    json
    {
      "mcpServers": {
        "terminal-mcp-sse": {
          "url": "http://localhost:8080/sse",
          "headers": {}
        }
      }
    }

    Best Practices

    Command Execution

    • Before running commands, it's best to determine the system type (Mac, Linux, etc.)
    • Use full paths to avoid path-related issues
    • For command sequences that need to maintain environment, use && to connect multiple commands
    • For long-running commands, consider using nohup or screen/tmux

    SSH Connection

    • Ensure SSH key-based authentication is set up
    • If connection fails, check if the key file exists (default path: ~/.ssh/id_rsa)
    • Make sure the SSH service is running on the remote host

    Session Management

    • Use the session parameter to maintain environment between related commands
    • For operations requiring specific environments, use the same session name
    • Note that sessions will automatically close after 20 minutes of inactivity

    Error Handling

    • Command execution results include both stdout and stderr
    • Check stderr to determine if the command executed successfully
    • For complex operations, add verification steps to ensure success

    Important Notes

    • For remote command execution, SSH key-based authentication must be set up in advance
    • For local command execution, commands will run in the context of the user who started the server
    • Session timeout is 20 minutes, after which the connection will be automatically closed

    Similar MCP

    Based on tags & features

    • MC

      Mcp Open Library

      TypeScript·
      42
    • ME

      Metmuseum Mcp

      TypeScript·
      14
    • AS

      Ashra Mcp

      TypeScript·
      42
    • MC

      Mcp Browser Kit

      TypeScript·
      36

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k
    View All MCP Servers

    Similar MCP

    Based on tags & features

    • MC

      Mcp Open Library

      TypeScript·
      42
    • ME

      Metmuseum Mcp

      TypeScript·
      14
    • AS

      Ashra Mcp

      TypeScript·
      42
    • MC

      Mcp Browser Kit

      TypeScript·
      36

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k