An MCP server: let AI agents review the graph changes they make

Open
#13 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
node.js, typescript

Research direction

Read the CLI pipeline in packages/cli/src/inputs.ts, packages/cli/src/diff-command.ts, and packages/cli/src/markdown.ts to see which functions the MCP server can reuse. Start by tracing how readPair and runDiff pass parsed inputs into renderMarkdown. Done means an @kgdiff/mcp stdio server handles the specified tools and example datasets, with a guide page in both languages, a client config snippet, and a changeset.

Written by the indexing model from the issue text.

Description

enhancement help wanted integrations
Why

kgdiff exists because AI systems now write knowledge graphs: GraphRAG pipelines, agent
memories, ontology assistants. The agent doing the writing is also the first reviewer it could
have. With a Model Context Protocol server, an agent in
Claude Code, Cursor or any MCP client could diff the graph before and after its own edit and
show the human a summary that names merges, moves and renames, instead of a wall of triples.

What

A small @kgdiff/mcp package (stdio transport), read-only to start with:

  • diff_graphs: before and after (file paths, or inline text with a format), plus the
    main diff options (match, threshold, hierarchy, ignore_attrs). Returns the same
    Markdown as kgdiff --markdown and the counts, with a hunk limit so a large diff does not
    flood the context window.
  • write_report: the same inputs, writes the interactive HTML report (-o report.html) and
    returns its path, for when a human should look.
  • Perhaps later: list_changes with filters (kind, node), and apply_delta. Discuss before
    adding anything that writes.

Safety: paths resolve against the client's roots or the working directory, inputs keep the
CLI's size limit (KGDIFF_MAX_INPUT), and nothing is fetched from the network.

Where to start
  • The CLI pipeline already does each step: readPair / parseInput in
    packages/cli/src/inputs.ts (gzip, encodings, size limits), runDiff in
    packages/cli/src/diff-command.ts, renderMarkdown in packages/cli/src/markdown.ts. The MCP
    server should reuse these rather than copy them, which may mean exporting a few of them.
  • CONTRIBUTING asks for a short justification for any new runtime dependency: the MCP SDK is
    one, so say which and why in the PR.
Done when
  • npx @kgdiff/mcp starts a server that an MCP client can call on the example datasets.
  • A guide page ("Review an agent's graph edits") with a config snippet for at least one client,
    in both languages, and a changeset.
Dominant language
TypeScript
Stars
47
Forks
6
Avg merge
2h 32m
Merged PRs (30d)
22

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from iiwish/kgdiff

All issues in iiwish/kgdiff

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.