Skip to content

Performance: Resolve slow startup time (8-12 seconds) for Gemini CLI when using slow MCP servers #4544

Closed
3 of 3 issues completed

Description

@wildcatDownstairs

What happened?

When I launch the gemini-cli from my terminal, there is a significant delay of approximately 8 to 12 seconds before the tool becomes responsive and ready for use. This happens every time I start the application.

OS: [ x64 Windows 11, version 24H2]
Terminal: [cmd]
gemini-cli version: [v0.1.13]

2025-07-20.182430.mp4

What did you expect to happen?

I expected the command-line interface to launch almost instantly, or at least with a much shorter delay (e.g., under 2 seconds). A quick startup is typical for most CLI tools and would lead to a more fluid and efficient user experience.

Client information

Details
$ gemini /about
# paste output here

Proposed solution

Proposed feature to solve this:

Stop MCP server init from blocking startup but continue to have it block submission of first prompt sent to Gemini CLI that talks to the model.
Do not have MCP server init block tool calls to recognized tools. Tool calls to unknown tools should ideally wait until the MCP servers are initialized so the full list of MCP tools is known.
When we are waiting after submitting a prompt due to slow MCP server startup, the status message should show "Waiting for MCP servers to load..." rather than a clever phrase.
Do not block UI startup reading folders at startup. Same as for MCP, reading folders should not block typing in the input prompt but the first input prompt should not get sent to the model until all folders are read.

Running the /mcp command should show the current status of mcp server loading if MCP servers are being initialized. Ideally it would show as a dialog that updated as the MCP servers loaded but it would be acceptable if it just showed the current state and surfaced a message in the chat once all tools loaded.

Activity

  1. added
    area/coreIssues related to User Interface, OS Support, Core Functionality
    priority/p2Important but can be addressed in a future release.
    and removed
    status/need-triageIssues that need to be triaged by the triage automation.
    on Jul 20, 2025
  2. Manamama commented on Jul 21, 2025

    @Manamama

    Many MCPs that call home. Today I decided to remove half of the lot for the same reason. The worst on mobile (slow) connections. Check for the npx ones that use online servers.

  3. helalsoft commented on Aug 17, 2025

    @helalsoft

    No MCP, still this slow.

  4. added
    priority/p1Important and should be addressed in the near term.
    and removed
    priority/p2Important but can be addressed in a future release.
    on Aug 27, 2025
  5. jacob314 commented on Aug 27, 2025

    @jacob314
    Contributor

    We should not be blocking startup while MCP servers initialize. MCP servers should be initialized in the background. For discussion: should we block issuing prompts in Gemini CLI while MCP servers initialize.

  6. NTaylorMullen commented on Aug 27, 2025

    @NTaylorMullen
    Collaborator

    Goal here would be to bootup immediately but upon first prompt block if needed

  7. jacob314 commented on Aug 28, 2025

    @jacob314
    Contributor

    Moving this text to the main issue description for clarity.

  8. 6 remaining items

  9. changed the title [-]Performance: Resolve slow startup time (8-12 seconds) for Gemini CLI[/-] [+]Performance: Resolve slow startup time (8-12 seconds) for Gemini CLI when using slow MCP servers[/+] on Aug 28, 2025
  10. jakemac53 commented on Aug 29, 2025

    @jakemac53
    Contributor

    One question, which is also related to adding support for tool update notifications:

    Do we know how tool definitions affect input token caching? Presumably, they might completely invalidate the cache causing the next request to be more expensive once the MCP tools are loaded?

    If this is the case, is this something we should try and optimize around or just accept it? Most likely, the context won't be super large by the time the MCP servers do load anyways, so the cost of invalidating the context should hopefully be small. One exception would be if somebody resumes a previous chat that already has lots of context.

  11. jakemac53 commented on Aug 29, 2025

    @jakemac53
    Contributor

    Oh, I missed the part about blocking the first prompt until the tools are all loaded. That would resolve the issue around context cache churn (although it's worth chatting about when we go to implement tool list updates).

  12. self-assigned this
    on Sep 2, 2025
  13. scidomino commented on Sep 2, 2025

    @scidomino
    Collaborator

    One difficulty will be not breaking oauth support which currently assumes you're not operating in react.

  14. gennaro-tedesco commented on Oct 3, 2025

    @gennaro-tedesco

    Just to add some more context to the benchmarks: I have used hyperfine on a macOs Tahoe with wezterm and have measure the following:

    hyperfine -i gemini
    Benchmark 1: gemini
      Time (mean ± σ):     34.091 s ± 94.840 s    [User: 2.040 s, System: 0.578 s]
      Range (min … max):    3.385 s … 303.987 s    10 runs

    for the first measurement, and

    ❯ hyperfine -i gemini
    Benchmark 1: gemini
      Time (mean ± σ):      5.260 s ±  5.119 s    [User: 2.290 s, System: 0.665 s]
      Range (min … max):    3.296 s … 19.799 s    10 runs
    
      Warning: The first benchmarking run for this command was significantly slower than the rest (19.799 s). This could be caused by (filesystem) caches that were not filled until after the first run. You should consider using the '--warmup' option to fill those caches before the actual benchmark. Alternatively, use the '--prepare' option to clear the caches before each timing run.

    for the second; notice the warning that the first runs take longer, which is in line with the experience that after starting up gemini a few times, the start-up is much faster. Probably some caching that takes much longer to initialise in the beginning (namely, it is the caching and loading mechanism that needs to be fixed).

    No mcp servers are configured, which excludes anything in that direction.

  15. scidomino commented on Oct 3, 2025

    @scidomino
    Collaborator

    To be clear, this issue was specifically about MCP servers and not general slowness starting up. I believe that's being addressed elsewhere.

  16. gennaro-tedesco commented on Nov 2, 2025

    @gennaro-tedesco

    To be clear, this issue was specifically about MCP servers and not general slowness starting up. I believe that's being addressed elsewhere.

    could you help and share what other relevant issues we might follow for such a topic? I have seen that the subject has indeed been addressed in some other discussions but it has always been shaken off as related to MCP, when on the other hand the general slow start-up is independent of them and still persists after many releases.

  17. sascharo commented on Dec 15, 2025

    @sascharo

    No MCP, still this slow.

    Same here. I have no MCP servers set up either and gemini still takes easily over one minute. Even gemini --help takes the same amount of time. codex and claude start up immediately in the same project and file system.

    On my machine gemini has a creepingly slow startup time in WSL Linux Bash, in a native PowerShell the startup time isn't noticeable.

  18. scidomino commented on Dec 15, 2025

    @scidomino
    Collaborator

    @sascharo please open a new bug for WSL.

  19. sascharo commented on Dec 16, 2025

    @sascharo

    @sascharo please open a new bug for WSL.

    #15140

  20. Super1Windcloud commented on Dec 29, 2025

    @Super1Windcloud
  21. HumanBot000 commented on Feb 21, 2026

    @HumanBot000

    Same issue, easily a minute startup time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/coreIssues related to User Interface, OS Support, Core Functionalitypriority/p1Important and should be addressed in the near term.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions