bash-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bash-mcpstart a background process for npm run dev"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
# Install globally
npm install -g bash-mcp
# Or use with npx
npx bash-mcpRelated MCP server: Shell Exec MCP
Quick Start
For Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"bash": {
"command": "npx",
"args": ["bash-mcp"]
}
}
}For Claude Code (Cursor, VS Code)
Open command palette (Cmd/Ctrl + Shift + P)
Run "MCP: Add Server"
Select "NPM" as the server type
Enter:
bash-mcp
Available Tools
run - Execute a command
// 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
// 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
kill_background("frontend")list_background - List all background processes
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:
{
"success": true,
"stdout": "command output",
"stderr": "error output if any",
"command": "executed command"
}For background processes:
{
"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
{
"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:
Output is truncated to the specified limit
Full output is saved to a temporary file
The response includes the file path where full output can be found
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.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceEnables secure execution of shell commands through a dynamic approval system that prompts for user authorization on first use, with persistent command storage and comprehensive audit logging.Last updatedApache 2.0
- Alicense-qualityBmaintenanceEnables execution of bash commands with support for timeouts and background jobs, allowing file operations, build commands, system inspection, and long-running tasks.Last updated687MIT
- Alicense-qualityDmaintenanceProvides tools for executing shell commands both synchronously and asynchronously with real-time output streaming and process management capabilities. It enables users to start background tasks, monitor progress, and manage long-running processes via Stdio or HTTP transports.Last updated327MIT
- FlicenseBqualityDmaintenanceEnables system automation and control including command execution, process management, network tools, environment variables, disk usage, and service status.Last updated11
Related MCP Connectors
Operate your Linux servers from your LLM. Every action runs through an auditable allowlist.
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Execute PowerShell commands securely with controlled timeouts and input validation. Retrieve syste…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tinywind/bash-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server