bash-mcp Server logo

bash-mcp Server

Community
tinywind

A simple MCP (Model Context Protocol) server that enables Claude to execute shell commands without permission prompts.

Publishertinywind
Repositorybash-mcp
LanguageJavaScript
Forks
8
Stars
11
Available tools
4
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    bash-mcp Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 4 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    11 stars and 8 forks from the linked repository.

bash-mcp

A simple MCP (Model Context Protocol) server that enables Claude to execute shell commands without permission prompts.

⚠️ Security Warning: This server executes arbitrary shell commands. Use with caution and only in trusted environments.

Installation

bash
# Install globally
npm install -g bash-mcp

# Or use with npx
npx bash-mcp

Quick Start

For Claude Desktop

Add to your claude_desktop_config.json:

json
{
  "mcpServers": {
    "bash": {
      "command": "npx",
      "args": ["bash-mcp"]
    }
  }
}

For Claude Code (Cursor, VS Code)

  1. Open command palette (Cmd/Ctrl + Shift + P)
  2. Run "MCP: Add Server"
  3. Select "NPM" as the server type
  4. Enter: bash-mcp

Available Tools

run - Execute a command

javascript
// Simple command
run("ls -la")

// With working directory
run("npm test", { cwd: "/path/to/project" })

// With timeout (milliseconds)
run("long-running-command", { timeout: 60000 })

run_background - Start a background process

javascript
// Start a dev server
run_background("npm run dev", "frontend")

// Start backend service with working directory
run_background("./gradlew bootRun", "backend", { cwd: "./backend" })

kill_background - Stop a background process

javascript
kill_background("frontend")

list_background - List all background processes

javascript
list_background()

Example Usage

User: Start the development servers
Assistant: I'll start both frontend and backend servers for you.

[Uses run_background tool]
Started frontend server (PID: 12345)
Started backend server (PID: 12346)

User: Check if they're running
Assistant: [Uses list_background tool]
Both servers are running successfully!

Response Format

All tools return JSON formatted responses:

json
{
  "success": true,
  "stdout": "command output",
  "stderr": "error output if any",
  "command": "executed command"
}

For background processes:

json
{
  "success": true,
  "name": "frontend",
  "pid": 12345,
  "command": "npm run dev",
  "message": "Started background process 'frontend' (PID: 12345)"
}

Features

  • Execute any shell command without permission prompts
  • Run long-running processes in the background
  • Manage background processes (list, kill)
  • Capture stdout and stderr
  • Set working directory for commands
  • Configure timeout for commands
  • Automatic cleanup on server shutdown
  • NEW: Automatic output truncation with full output saved to temp files
  • NEW: Configurable output size limits and temp directory via environment variables

Environment Variables

  • BASH_MCP_MAX_OUTPUT_SIZE: Maximum output size in bytes before truncation (default: 51200/50KB)
  • BASH_MCP_TEMP_DIR: Directory for storing full output when truncated (default: system temp directory)

Example Configuration

json
{
  "mcpServers": {
    "bash": {
      "command": "npx",
      "args": ["bash-mcp"],
      "env": {
        "BASH_MCP_MAX_OUTPUT_SIZE": "102400",
        "BASH_MCP_TEMP_DIR": "/tmp/bash-mcp-outputs"
      }
    }
  }
}

Output Overflow Handling

When command output exceeds BASH_MCP_MAX_OUTPUT_SIZE:

  1. Output is truncated to the specified limit
  2. Full output is saved to a temporary file
  3. The response includes the file path where full output can be found
  4. If custom temp directory fails, falls back to system temp directory

Security Considerations

This MCP server executes arbitrary shell commands with the same privileges as the Node.js process. Only use in development environments or trusted contexts.

Requirements

  • Node.js >= 16.0.0
  • npm or npx

License

MIT

Author

tinywind tinywind0@gmail.com

Contributing

Issues and pull requests are welcome at GitHub.

Installation

TypingMind
{
  "mcpServers": {
    "bash-mcp": {
      "command": "npx",
      "args": [
        "bash-mcp"
      ]
    }
  }
}

Available Tools

  • run

    Execute a shell command and return output

  • run_background

    Run a command in background

  • kill_background

    Kill a background process by name

  • list_background

    List all running background processes

Use bash-mcp Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once bash-mcp Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add bash-mcp Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the bash-mcp Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "bash-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "bash-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the bash-mcp Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the bash-mcp Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use bash-mcp Server to help me with this task?
bash-mcp Server
Sure. I read it.
Here is what I found using bash-mcp Server.

Frequently asked questions

What is the bash-mcp Server MCP server used for?

bash-mcp Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use bash-mcp Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use bash-mcp Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use bash-mcp Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With bash-mcp Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect bash-mcp Server MCP to TypingMind?

bash-mcp Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does bash-mcp Server MCP provide in TypingMind?

bash-mcp Server exposes 4 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use bash-mcp Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If bash-mcp Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇