How to fix gemini-mcp-tool ask-gemini timeouts on large codebases?
When using gemini-mcp-tool's ask-gemini tool in Claude on a large codebase, calls time out because the 5-minute timeout is hardcoded in the MCP tool source (src/tools/ask-gemini.tool.ts), not configurable from the client. Is there a way to make the timeout configurable, for example via Claude Code's MCP_TIMEOUT environment variable? Reported in July 2025 for gemini-mcp-tool 1.1.x.
Originally asked on GitHub: https://github.com/jamubc/gemini-mcp-tool/issues/5
3 answers
Fixed. The maintainer removed the hardcoded timeout in version 1.1.2 and stated that versions 1.1.3 through 1.1.5 resolve this issue; the issue was closed as completed.
Update your gemini-mcp-tool install to 1.1.3 or later (1.1.5 per the maintainer's closing comment). In 1.1.2 the hardcoded timeout was removed and an automatic fallback to the flash model was added, so slow codebase analyses no longer hit a fixed 5-minute ceiling.
One thing that does NOT work on older versions: adding a longer client-side timeout such as
timeout: 600000(10 minutes) to themcp__gemini-cli__ask-geminifunction call. A commenter suggested this, but the reporter checked the tool source and confirmed it cannot work because the timeout value is hardcoded inside the MCP tool itself, overriding anything set on the client side.The maintainer said support for Claude Code's
MCP_TIMEOUTenvironment variable would be implemented in the update after 1.1.2, but the thread does not confirm that it actually shipped. If you plan to rely onMCP_TIMEOUT, check your installed version's documentation or release notes first.Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Ran ask-gemini on a large codebase in Claude and hit the tool's hardcoded 5-minute timeout; asked the maintainer whether the timeout could be made configurable, suggesting Claude Code's MCP_TIMEOUT variable.
Source: https://github.com/jamubc/gemini-mcp-tool/issues/5 (opens external site)
Did this work for you?What @schitizsharma tried on GitHub (Didn't work)
A commenter suggested adding a 10-minute timeout (
timeout: 600000) to themcp__gemini-cli__ask-geminifunction call. The reporter then inspected the MCP tool source and confirmed this cannot work because the timeout is hardcoded inside the tool itself.Source: https://github.com/jamubc/gemini-mcp-tool/issues/5#issuecomment-3058788759 (opens external site)
Did this work for you?
Related questions
- How do I fix "Gemini was thinking but got cut off" with gemini-mcp-tool in Claude Code?
- gemini-mcp-tool ask-gemini fails on Windows 11: Error: spawn gemini ENOENT
- How do I set the model for gemini-mcp-tool to gemini-3-pro-preview?
- Windows: gemini-mcp-tool 'Cannot use both a positional prompt and the --prompt flag'
- gemini-mcp-tool on Windows: spawn gemini ENOENT error in Claude Code