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

bg-server-mcp-shell

v1.0.7

Published

MCP server for shell - PTY with live streaming for long-running processes (dev servers, watch modes, docker-compose, etc.)

Downloads

24

Readme

Documentations : Main | Tests

Cover Image

bg-mcp-shell-server

MCP server for running long-running processes in PTY with real-time output streaming

✨ Features

  • Real-time output streaming - Live terminal output
  • Interactive processes - Send input to running processes
  • Multiple sessions - Control multiple processes simultaneously
  • Buffered output - Full output history preserved
  • PTY emulation - True terminal experience

👥 Perfect for

  • 🚀 Dev servers (Vite, webpack, Next.js)
  • 🔄 Watch modes (nodemon, jest --watch)
  • 🐳 Docker/Docker Compose
  • 🧪 Long-running tests
  • 💬 Interactive CLI tools

🤖 Use cases prompts

[ You ] " Run web dev server , check for errors , and fix . "

[ You ] " Run playwright tests and monitor for errors . "

[ You ] " Build and deploy to Cloudflare . "

[ You ] " Start docker-compose and tell me when postgres is ready . "

[ You ] " Tell me what processes are running . "

[ You ] " Restart processes . "

📊 Comparison

| Creator | Long-running processes | Output in response | Interaction | Best for | |-|-|-|-|-| | bg | ✅ Yes | ✅ Buffer + terminal | ✅ writeInput | Dev servers, watch modes | | tumf | ❌ Hangs | ✅ Yes | ✅ Yes | ls, cat, grep, git status | | hdresearch | ❌ Hangs | ✅ Yes | ✅ Yes | Basic commands | | run_command | ⚠️ Blocking/Async | ⚠️ Partial | ❌ No | Standard commands with user approval |

🚀 Quick Start

Installation

npm install -g bg-server-mcp-shell

Configuration

Add to your MCP client config (e.g., Claude Desktop, Cline):

{
  "mcpServers": {
    "shell": {
      "command": "npx",
      "args": ["-y", "bg-server-mcp-shell@latest"],
      "env": {
        "COLOR": "false"
      }
    }
  }
}

🛠️ Functions

Quick command (wait for completion): startProcessAndWait Run command and wait for completion

echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"startProcessAndWait","arguments":{"cmd":"echo","args":["Hello"],"timeoutMs":5000}}}' | npx bg-server-mcp-shell

Start a background process: startProcessBackground Start long-running process in background

echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"startProcessBackground","arguments":{"cmd":"npm","args":["run","dev"]}}}' | npx bg-server-mcp-shell

List sessions: listSessions List all active sessions

echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"listSessions","arguments":{}}}' | npx bg-server-mcp-shell

Get output: getSessionOutput Read buffered output from session

echo '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"getSessionOutput","arguments":{"sessionId":"<id>"}}}' | npx bg-server-mcp-shell

Send input: writeInput Send input to running process

echo '{"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"writeInput","arguments":{"sessionId":"<id>","data":"rs\n"}}}' | npx bg-server-mcp-shell

Stop process: stopProcess Stop a running session

echo '{"jsonrpc":"2.0","id":6,"method":"tools/call","params":{"name":"stopProcess","arguments":{"sessionId":"<id>"}}}' | npx bg-server-mcp-shell

Cleanup finished sessions: cleanupSessions Remove finished sessions from memory

# Cleanup specific session
echo '{"jsonrpc":"2.0","id":7,"method":"tools/call","params":{"name":"cleanupSessions","arguments":{"sessionId":"<id>"}}}' | npx bg-server-mcp-shell

# Or cleanup all finished sessions
echo '{"jsonrpc":"2.0","id":8,"method":"tools/call","params":{"name":"cleanupSessions","arguments":{}}}' | npx bg-server-mcp-shell

🧪 Development

Full documentation: See Tests Documentation for complete testing guide, coverage, and API reference.

📦 Technical Details

🤝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new features
  4. Ensure all tests pass: npm test
  5. Submit a pull request

🐛 Issues & Bug Reports

Found a bug or have a feature request? Please report it on GitHub:

Report an Issue

📄 License

MIT © Bruno Garret