Graphify Knowledge Graph & MCP Skill
graphify is an on-device, deterministic codebase analysis engine powered by Tree-sitter AST parsing. It converts source code, SQL schemas, documentation, and metadata into a queryable Knowledge Graph (graph.json) and visualization (graph.html).
🚀 Core Capabilities
- Deterministic AST Parsing: Maps actual code relationships (function calls, class inheritance, module imports, schema keys) rather than relying solely on semantic vector search.
- Persistent Knowledge Graph: Generates
/output/graphify/graph.jsonand a human-readable/output/graphify/GRAPH_REPORT.md. - Interactive Graph Inspector: Inspect current graph nodes, edges, complexity metrics, or switch context between multiple indexed targets in
/output/graphify/. - MCP Server Integration: Exposes tools for AI assistants (
query_graph,get_node,get_neighbors,shortest_path).
🛠️ CLI Commands & Usage
1. Auto-Installation & Setup
If graphify is not yet installed on the system, run:
uv tool install "graphifyy[mcp]"
# or
pipx install "graphifyy[mcp]"
2. Generating a Knowledge Graph
To index the current workspace and save results into /output/graphify/:
uv tool run --from "graphifyy[mcp]" graphify . --output-dir ./output/graphify
3. Graph Inspector & State Switcher
To inspect active graph status or list indexed graphs:
# Check if active graph exists
Test-Path ./output/graphify/graph.json
# Read graph summary report
Get-Content ./output/graphify/GRAPH_REPORT.md -Head 50
4. Running the MCP Server
To launch the Graphify MCP server on port 7812:
uv tool run --from "graphifyy[mcp]" graphify mcp serve --port 7812
🔌 Exposed MCP Tools
When the Graphify MCP Server is running, agents can utilize the following tools:
| Tool | Purpose | Example Query |
|---|---|---|
query_graph |
Search nodes & relationships matching keywords or queries | query_graph("authentication flow") |
get_node |
Retrieve complete details of a specific function, class, or file node | get_node("script.js:initApp") |
get_neighbors |
List upstream/downstream callers & imports of a node | get_neighbors("AGENTS.md") |
shortest_path |
Find dependency path between two components | shortest_path("index.html", "graphify") |
📁 Output & Obsidian Vault Integration
All deliverables are saved under /output/graphify/ in compliance with SkillForge project guardrails:
GRAPH_REPORT.md: Markdown summary containing frontmatter metadata and Obsidian Wikilinks ([[Note Title]]).graph.html: Standalone D3/Vis.js interactive web graph viewer.graph.json: Structural JSON representation for programmatic agent context.
🛡️ Fallback & Recovery Protocol
If graphifyy fails to run or encounters syntax errors on unsupported languages:
- Fall back to standard AST parsing or structural
ripgrep(grep_search). - Log error details to
/output/graphify/error.log. - Notify user and offer automatic re-installation via
uv tool install --force "graphifyy[mcp]".