MCP server: silent wrong matches on ambiguous/near-miss names, noisy query_graph, misleading list_prs error

已关闭
#3,917 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@nothariharan 已经在做这个了。

开始于 2026年10月21日。

  • #4618 来自 @nothariharan —— 未关闭

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
php, python, symfony

调研方向

Start by reproducing the listed calls against the explicit graph.json, then trace the MCP tool entry points get_node, query_graph, get_community, list_prs, get_pr_impact, and get_neighbors. Done means ambiguous and non-exact labels are explicit, graph results are relevance-aware, communities are labelled, repository errors explain repo=, and neighbor truncation preserves incoming edges.

由索引模型根据 Issue 内容生成。

描述

Version: graphifyy 0.9.71 (installed via uv tool), graphify-mcp over stdio, started with an explicit graph.json path.
Codebase: PHP / Symfony bundle, ~11k nodes / ~33k edges, 614 communities.

1. get_node silently picks one match for an ambiguous name

  • Steps: get_node(label="edit") on a graph where several classes define edit().
  • Actual: returns a single node (Controller/VisitController.php L427) with no hint that other candidates exist.
  • Expected: a list of the candidates (path + line), or an explicit "ambiguous, N matches" error. The caller can't tell whether the answer is the right edit().

2. get_node silently resolves a non-existent name to a different node

  • Steps: get_node(label="MailController") when no MailController exists in the codebase.
  • Actual: returns EmailController as if it were an exact match.
  • Expected: "no exact match", optionally followed by fuzzy suggestions clearly labelled as such.

Side note: the path::symbol form works (Controller/VisitController.php::edit → found). get_node(node_id=...) does not find a generated-looking id for a non-existent symbol, which is correct.

3. query_graph is dominated by god nodes

  • Steps: query_graph(question="who sends the convocation emails?"), default depth 3.
  • Actual: BFS starts from 5 seeds and reaches 2,708 nodes. The output is TRUNCATED and mostly made of the highest-degree nodes (framework interfaces, core entities, enums). With token_budget=8000 it is still truncated (240 of 2,708). With context_filter=['call'] only 20 nodes remain, all unrelated test helpers.
  • Expected: rank results by relevance or distance to the seeds rather than degree, or damp hubs during traversal (similar to exclude_hubs_percentile in god_nodes).

4. get_community returns no community label

get_community(3) returns "Community 3 (205 nodes)" with no name or summary. A generated label (e.g. dominant class or directory) would make the output usable.

5. list_prs reports "gh CLI not found" when the real issue is repo detection

  • Steps: list_prs() with no repo argument, the server started on a graph.json outside any git repo.
  • Actual: Error: gh CLI not found or not authenticated. Run: gh auth login. gh is installed and authenticated. Passing repo=owner/name makes it work. get_pr_impact with the same repo works too.
  • Expected: an error such as "could not detect repository; pass repo=".

6. Minor: get_neighbors truncation hides incoming edges

With the default budget, outgoing edges are listed first, so all incoming edges (callers) are cut off on high-degree nodes. Listing incoming edges first, or balancing both directions, would help.

主要语言
Python
星标
124k
派生
11.9k
平均合并
2 小时 35 分钟
30 天内合并 PR
6

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Graphify-Labs/graphify 的其他 Issue

查看 Graphify-Labs/graphify 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。