geminicli-mcp
Stateless MCP server wrapping the headless Gemini CLI.
- stdio transport, spawn-per-client
- two tools:
gemini_prompt,gemini_prompt_with_context - no sessions, no
working_dir, no timeout enforcement - runs in the server process's
cwd
Install
npm install
npm run build
Binary is exposed as geminicli-mcp (see package.json#bin).
Tools
gemini_prompt
| field | type | required | notes |
|---|---|---|---|
| prompt | string | yes | prompt text |
| model | string | no | e.g. gemini-2.5-pro |
Returns the CLI's response text.
gemini_prompt_with_context
| field | type | required | notes |
|---|---|---|---|
| prompt | string | yes | prompt text |
| context | string | yes | prepended to the prompt inside <context> |
| model | string | no | e.g. gemini-2.5-pro |
Returns the CLI's response text.
Env
GEMINI_CLI_BIN— override thegeminibinary path.- Child process env is sanitized with
NO_COLOR=1andTERM=dumb.