Async wrapper for Gemini CLI to enable parallel task execution in Claude Code
Project description
Gemini CLI MCP Server
Async wrapper for Gemini CLI to enable parallel task execution in Claude Code.
Features
- Async execution - Run tasks in background without blocking
- Multi-instance - Execute multiple Gemini CLI tasks in parallel
- Zombie process cleanup - Automatic cleanup of finished processes
- Zero configuration - Works out of the box
Quick Start
1. Install
git clone https://github.com/your-username/gemini-cli-mcp-async.git
cd gemini-cli-mcp-async
chmod +x gemini_cli_mcp_async_server.py
2. Configure Claude Code
Add to ~/.claude/settings.json:
{
"mcpServers": {
"gemini-cli": {
"command": "/absolute/path/to/gemini-cli-mcp-async/gemini_cli_mcp_async_server.py",
"args": [],
"env": {}
}
}
}
3. Restart Claude Code
Usage
Async execution
# Start async task
gemini_cli_execute_async(
query="your prompt here",
working_dir="/path/to/project"
)
# Returns: task_id
# Check result
gemini_cli_check_result(task_id="your_task_id")
Parallel execution
# Start multiple tasks
task1 = gemini_cli_execute_async(query="task 1", yolo=True)
task2 = gemini_cli_execute_async(query="task 2", sandbox=True)
# Check results later
result1 = gemini_cli_check_result(task_id=task1)
result2 = gemini_cli_check_result(task_id=task2)
Sync execution
# Immediate result
gemini_cli_execute(
query="your prompt here",
timeout=300
)
API Reference
gemini_cli_execute(query, working_dir, sandbox, yolo, approval_mode, experimental_acp, allowed_mcp_server_names, allowed_tools, extensions, include_directories, output_format, screen_reader, debug, additional_args, timeout)
Execute Gemini CLI synchronously and return result immediately.
gemini_cli_execute_async(query, working_dir, sandbox, yolo, approval_mode, experimental_acp, allowed_mcp_server_names, allowed_tools, extensions, include_directories, output_format, screen_reader, debug, additional_args)
Start Gemini CLI task in background and return task_id.
gemini_cli_check_result(task_id)
Check status of async task and return result if completed.
Troubleshooting
Server not showing in Claude Code:
- Check file path is absolute and correct
- Ensure file has execute permissions (
chmod +x) - Verify gemini-cli is installed and accessible
Tasks stuck:
- Check task status with
gemini_cli_check_result() - View debug log:
tail -f /tmp/gemini_cli_mcp_debug.log
No output from long tasks:
- Use
output_format="stream-json"for better output capture - Check disk space in
/tmp
Configuration
All Gemini CLI parameters are supported. Key options:
sandbox- Enable sandbox modeyolo- Auto-confirm promptsapproval_mode- Set approval mode ('default', 'auto_edit', 'yolo')output_format- Output format ('text', 'json', 'stream-json')timeout- Timeout for sync execution (seconds)debug- Enable debug logging
Project details
Release history Release notifications | RSS feed
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 gemini_cli_mcp_async-0.1.1.tar.gz.
File metadata
- Download URL: gemini_cli_mcp_async-0.1.1.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87e765c54cbfed1e201c7621034825964efcd74494c140b199f7ae603a3e8e2f
|
|
| MD5 |
a17cfd329017376fcfcd03515c30595f
|
|
| BLAKE2b-256 |
08e2df1688eae116bbac142058e141aacb4cd41521750a7a557df81d03308e6e
|
File details
Details for the file gemini_cli_mcp_async-0.1.1-py3-none-any.whl.
File metadata
- Download URL: gemini_cli_mcp_async-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb38690301315c0d3376537664476cf35c69762f0e663fcd985fd16e4a884fe6
|
|
| MD5 |
1edcd0e2bf6f3e6b5bbf3ad782196d80
|
|
| BLAKE2b-256 |
456289b823f92d576277da05598104a07c883493dfe83b87c2ac1c5ee3939dbd
|