T

mcp-terminal-server

...
Created 12/2/2024byRichardTheuws

Language:

TypeScript

Stars:

2

Forks:

0

@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
Last updated: 1/18/2025

Publisher info

RichardTheuws's avatar

Richard Theuws

Founder of the Metal Business Club, consultant, online marketeer.

Metal Business Club
Bladel, Netherlands
1
followers
3
following
9
repos

More MCP servers built with TypeScript

docbase-mcp-server

MCP Server Implementation for DocBase

By f4401
aapi-mcp-server

Advanced API MCP Server

By Asphere-xyz1
DBX-MCP-Server

MCP Server for Dropbox

By amgadabdelhafez1