Skip to content

MCP Server

Fresh

Overview

Graphify can expose your knowledge graph as a Model Context Protocol (MCP) server, making it available to any tool that supports MCP tool-calling.

Starting the MCP Server

Via CLI Flag

bash
/graphify . --mcp

Builds the graph and immediately starts an MCP stdio server.

From Existing Graph

bash
python -m graphify.serve graphify-out/graph.json

Starts the MCP server from an already-built graph without rebuilding.

What the MCP Server Exposes

The server exposes the following tools:

ToolDescription
graphify_querySemantic search across the graph
graphify_pathFind shortest path between two nodes
graphify_explainGet full details about a specific node
graphify_reportReturn the full GRAPH_REPORT.md content
graphify_nodesList all nodes with optional community filter

Connecting to Claude Desktop (MCP Config)

Add to your Claude Desktop claude_desktop_config.json:

json
{
  "mcpServers": {
    "graphify": {
      "command": "python",
      "args": ["-m", "graphify.serve", "/path/to/your/project/graphify-out/graph.json"]
    }
  }
}

Connecting to Other MCP-Compatible Tools

The server speaks standard MCP stdio. Any tool that supports MCP can connect:

  1. Start the server: python -m graphify.serve graphify-out/graph.json
  2. Configure your tool to connect via stdio
  3. The tool will see the four exposed tools

Use Cases

flowchart LR
    A[Claude Desktop] --> MCP[Graphify MCP Server]
    B[Other MCP Tool] --> MCP
    MCP --> G[graph.json]
    G --> Q[Query Results]
    G --> P[Path Results]
    G --> E[Explain Results]

Repeated Queries Without Reprocessing

The MCP server loads the graph once and serves queries from memory. This is significantly faster than running /graphify query for each question — useful for interactive sessions where you'll ask many questions about the same codebase.

Multi-Tool Access

Multiple tools can connect to the same MCP server simultaneously, all reading from the same graph.json.

Stopping the Server

The server runs until you stop it with Ctrl+C.

Port and Transport

The MCP server uses stdio transport by default. No port is opened. Communication happens through stdin/stdout with the connecting tool.