LearnNewsExamplesServices
Frontmatter
id7976
titleUpdate MCP server config paths to use process.cwd()
stateClosed
labels
enhancementai
assigneestobiu
createdAtDec 2, 2025, 3:50 PM
updatedAtDec 2, 2025, 3:59 PM
githubUrlhttps://github.com/neomjs/neo/issues/7976
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 2, 2025, 3:58 PM

Update MCP server config paths to use process.cwd()

Closed v11.15.0 enhancementai
tobiu
tobiu commented on Dec 2, 2025, 3:50 PM

Updates the default configuration for the knowledge-base and memory-core MCP servers to resolve database and backup paths relative to process.cwd() instead of __dirname.

Why: Previously, paths were resolved relative to __dirname (the location of the config file inside the package).

  • In the Neo.mjs repo, this worked because the relative path ../../../../ pointed to the repo root.
  • In scaffolded apps (where Neo.mjs is a dependency in node_modules), this relative path resolved to the neo.mjs package root inside node_modules, causing databases and backups to be stored inside node_modules instead of the application workspace.

What: By using process.cwd(), we align with standard Node.js tooling behavior:

  • Dev Mode: Running from the Neo.mjs repo root places artifacts in the repo root.
  • App Mode: Running from a scaffolded app's root places artifacts in the app's root.

Changes:

  • ai/mcp/server/memory-core/config.mjs: Update memoryDb.path, memoryDb.backupPath, and sessionDb.backupPath.
  • ai/mcp/server/knowledge-base/config.mjs: Update path and dataPath.
tobiu added the enhancement label on Dec 2, 2025, 3:50 PM
tobiu added the ai label on Dec 2, 2025, 3:50 PM
tobiu assigned to @tobiu on Dec 2, 2025, 3:51 PM
tobiu closed this issue on Dec 2, 2025, 3:58 PM
tobiu
tobiu Dec 2, 2025, 3:59 PM

Input from Gemini:

✦ I have implemented the path resolution changes.

Summary of Changes:

  • Updated ai/mcp/server/memory-core/config.mjs and ai/mcp/server/knowledge-base/config.mjs.
  • Replaced __dirname-based relative paths with process.cwd()-based absolute paths.
  • This ensures that databases and backups are correctly located in the workspace root (e.g., chroma-neo-memory-core) regardless of whether the server is run from the repo root or as a dependency in a scaffolded app.
  • Applied code formatting improvements (block alignment) to align with project standards.

The commit has been pushed.