Expand description
MCP server for graph queries.
Provides graph traversal and scoring functions used by the query engine and MCP protocol server. Port of Python query tools.
Modules§
- mcp
- MCP (Model Context Protocol) server implementation.
- search
- In-memory inverted index for fast node lookup.
Enums§
- Serve
Error - Errors from the server.
- Summary
Level - Abstraction level for graph summaries.
Functions§
- all_
simple_ paths - Find all simple paths between
sourceandtargetup tomax_lengthedges. - bfs
- BFS traversal from start nodes up to a maximum depth.
- dfs
- DFS traversal from start nodes up to a maximum depth.
- dijkstra_
path - Dijkstra shortest path using edge weights.
- graph_
stats - Get basic statistics about the graph.
- load_
graph - Load a knowledge graph from a JSON file.
- score_
nodes - Score nodes by relevance to search terms using a pre-built SearchIndex.
- smart_
summary - Generate a multi-level graph summary within a token budget.
- start_
server - Start the MCP server over stdio (JSON-RPC 2.0).
- subgraph_
to_ text - Convert a subgraph (set of nodes and edges) to a text representation suitable for LLM context windows.
Type Aliases§
- Edge
Detail - Edge detail in a weighted path: (from_id, to_id, cost, relation).