Serena MCP server hangs at "Parsing all gitignore files" when project contains a large venv
Serena MCP server 0.1.3 hangs during initialization when I run it in a Python project that contains a large virtual environment, on WSL2 with an NTFS mount at /mnt/c/. The process stops at the "Parsing all gitignore files" log line and never progresses. I start the server with
uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context ide-assistant --project $(pwd)from the project root. Is there a workaround or a fix?Originally asked on GitHub: https://github.com/oraios/serena/issues/470
4 answers
Closed as completed. A maintainer noted in comment 2 that with PR #510, directories ignored by higher-level
.gitignorefiles will no longer be traversed. The thread does not explicitly confirm that this change resolved the reported hang, and the reporter's root-cause speculation (a recursive**/.gitignoreglob plusfollowlinks=Truetraversal) was never confirmed by a maintainer.While the bug was open, the reporter confirmed two workarounds for Serena 0.1.3 on WSL2 (NTFS mount at
/mnt/c/):- Delete the virtual environment directories outright — the server initialized immediately afterwards.
- Recreate fresh, minimal virtual environments in their place — Serena worked again in the same project.
As general advice, if you still hit this on 0.1.3 today: make sure the venv is listed in
.gitignore, use one of the two workarounds above as a stopgap, and check whether your Serena version includes PR #510 so the ignored venv directory is not traversed during startup.Did this work for you?What a GitHub user tried on GitHub (Worked)
Deleted the virtual environment directories from the failing project. The reporter confirmed the server initialized immediately afterwards.
Source: https://github.com/oraios/serena/issues/470 (opens external site)
Did this work for you?What a GitHub user tried on GitHub (Worked)
Recreated fresh, minimal virtual environments in place of the old ones. The reporter confirmed Serena worked again in the same directory.
Source: https://github.com/oraios/serena/issues/470 (opens external site)
Did this work for you?What @opcode81 tried on GitHub (Outcome unclear)
A maintainer commented that with PR #510, directories ignored by higher-level
.gitignorefiles will no longer be traversed. The thread does not state whether this change was verified against the reported hang.Source: https://github.com/oraios/serena/issues/470#issuecomment-3212017214 (opens external site)
Did this work for you?
Related questions
- Serena MCP server SSE mode: dynamic client registration fails with HTTP 404
- Serena C# language server download fails: missing BuildHost.runtimeconfig.json on Windows
- Serena MCP server fails to connect in Claude Code after installing with uvx
- Serena replace_symbol_body duplicates code in Claude Code — how to disable it?
- Serena MCP: ruby-lsp fails to start with 'command not found' or initialization errors, how to fix?