Skip to main content

A robust subprocess execution MCP

Project description

async-bash-mcp

pypi Test

An MCP server for spawning and managing bash commands asynchronously. Run multiple shell commands in parallel and check their progress independently.

Usage with opencode

Add to your opencode.json config to replace the bash tool with async-bash-mcp:

{
  "$schema": "https://opencode.ai/config.json",
  "tools": {
    "bash": false
  },
  "mcp": {
    "async-bash": {
      "type": "local",
      "command": ["uvx", "async-bash-mcp"],
      "enabled": true
    }
  }
}

Then use commands like:

  • "Spawn a long-running build in the background"
  • "Run tests in parallel and show me the results"
  • "Start a server and tell me when it's ready"

Why async bash?

When working with long-running commands like builds, tests, or servers, the agent needs to:

  • Monitor progress incrementally without committing to a fixed timeout
  • Run multiple commands in parallel and check each independently
  • Make decisions about continuing or terminating based on partial output
  • Process real-time feedback as commands generate output

This tool provides the agent with better information for decision-making, leading to faster task completion and fewer confused responses.

Key advantages over the built-in bash tool:

  • Better decision making: Agents can see partial output and make informed choices about continuing or terminating
  • Parallel execution: Run multiple commands simultaneously
  • No timeout guessing: Check progress incrementally instead of setting timeouts upfront
  • Faster iterations: No waiting for arbitrary timeouts when errors are already visible

This tool is designed to replace opencode's bash tool for any scenario involving potentially long-running commands, giving agents the information they need to make better decisions and save you time.

Tools

spawn - Launch a bash command asynchronously

  • command (str): The bash command to run
  • cwd (str, optional): Working directory path
  • Returns a process ID for tracking

list_processes - Show all running/recent processes

  • No parameters
  • Returns array of {"ID": int, "command": str, "done": bool}

poll - Check progress of a spawned process

  • process_id (int): ID from spawn command
  • wait (int): Wait time in milliseconds
  • terminate (bool, optional): Kill process before returning results
  • Returns {"stdout": str, "stderr": str, "elapsedTime": float, "finished": bool, "exitCode": int}

Installation

uvx async-bash-mcp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

async_bash_mcp-0.1.4.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

async_bash_mcp-0.1.4-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file async_bash_mcp-0.1.4.tar.gz.

File metadata

  • Download URL: async_bash_mcp-0.1.4.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for async_bash_mcp-0.1.4.tar.gz
Algorithm Hash digest
SHA256 88888401ae619db1dbda59c2ae2b8c2472aa18ebcbd7a68d1d76991d45546241
MD5 caa9e35bb916598721ec98ba97871155
BLAKE2b-256 b0609954b213b0a02a36fd56be719a01ef70d4254b742e73de8962fb0f8da702

See more details on using hashes here.

File details

Details for the file async_bash_mcp-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for async_bash_mcp-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7b5ed2708986e0c44b4b393d9df54d731f4edaf263d769845bf0635f372f63d3
MD5 de96cf1a1c0709372005a5d860e66f5e
BLAKE2b-256 e0a2b12098098ec61fb0a39f756e913850e9bf99b143cc6f7d5a809e97a4e5b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page