Get the FREE Ultimate OpenClaw Setup Guide →

async-bash

An MCP to overcome the issues I was having with opencode's bash tool

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio xhuw-async-bash-mcp uvx,async-bash-mcp

How to use

async-bash-mcp is an MCP server that allows you to spawn and manage bash commands asynchronously. It enables running multiple shell commands in parallel, monitoring their progress in real time, and querying individual processes for their output and status. This is particularly useful for long-running tasks such as builds, tests, or server processes where you want to observe partial output and make decisions without waiting for a fixed timeout. The server exposes tools to start commands, list active processes, and poll for progress, stdout, stderr, elapsed time, and exit codes.

To use it in your workflow, configure your environment or integration to point to the async-bash MCP server. The server is designed to replace the built-in bash tool in opencode-style configurations, enabling richer, incremental feedback for agents. Typical usage includes spawning a long-running command, monitoring its progress, and running additional commands in parallel while the first one continues to execute.

How to install

Prerequisites:

  • Python 3.8+ (for the underlying tooling and PyPI package hosting)
  • A working Python package manager (pip)
  • Optional: pipx for isolated tool installs

Installation steps:

  1. Ensure Python and pip are available:
    • Check Python: python3 --version
    • Check pip: pip --version
  2. Install the uvx runner (used to execute MCP servers via the uvx interface):
    • If you have pipx: pipx install uvx
    • Or install with pip (may require an additional setup for PATH): pip install uvx
  3. Install and run the MCP server:
    • Install the async-bash-mcp package via the uvx runner: uvx async-bash-mcp
    • This will install the package and make the command available as 'async-bash-mcp' for the MCP server setup.
  4. Verify installation:
    • Run a quick help or version check if available, for example: uvx --help async-bash-mcp --help
  5. Start using the MCP server by configuring your opencode.json or equivalent to point to the server as shown in the example configuration.

Additional notes

Tips and notes:

  • The server exposes three main tools: spawn (to start a bash command asynchronously), list_processes (to view running/recent processes), and poll (to fetch real-time progress including stdout, stderr, elapsed time, and exit code).
  • Use spawn to launch long-running commands in the background and then poll to monitor progress or tail outputs.
  • If a command needs to be terminated, use poll with terminate set to true or implement logic to send a termination signal to the process.
  • Ensure environment compatibility with your shell and working directories when spawning commands (cwd can be provided with spawn).
  • This MCP server is designed to handle multiple commands in parallel and provide incremental feedback, improving decision-making for agents during task execution.

Related MCP Servers

Sponsor this space

Reach thousands of developers