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.5.tar.gz (6.1 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.5-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for async_bash_mcp-0.1.5.tar.gz
Algorithm Hash digest
SHA256 c2af45bd9fd0f91f0648239d2e4d4429a584b74dfe56bf7b972de9c3215ceef9
MD5 4e307003adacf172be14c20348c543c5
BLAKE2b-256 acdb147150a1427d45a0ea8d88ec001b9058737329e952aa028285f26d607199

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for async_bash_mcp-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 05ac6a92e4882bedf0e233e90ab607b40806153f1a50ef7be71164ba7152382f
MD5 30e9f44b28617be03c0a8766a3d39138
BLAKE2b-256 1a2ff2a108e50c46af709ebee4dabeb8f1f8a067c871486b05b1be9dc1098f1e

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