Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

mcp: a projectPath naming a file inside a project returns isError ("Path is not a directory")

オープン 初心者向け
#2,982 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@maxmilian がすでに取り組んでいます。

2026年10月29日 から。

  • #2996 @maxmilian による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript
領域
devtools, tooling

調査の方向性

src/mcp/tools.ts の 2355 行目付近から始めてください。ここで codegraph_status が validateProjectPath を呼び出します。次に src/utils.ts の 218 行目付近を読み、"Path is not a directory" を生成するディレクトリチェックを確認してください。その分岐を、すでに .codegraph/ までさかのぼる存在しないパスの分岐と比較してください。それが、既存のファイルに対してその親ディレクトリを使って再利用すべき動作です。codegraph_status がファイルパスを指定して isError なしでプロジェクトステータスを返し、ファイルパスと存在しないパスの両方をカバーするテストがある状態で完了です。

索引モデルが issue の本文から書いたものです。

説明

A projectPath that names a file inside an indexed project is refused with isError: true ("Path is not a directory"), while a path that doesn't exist at all resolves fine.

call result on main
codegraph_status {"projectPath": "<proj>/src/a.ts"} isError: true, "Error: Path is not a directory: …/src/a.ts"
codegraph_status {"projectPath": "<proj>/no/such/dir"} success: the project's status (walks up to .codegraph/)

Cause. mcp/tools.ts#L2355 runs validateProjectPath on an existing path, which returns "Path is not a directory" (utils.ts#L218). That error is surfaced like a path refusal: isError, with no guidance.

Reproduced on main at 77ee3484 (serve --mcp over stdio, Linux/WSL2, Node 22.23.2).

Why it matters. Passing the file it's looking at as projectPath is an easy agent mistake, and AGENTS.md reserves isError for "stop trying" cases ("Errors teach abandonment"). A file path inside a project is recoverable.

Expected. For an existing file, use its directory and walk up to .codegraph/ as for any other path inside the project. Or at least return a success-shaped hint ("projectPath should be the project directory; using

").

主要言語
C
スター
73.2k
フォーク
4.7k
平均マージ
3時間 13分
マージ済み PR(30日)
579

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

colbymchenry/codegraph のほかの issue

colbymchenry/codegraph の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。