NxtSoftLabs
CGRAPH DOCS — CONTENTS
CGRAPH

Quick Start

This walks from a built checkout to an agent that can query your graph. If you have not built the tools yet, start with Installation.

Build a graph

extract
build/default/src/cli/cgraph --root . --out cgraph-out

--root is the source tree to scan; --out is where the graph and its exports are written.

cgraph [--root PATH] [--out PATH]
FlagMeaning
--rootSource tree to scan (defaults to the current directory).
--outDirectory for the graph and exports.

Run the daemon

Keep the graph warm so queries don't re-scan the tree:

serve
build/default/src/daemon/graphd --root .

The daemon accepts --idle-timeout SECONDS and --no-watch if you want to bound its lifetime or disable file watching.

Register with a coding agent

Expose the graph over MCP. For Claude Code, point the MCP server at the built binary:

register
claude mcp add cgraph -- "$PWD/build/default/src/mcp/cgraph-mcp"
Tip

Use the absolute path to cgraph-mcp unless the binary is on your PATH.

What the agent can do

Once registered, the agent has eight tools over the graph:

  • graph_query, graph_explain, graph_impact, graph_path, graph_context
  • graph_update, graph_status, graph_shutdown

See MCP Integration for what each tool does.