@modelcontextprotocol/server-terminal

by MCP-Mirror

418 downloads
Not rated
GitHub

About

A terminal server implementation for the Model Context Protocol (MCP). It provides secure and controlled access to shell commands and npm operations, designed for MCP integrations that need to run terminal tasks programmatically.

Details

Author
MCP-Mirror
Downloads
418
Categories
Developer Tools

- Execute shell commands with full control
- Built-in npm operations (install, run scripts)
- Timeout handling for long-running commands
- Security through an allowed commands list
- Environment variables management
- Working directory control
- TypeScript support

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name @modelcontextprotocol/server-terminal
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install the package via npm, then add the provided JSON configuration to your MCP config file. The configuration defines allowed commands, a default timeout, a working directory, and environment variables.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "@modelcontextprotocol/server-terminal": {
            "terminal": {
                "command": "npx",
                "args": [
                    "-y",
                    "@modelcontextprotocol/server-terminal"
                ]
            }
        }
    }
}

McpServers

{
    "terminal": {
        "command": "npx",
        "args": [
            "-y",
            "@modelcontextprotocol/server-terminal"
        ]
    }
}

@modelcontextprotocol/server-terminal

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

Features

- 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

Installation

npm install @modelcontextprotocol/server-terminal

Configuration

Add to your MCP config:

{
  "terminal": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-terminal"],
    "autoApproveScope": ["execute_command", "npm_install", "npm_run"],
    "config": {
      "allowedCommands": ["npm", "node", "git"],
      "defaultTimeout": 30000,
      "defaultCwd": "/your/project/path",
      "environmentVariables": {
        "NODE_ENV": "development"
      }
    }
  }
}

Usage

// Execute command
const result = await terminal.executeCommand('ls', ['-la'], {
  cwd: '/some/path'
});

// Install npm package
await terminal.install('typescript');

// Run npm script
await terminal.runScript('build');

// Direct npm commands
await terminal.dev(); // npm run dev
await terminal.build(); // npm run build

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.