A robust subprocess execution MCP
Project description
async-bash-mcp
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 runcwd(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 commandwait(int): Wait time in millisecondsterminate(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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file async_bash_mcp-0.1.6.tar.gz.
File metadata
- Download URL: async_bash_mcp-0.1.6.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15312b9d1b03138b73eb53299f74e6a87ebe39d57296fceebec635af41fe242a
|
|
| MD5 |
6176239aa58ea951ee3b6056b3b28f0f
|
|
| BLAKE2b-256 |
e8c5583366cd84383672de4188dab3cb228453352741ec0df0abed1ef62bd79b
|
File details
Details for the file async_bash_mcp-0.1.6-py3-none-any.whl.
File metadata
- Download URL: async_bash_mcp-0.1.6-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd95dc267e5e27bb799d693ae314e55bf8152bf617c1e35ba276e82ccc38973d
|
|
| MD5 |
4a30964e5d9c10f3712b212245dc6f3d
|
|
| BLAKE2b-256 |
50f9cb28163b773cc8fc4ad462d23de575e8841bc56e53f220badd3c16a42af6
|