LearnNewsExamplesServices
Frontmatter
id9670
titleFix MCP server path resolution dependencies on process.cwd()
stateClosed
labels
bugai
assigneestobiu
createdAtApr 4, 2026, 1:29 AM
updatedAtApr 4, 2026, 1:32 AM
githubUrlhttps://github.com/neomjs/neo/issues/9670
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 4, 2026, 1:32 AM

Fix MCP server path resolution dependencies on process.cwd()

Closedbugai
tobiu
tobiu commented on Apr 4, 2026, 1:29 AM

When spawning MCP node servers (like knowledge-base and memory-core) from external tools, process.cwd() evaluates to the runner's working directory rather than the Neo.mjs repository root.

This causes silent failures, specifically causing the knowledge-base synchronization to extract 0 chunks because it incorrectly looks for the src folder inside the runner's working directory.

Resolution: Replace all instances of process.cwd() inside the MCP servers with a deterministic absolute path computed relative to the running module's location (neoRootDir), ensuring consistent file resolution regardless of how the script is executed.

tobiu added the bug label on Apr 4, 2026, 1:29 AM
tobiu added the ai label on Apr 4, 2026, 1:29 AM
tobiu assigned to @tobiu on Apr 4, 2026, 1:29 AM
tobiu referenced in commit ad8f6bc - "fix(mcp): Ensure stable path resolution independent of runner's cwd (#9670)" on Apr 4, 2026, 1:31 AM
tobiu closed this issue on Apr 4, 2026, 1:32 AM