I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

servidor terminal-MCP
Make LLM puede controlar su PC o servidor con SSH o terminal.
3 years
Works with Finder
1
Github Watches
2
Github Forks
4
Github Stars
Terminal MCP Server
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:
npx -y @smithery/cli install @weidwonder/terminal-mcp-server --client claude
Manual Installation
# 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
# 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.
# 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:
Option | Description | Default |
---|---|---|
--port or -p |
The port to listen on | 8080 |
--endpoint or -e |
The endpoint path | /sse |
--host or -h |
The host to bind to | localhost |
Example with custom 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 at http://0.0.0.0:3000/mcp
.
Testing with MCP Inspector
# 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
Parameter | Type | Required | Description |
---|---|---|---|
command | string | Yes | The command to execute |
host | string | No | The remote host to connect to. If not provided, the command will be executed locally |
username | string | Required when host is specified | The username for SSH connection |
session | string | No | Session name, defaults to "default". The same session name will reuse the same terminal environment for 20 minutes |
env | object | No | Environment variables, defaults to an empty object |
Examples
Executing a Command Locally
{
"command": "ls -la",
"session": "my-local-session",
"env": {
"NODE_ENV": "development"
}
}
Executing a Command on a Remote Host
{
"host": "example.com",
"username": "user",
"command": "ls -la",
"session": "my-remote-session",
"env": {
"NODE_ENV": "production"
}
}
Configuring with AI Assistants
Configuring with Roo Code
- 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:
For stdio mode (local connection)
{
"mcpServers": {
"terminal-mcp": {
"command": "node",
"args": ["/path/to/terminal-mcp-server/build/index.js"],
"env": {}
}
}
}
For SSE mode (remote connection)
{
"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
- Open the Cline settings file:
~/.cline/config.json
- Add the following configuration:
For stdio mode (local connection)
{
"mcpServers": {
"terminal-mcp": {
"command": "node",
"args": ["/path/to/terminal-mcp-server/build/index.js"],
"env": {}
}
}
}
For SSE mode (remote connection)
{
"mcpServers": {
"terminal-mcp-sse": {
"url": "http://localhost:8080/sse",
"headers": {}
}
}
}
Configuring with Claude Desktop
- Open the Claude Desktop settings file:
~/Library/Application Support/Claude/claude_desktop_config.json
- Add the following configuration:
For stdio mode (local connection)
{
"mcpServers": {
"terminal-mcp": {
"command": "node",
"args": ["/path/to/terminal-mcp-server/build/index.js"],
"env": {}
}
}
}
For SSE mode (remote connection)
{
"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
orscreen
/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
相关推荐
Confidential guide on numerology and astrology, based of GG33 Public information
A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.
Converts Figma frames into front-end code for various mobile frameworks.
Therapist adept at identifying core issues and offering practical advice with images.
A medical specialist offering assistance grounded in clinical guidelines. Disclaimer: This is intended for research and is NOT safe for clinical use!
Advanced software engineer GPT that excels through nailing the basics.
Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.
Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx
Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.
Servidor MCP para obtener contenido de la página web con el navegador sin cabeza de dramaturgo.
Espejo de https: //github.com/suhail-ak-s/mcp-typesense-server
Un bot de chat de IA para equipos pequeños y medianos, que apoyan modelos como Deepseek, Open AI, Claude y Gemini. 专为中小团队设计的 ai 聊天应用 , 支持 Deepseek 、 Open ai 、 Claude 、 Géminis 等模型。
本项目是一个钉钉 MCP (Protocolo del conector de mensajes )服务 , 提供了与钉钉企业应用交互的 API 接口。项目基于 Go 语言开发 支持员工信息查询和消息发送等功能。 支持员工信息查询和消息发送等功能。
Reviews

user_NdSkdaJv
I've been using terminal-mcp-server by weidwonder, and it has significantly improved my terminal management. The setup was straightforward, and the server runs smoothly. The documentation on the GitHub page is comprehensive, making it easy even for beginners to get started. Highly recommend to anyone looking to streamline their command-line operations!