@victornanka/gemini-cli-mcp
v0.1.1
Published
MCP server for delegating tasks to Gemini CLI
Maintainers
Readme
@victornanka/gemini-cli-mcp
MCP server for delegating tasks to Gemini CLI. This allows you to invoke Gemini CLI agent capabilities from other MCP-enabled tools.
Prerequisites
- Gemini CLI must be installed and configured
- The
geminicommand must be available in your PATH
Installation
For Gemini CLI
Add to your ~/.gemini/settings.json:
{
"mcpServers": {
"gemini-delegate": {
"command": "bunx",
"args": ["@victornanka/gemini-cli-mcp@latest"]
}
}
}For Claude Code
Add to your Claude Code MCP configuration:
{
"mcpServers": {
"gemini-cli-mcp": {
"command": "bunx",
"args": ["@victornanka/gemini-cli-mcp@latest"]
}
}
}Usage
Once installed, you can use the task tool to delegate tasks to Gemini CLI:
@gemini-delegate task("Create a Python script that prints hello world", cwd="/path/to/project")Parameters
task(required): The task description to delegate to Gemini CLIcwd(required): The working directory where Gemini CLI should run (must be an absolute path)historyId(optional): Continue from a previous session (use thesession_idfrom a previous response)
How it Works
This MCP server wraps the Gemini CLI and allows other tools to programmatically invoke it. When you call the task tool:
- The MCP server spawns the
geminiCLI with your task - It uses
--output-format stream-jsonto get structured responses - The response is streamed back through the MCP protocol
- The conversation session ID is preserved for follow-up tasks
Response Format
The tool returns a JSON object with:
result: The assistant's response textsession_id: The session ID for continuing the conversationtotal_cost_usd: The total cost of the request (if available)
Development
# Install dependencies
bun install
# Build
bun run build
# Test locally
bun run dist/index.js