Terminal MCP Server

by weidwonder

Not rated
GitHub

About

Execute commands on local or remote hosts via SSH. Supports session persistence and environment variables.

Details

Author
weidwonder
Categories
Developer Tools, Infrastructure, Other

Setup

Install Terminal MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/weidwonder/terminal-mcp-server

Follow the installation instructions in the repository README, then restart your MCP client.

Execute commands on local or remote hosts via SSH. Supports session persistence and environment variables.

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.

- 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)

To install terminal-mcp-server for Claude Desktop automatically viaSmithery:

npx -y @smithery/cli install @weidwonder/terminal-mcp-server --client claude
# 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
# Start the server using stdio (default mode) npm start # Or run the built file directly node build/index.js

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

# 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:

# 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 athttp://0.0.0.0:3000/mcp.

# Start the MCP Inspector tool npm run inspector

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

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

- Open VSCode and install the Roo Code extension
- Open the Roo Code settings file:~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
- Add the following configuration:

{ "mcpServers": { "terminal-mcp": { "command": "node", "args": ["/path/to/terminal-mcp-server/build/index.js"], "env": {} } } }
{ "mcpServers": { "terminal-mcp-sse": { "url": "http://localhost:8080/sse", "headers": {} } } }

Replacelocalhost:8080/ssewith your actual server address, port, and endpoint if you've customized them.
- Open the Cline settings file:~/.cline/config.json
- Add the following configuration:

{ "mcpServers": { "terminal-mcp": { "command": "node", "args": ["/path/to/terminal-mcp-server/build/index.js"], "env": {} } } }
{ "mcpServers": { "terminal-mcp-sse": { "url": "http://localhost:8080/sse", "headers": {} } } }

- Open the Claude Desktop settings file:~/Library/Application Support/Claude/claude_desktop_config.json
- Add the following configuration:

{ "mcpServers": { "terminal-mcp": { "command": "node", "args": ["/path/to/terminal-mcp-server/build/index.js"], "env": {} } } }
{ "mcpServers": { "terminal-mcp-sse": { "url": "http://localhost:8080/sse", "headers": {} } } }

- 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 usingnohuporscreen/tmux

- 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

- 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

- 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

- 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

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Production-ready MCP server for AI-driven console automation and monitoring. 40+ tools for session management, SSH, testing, and background jobs.

Hetzner Cloud MCP Server — (Cloud API + SSH)

Hetzner Cloud MCP Server — two management layers (Cloud API + SSH) with 60 tools. Manage server power, snapshots, firewalls, DNS, plus SSH into servers for service control, log viewing, Nginx management, MySQL queries, and system monitoring. Self-hosted PHP, MIT licensed.

Provides remote machine control capabilities, eliminating SSH overhead for token-efficient system operations.

Orchestrates remote server tasks via SSH and SFTP with a persistent queue. Ideal for DevOps and AI agents.

Securely execute remote commands and perform file operations over SSH, with support for both password and key-based authentication.

MCP server that exposes an SSH server list from a TOML config file

MCP-based SSH session manager for Linux backend teams

Connect to, configure, and monitor Cisco network devices like routers and switches via SSH.

Rent a real Linux VPS as an AI agent — pay USDC (x402 on Base) or card, SSH in under 60s, no signup; provision, exec, firewall, and storage.

A comprehensive MCP server for configuring and managing Cisco ACI (Application Centric Infrastructure) fabrics through the APIC REST API.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.