MCP Server
FreshOverview
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
/graphify . --mcpBuilds the graph and immediately starts an MCP stdio server.
From Existing Graph
python -m graphify.serve graphify-out/graph.jsonStarts the MCP server from an already-built graph without rebuilding.
What the MCP Server Exposes
The server exposes the following tools:
| Tool | Description |
|---|---|
graphify_query | Semantic search across the graph |
graphify_path | Find shortest path between two nodes |
graphify_explain | Get full details about a specific node |
graphify_report | Return the full GRAPH_REPORT.md content |
graphify_nodes | List all nodes with optional community filter |
Connecting to Claude Desktop (MCP Config)
Add to your Claude Desktop claude_desktop_config.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:
- Start the server:
python -m graphify.serve graphify-out/graph.json - Configure your tool to connect via stdio
- 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.