fix(env): honor CGC_RUNTIME_DB_PATH env var in _default_global_db_path to fix MCP start failure#1295
Open
TranscendenceLiang wants to merge 1 commit into
Open
Conversation
The MCP server resolves its DB path via _default_global_db_path,
which only consulted FALKORDB_PATH for falkordb and otherwise
hardcoded the default under CONFIG_DIR. On Windows machines
where CONFIG_DIR contains non-ASCII characters (e.g. C:\Users\<name>\),
this crashes KuzuDB with a path encoding error:
RuntimeError: IO exception: Cannot open file.
path: C:\Users\<name>\.codegraphcontext\global\db\kuzudb
By checking CGC_RUNTIME_DB_PATH first (matches what cgc index and
cgc stats already honor via _initialize_services), the MCP server
uses the same relocated path and stays consistent with the CLI.
|
@TranscendenceLiang is attempting to deploy a commit to the shashankss1205's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The KuzuDB C++ engine cannot handle paths with non-ASCII characters, mirroring the same Windows limitation that already affects the LadybugDB engine in GitNexus.
Root cause
The MCP server resolves its database path via
_default_global_db_path(), which:FALKORDB_PATHfor the falkordb backend.CONFIG_DIR / "global" / "db" / <backend>, whereCONFIG_DIRdefaults to~/.codegraphcontext(i.e.C:\Users\<name>\.codegraphcontexton Windows).Meanwhile, the CLI commands (
cgc index,cgc stats) already honoredCGC_RUNTIME_DB_PATHin_initialize_services()as the highest-priority override. The MCP server simply didn't check it, so even users who had relocated the DB via.envsaw MCP crash on the default Chinese path.Fix
Read
CGC_RUNTIME_DB_PATHfirst in_default_global_db_path(), before any backend-specific lookup. This keeps the MCP server consistent with the CLI's existing resolution order.