bash-command MCP server
✓ VerifiedMengeksekusi shell command dengan orkestrasi background process yang canggih dan observabilitas untuk AI agent.
Juga dikenal sebagai mrorigo/bash-command-mcp
- Stars
- 3
- Tools
- 6
- Unduhan, 30 hari
- —
- Versi terbaru
- 1.0.0
- Commit terakhir
- 21 Mei 2026
- Lisensi
- MIT
Apa itu bash-command MCP?
bash-command adalah MCP server. Mengeksekusi shell command dengan orkestrasi background process yang canggih dan observabilitas untuk AI agent. Server ini menyediakan 6 tool, seperti run, run_background, list_background.
Ringkasan dibuat dari README proyek
Tentang bash-command MCP server
Server ini memungkinkan AI agent untuk mengeksekusi shell command dengan manajemen background process. Server ini menyediakan cara terstruktur untuk menjalankan command di foreground atau mengelola tugas yang berjalan lama melalui kontrol lifecycle tertentu. Developer dapat menggunakannya secara lokal via stdio atau secara remote menggunakan Streamable HTTP dengan mengonfigurasi environment variables host dan port tertentu.
User dapat mengelola workflow yang kompleks menggunakan tool seperti run_background, list_background, dan kill_background. Server ini menyertakan observabilitas bawaan melalui OpenTelemetry, yang memungkinkan trace dan metrics diekspor via OTLP HTTP. Server ini juga menyimpan file log stdout dan stderr per-process untuk pemantauan. Untuk memastikan keamanan, dokumentasi menyarankan untuk menjalankan server di dalam Docker guna mengisolasi eksekusi command dari host machine Anda.
Konteks eksekusi yang presisi tetap terjaga melalui kemampuan untuk memberikan override cwd dan env pada setiap command. Server ini menangani timeout untuk tugas foreground dan background, dengan default 60 detik. Server ini dirancang untuk developer yang membutuhkan eksekusi shell dengan fidelitas tinggi, semantik exit-code yang jelas, serta visibilitas kelas produksi terhadap tindakan agent.
Apa yang bisa Anda lakukan dengannya
- 1Mengelola tugas background yang berjalan lamaJalankan sebuah process di background dan pantau progresnya melalui file log.
- 2Mengobservasi performa agentPantau durasi tool call dan kegagalan menggunakan instrumentasi OpenTelemetry.
- 3Mengisolasi eksekusi commandJalankan shell command di dalam container untuk mencegahnya memengaruhi host system.
Ditulis berdasarkan README proyek. Setiap use case diperiksa terhadap kutipan dari README tersebut.
Cara menginstal bash-command MCP
Format diverifikasi 10 Nov 2026Tambahkan ke CursorTambahkan ke GooseInstal bash-command MCP di Claude Code
$ claude mcp add bash-command-mcp -- npx -y bash-command-mcpInstal bash-command MCP di Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"bash-command-mcp": {
"command": "npx",
"args": [
"-y",
"bash-command-mcp"
]
}
}
}Instal bash-command MCP di VS Code
.vscode/mcp.json
{
"servers": {
"bash-command-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"bash-command-mcp"
]
}
}
}Instal bash-command MCP di VS Code CLI
$ code --add-mcp '{"name":"bash-command-mcp","type":"stdio","command":"npx","args":["-y","bash-command-mcp"]}'Instal bash-command MCP di Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"bash-command-mcp": {
"command": "npx",
"args": [
"-y",
"bash-command-mcp"
]
}
}
}Instal bash-command MCP di Codex
$ codex mcp add bash-command-mcp -- npx -y bash-command-mcpInstal bash-command MCP di Codex config.toml
~/.codex/config.toml
[mcp_servers.bash-command-mcp] command = "npx" args = ["-y", "bash-command-mcp"]
Instal bash-command MCP di Gemini CLI
$ gemini mcp add -s user bash-command-mcp npx -- -y bash-command-mcpInstal bash-command MCP di Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"bash-command-mcp": {
"command": "npx",
"args": [
"-y",
"bash-command-mcp"
]
}
}
}Tool bash-command MCP 6
Terdeteksi dari READMErunrun_backgroundlist_backgroundkill_backgroundtail_backgroundwait_background
| run | — | |
| run_background | — | |
| list_background | — | |
| kill_background | — | |
| tail_background | — | |
| wait_background | — |
Konfigurasi
BASH_COMMAND_MCP_HOSTBASH_COMMAND_MCP_LOG_DIRDirectory used to store background process stdout/stderr log files.
BASH_COMMAND_MCP_PORTBASH_COMMAND_MCP_TRANSPORTOTEL_ENABLEDEnable or disable OpenTelemetry instrumentation (`true` or `false`).
OTEL_EXPORTER_OTLP_ENDPOINTOTLP HTTP endpoint for exporting OpenTelemetry traces and metrics (for example `http://localhost:4318`).
OTEL_METRIC_EXPORT_INTERVAL_MSOpenTelemetry metrics export interval in milliseconds.
OTEL_SERVICE_NAMEOpenTelemetry service name override.
OTEL_SERVICE_VERSIONOpenTelemetry service version override.
| Nama | Deskripsi | Tipe |
|---|---|---|
| BASH_COMMAND_MCP_HOST | — | |
| BASH_COMMAND_MCP_LOG_DIR | Directory used to store background process stdout/stderr log files. | |
| BASH_COMMAND_MCP_PORT | — | |
| BASH_COMMAND_MCP_TRANSPORT | — | |
| OTEL_ENABLED | Enable or disable OpenTelemetry instrumentation (`true` or `false`). | |
| OTEL_EXPORTER_OTLP_ENDPOINT | OTLP HTTP endpoint for exporting OpenTelemetry traces and metrics (for example `http://localhost:4318`). | |
| OTEL_METRIC_EXPORT_INTERVAL_MS | OpenTelemetry metrics export interval in milliseconds. | |
| OTEL_SERVICE_NAME | OpenTelemetry service name override. | |
| OTEL_SERVICE_VERSION | OpenTelemetry service version override. |
Pengecekan otomatis
Berjalan 14 Nov 2026Laporan lengkap →Lolos checks otomatis kami. Ini bukan audit keamanan: baca kodenya dan berikan server akses paling terbatas yang dibutuhkannya. Cara kerja checks
- Source repository terhubung dan dapat dijangkaumrorigo/bash-command-mcp is public and reachablegithub.com/mrorigo/bash-command-mcp ↗Lolos
- Nama paket mencantumkan repositori ini sebagai sumbernyaTidak diperiksa
- Provenance build (atestasi Sigstore)Tidak diperiksa
- Lisensi open source (OSI)MITspdx.org/licenses/MIT.html ↗Lolos
- Ada commit atau release dalam satu tahun terakhirLast commit or release 2026-05-21github.com/mrorigo/bash-command-mcp ↗Lolos
- OpenSSF ScorecardTidak diperiksa
- Nama package tidak mirip dengan package populerNo popular package one edit away from bash-command-mcpLolos
- Tidak ada advisory kritis pada paket atau dependensinyathe package checked; no critical advisoryosv.dev ↗Lolos
- Tidak ada instruksi tersembunyi untuk model6 tool descriptions and the README read; no override phrases, credential paths or hidden charactersLolos
- Tools yang bersifat destruktif telah diberi labelTidak diperiksa
- Endpoint remote merespons handshake MCPTidak diperiksa
README
Lihat di GitHubbash-command-mcp
A highly sophisticated Bash MCP server for safe, structured command execution with first-class background job orchestration.
Important Security Warning
This server executes shell commands on the machine where it is running.
If you run bun run index.ts directly on your host, commands run on your host with your user permissions.
Use Docker to isolate execution unless you fully trust the MCP client and prompts.
To install dependencies:
bun install
To run over stdio:
bun run index.ts
To run over Streamable HTTP:
BASH_COMMAND_MCP_TRANSPORT=http \
BASH_COMMAND_MCP_HOST=127.0.0.1 \
BASH_COMMAND_MCP_PORT=3000 \
bun run index.ts
To run via npm/npx (published package):
npx -y bash-command-mcp
Why This Server
- High-fidelity shell execution with clear exit-code semantics.
- Advanced background process lifecycle controls (
run_background,wait_background,kill_background). - Built-in observability via per-process stdout/stderr log files.
- OpenTelemetry traces and metrics for production visibility.
- Agent-friendly ergonomics with
cwdandenvoverrides for precise execution context.
Tool Behavior
Tools:
run: run command in foreground. Args:commandorcmd,timeoutSeconds(default60, min1; values above86400are capped with a hint), optionalcwd, optionalenv.run_background: start command in background with stdout/stderr written to log files. Args:commandorcmd, optionalcwd, optionalenv.list_background: list tracked background processes, including log file paths.kill_background: stop tracked background process bypid.tail_background: show last N lines from background process logs. Args:pid, optionallines(default200, max5000).wait_background: wait for background process completion and return final status/output. Args:pid, optionaltimeoutSeconds(default60, min1; values above86400are capped with a hint).
OpenTelemetry
This server includes built-in OpenTelemetry instrumentation for traces and metrics.
- OpenTelemetry packages are installed with the server package.
- Telemetry initializes unless
OTEL_ENABLED=false. - If
OTEL_EXPORTER_OTLP_ENDPOINTis set, traces/metrics are exported via OTLP HTTP. - If no OTLP endpoint is configured, console exporters are used.
Instrumented operations:
- Tool call spans for
run,run_background,list_background,tail_background,wait_background, andkill_background. - Background lifecycle spans/counters (
started,ended). - Metrics for tool calls, failures, timeouts, and duration histograms.
Common env vars:
OTEL_ENABLED=true|falseOTEL_SERVICE_NAME=bash-command-mcpOTEL_SERVICE_VERSION=1.0.0OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318OTEL_METRIC_EXPORT_INTERVAL_MS=10000BASH_COMMAND_MCP_LOG_DIR=/path/to/log-dir
Example (OTLP Collector on localhost):
OTEL_ENABLED=true \
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 \
OTEL_SERVICE_NAME=bash-command-mcp \
npx -y bash-command-mcp
Transports
This server supports two transports:
stdiofor local, process-spawned integrations.httpfor remote or network-accessible MCP clients using Streamable HTTP.
Default behavior remains stdio so existing desktop and CLI setups keep working.
Environment variables for HTTP mode:
BASH_COMMAND_MCP_TRANSPORT=http|stdioBASH_COMMAND_MCP_HOST=127.0.0.1BASH_COMMAND_MCP_PORT=3000BASH_COMMAND_MCP_ALLOWED_HOSTS=localhost,127.0.0.1,[::1]
HTTP mode uses host-header validation by default when bound to a loopback address. If you bind to 0.0.0.0 or ::, provide an explicit allow-list in BASH_COMMAND_MCP_ALLOWED_HOSTS.
Docker
Build the image:
docker build -t bash-command-mcp .
Run with a local folder mounted at /workspace:
docker run --rm -i -v "$(pwd):/workspace" bash-command-mcp
Run over Streamable HTTP:
docker run --rm -p 3000:3000 \
-e BASH_COMMAND_MCP_TRANSPORT=http \
-e BASH_COMMAND_MCP_HOST=0.0.0.0 \
-e BASH_COMMAND_MCP_PORT=3000 \
bash-command-mcp
/workspace mapping explained:
- Left side (
$(pwd)) is a folder on your host machine. - Right side (
/workspace) is the path inside the container. - Commands run by this MCP server should target files under
/workspace; those changes are written back to the mapped host folder.
For HTTP mode in Docker, bind to 0.0.0.0 and publish the port with -p. If you expose the container beyond localhost, set BASH_COMMAND_MCP_ALLOWED_HOSTS to the hostnames you want to permit.
Example:
- If your host has
./project/file.txtand you run the container from./project, the same file is available in the container at/workspace/file.txt.
Pertanyaan tentang bash-command MCP
Bagaimana cara menambahkan bash-command MCP ke Claude Code?
Jalankan claude mcp add bash-command-mcp -- npx -y bash-command-mcp di terminal Anda. Tambahkan --scope user agar tersedia di semua proyek.
Bagaimana cara menambahkan bash-command MCP ke Cursor?
Buka ~/.cursor/mcp.json dan tambahkan server di bawah mcpServers, menggunakan config Cursor yang ditunjukkan di bagian instalasi di atas.
Tool apa yang disediakan bash-command MCP?
Server ini menyediakan 6 tool, termasuk run, run_background, list_background, kill_background, tail_background.
Apakah aman menjalankan server ini di host machine saya?
Disarankan untuk menggunakan Docker guna mengisolasi eksekusi karena server ini menjalankan shell command dengan izin user Anda.
Bisakah saya menjalankan command di background?
Ya, server ini menyediakan tool untuk menjalankan, melihat daftar, menghentikan, melakukan tail, dan menunggu background process.
Bagaimana cara memantau performa dan trace server?
Server ini sudah menyertakan instrumentasi OpenTelemetry bawaan untuk trace dan metrics.
Metode transport apa saja yang didukung?
Server ini mendukung stdio untuk integrasi lokal dan Streamable HTTP untuk client jarak jauh atau yang dapat diakses melalui jaringan.