npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

terminal-mcp-server

v1.0.0

Published

Secure terminal command execution for Model-Context-Protocol servers

Readme

Secure Terminal-Only MCP Server

This project provides a secure Model-Context-Protocol (MCP) server that allows terminal command execution in a controlled environment. It's designed to be used with AI assistants and other clients that need terminal access while keeping confidential information protected.

Features

  • Path Restrictions: Only allows command execution in pre-configured directories
  • Command Filtering: Optional allowlist/blocklist for commands
  • Output Sanitization: Automatically redacts sensitive information
  • Resource Limits: Configurable timeouts and output size limits
  • Docker Ready: Run in an isolated container for enhanced security

Installation

# Install globally
npm install -g terminal-mcp-server

# Or install locally in your project
npm install terminal-mcp-server

Quick Start

# Initialize configuration (creates terminal-tool.json and terminal-security.json)
terminal-mcp-server --init

# Edit the configuration files to specify allowed paths and security settings

# Start the server
terminal-mcp-server

Security Configuration

The server includes two levels of security configuration:

  1. Basic Path Restriction (terminal-tool.json):

    {
      "allowedPaths": [
        "/public/data",
        "/public/scripts"
      ]
    }
  2. Enhanced Security (terminal-security.json):

    {
      "allowedPaths": [
        "/public/data",
        "/public/scripts"
      ],
      "commandSecurity": {
        "enabled": true,
        "allowedCommands": ["ls", "cat", "grep", "find"],
        "blockedCommands": ["curl", "wget", "ssh"],
        "timeoutSeconds": 5
      },
      "outputFiltering": {
        "enabled": true
      }
    }

Docker Usage

# Pull the image
docker pull your-org/terminal-only-mcp-server:latest

# Run with default settings
docker run -d \
  -e PUBLIC_DIR_1=/public/data \
  -e PUBLIC_DIR_2=/public/scripts \
  -v /path/on/host/data:/public/data \
  -v /path/on/host/scripts:/public/scripts \
  your-org/terminal-only-mcp-server:latest

Connecting Clients

Any MCP-compatible client can connect to this server. Example with the official SDK:

import { Client } from '@modelcontextprotocol/sdk/client';
import { createCliTransport } from '@modelcontextprotocol/sdk/client/cli';

async function connectToTerminalServer() {
  const transport = createCliTransport('/path/to/terminal-only-mcp-server');
  const client = new Client();
  await client.connect(transport);
  
  // List available tools
  const tools = await client.listTools();
  console.log(tools);
  
  // Execute a terminal command
  const result = await client.callTool('terminal', {
    command: 'ls -la',
    workingDir: '/public/data'
  });
  
  console.log(result.content[0].text);
}

Security Best Practices

  1. Isolated Environments: Run the server in a container or virtual machine
  2. Least Privilege: Allow only necessary paths and commands
  3. Regular Updates: Keep the server and dependencies updated
  4. Audit Logs: Monitor the logs for suspicious activity
  5. Content Review: Validate all files in shared directories

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.