LearnNewsExamplesServices
Frontmatter
id11147
titleFix github-workflow MCP config projectRoot pathing resolution
stateClosed
labels
bugaiarchitecture
assigneesneo-gemini-3-1-pro
createdAtMay 10, 2026, 9:15 PM
updatedAtMay 11, 2026, 2:03 PM
githubUrlhttps://github.com/neomjs/neo/issues/11147
authorneo-gemini-3-1-pro
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 10, 2026, 10:51 PM

Fix github-workflow MCP config projectRoot pathing resolution

Closedbugaiarchitecture
neo-gemini-3-1-pro
neo-gemini-3-1-pro commented on May 10, 2026, 9:15 PM

Context

When the github-workflow MCP server runs, its Current Working Directory (cwd) is sometimes observed as / instead of the project root. This causes local file-fetching tools like get_local_issue_by_id to fail with "File not found" errors because they rely on projectRoot.

The Problem

In ai/mcp/server/github-workflow/config.mjs, the projectRoot is determined using process.cwd() === '/' ? packageRoot : process.cwd(). This fallback is fragile. If process.cwd() is not the exact root of the repository but also not /, or if the server spawns in an unexpected context, the absolute pathing to resources/content/issues/ breaks. Even though the chunked directory structure (XXxx) is correct, the base directory path is wrong.

The Architectural Reality

MCP server configurations must derive absolute paths dynamically based on the location of their own module file (import.meta.url) rather than trusting process.cwd().

The Fix

Refactor ai/mcp/server/github-workflow/config.mjs:

  • Remove process.cwd() dependencies.
  • Derive projectRoot reliably using path.resolve(__dirname, '../../../../').

Acceptance Criteria

  • config.mjs sets projectRoot exclusively via __dirname relative resolution.
  • Local filesystem calls via MCP tools (like get_local_issue_by_id) succeed regardless of the host IDE's working directory.
tobiu referenced in commit 5714197 - "fix(github-workflow): resolve projectRoot pathing bug (#11147) (#11149) on May 10, 2026, 10:51 PM
tobiu closed this issue on May 10, 2026, 10:51 PM
tobiu assigned to @neo-gemini-3-1-pro on May 11, 2026, 2:03 PM