Skip to content

MCP get_neighbors can resolve an exact node ID to a different file node #5343

Open

Description

@KimiK1983

Environment

Graphify 0.9.112, Python 3.12, Ubuntu, MCP over stdio.

Minimal reproduction

Use this synthetic graph as graph.json and start graphify-mcp --graph graph.json.

{
  "directed": true,
  "multigraph": true,
  "nodes": [
    {"id": "docs_example_skill_skill", "label": "example-skill/SKILL.md", "source_file": "docs/example-skill/SKILL.md", "source_location": "L1"},
    {"id": "docs_example-skill_SKILL.md", "label": "example-skill/SKILL.md", "source_file": "docs/example-skill/SKILL.md"}
  ],
  "links": [
    {"source": "docs_example-skill_SKILL.md", "target": "docs_example-skill_SKILL.md", "relation": "references", "confidence": "EXTRACTED", "source_file": "docs/example-skill/SKILL.md"}
  ]
}
  1. Call get_node({"node_id":"docs_example-skill_SKILL.md"}).
  2. Call get_neighbors({"node_id":"docs_example-skill_SKILL.md","relation_filter":"references","token_budget":4000}).

Actual. get_node returns docs_example_skill_skill and get_neighbors returns no matching relationship.

Expected. The literal ID selects docs_example-skill_SKILL.md and its references self-loop appears in get_neighbors. The shared label remains ambiguous when used as a label.

Cause and verification

The literal ID and the source path produce the same normalized tokens. The shared resolver selects the source-path tier first, which prefers the file node. Checking graph membership for the literal ID before ranking resolves the collision. The synthetic regression fails on the original release and passes with the fix.

Activity

  1. github-actions commented on Nov 19, 2026

    @github-actions

    Thanks for opening this issue, @KimiK1983. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  2. ayushcodes10 commented on Nov 22, 2026

    @ayushcodes10
    Contributor

    This looks already fixed and shipped: PR #5344 (93b4c54, landed in 0.9.113) addresses exactly this symptom per safishamsi's comment there. The PR was closed without a formal merge (cherry-picked directly), so the commit message never referenced this issue number and it stayed open. Might be safe to close if the maintainers confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions