1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//! MCP (Model Context Protocol) Server for God-Graph
//!
//! This module provides an MCP server implementation that exposes God-Graph
//! operations as tools for AI assistants to interact with graph data.
//!
//! ## Features
//!
//! - **Graph Operations**: Create, modify, and query graphs
//! - **Algorithm Execution**: Run PageRank, shortest path, centrality algorithms
//! - **Tensor Operations**: GNN inference, tensor conversions
//! - **Visualization**: Export to DOT/Graphviz format
//!
//! ## Usage
//!
//! ```no_run
//! use god_graph::mcp::McpServer;
//!
//! let mut server = McpServer::new();
//! server.register_graph_tools();
//! server.register_algorithm_tools();
//!
//! // Run server (stdio transport)
//! server.run_stdio().expect("Failed to run server");
//! ```
//!
//! ## Available Tools
//!
//! ### Graph Management
//! - `create_graph`: Create a new graph (directed/undirected)
//! - `add_node`: Add a node to a graph
//! - `add_edge`: Add an edge to a graph
//! - `remove_node`: Remove a node from a graph
//! - `remove_edge`: Remove an edge from a graph
//! - `get_neighbors`: Get neighbors of a node
//! - `get_degree`: Get degree of a node
//!
//! ### Algorithms
//! - `page_rank`: Compute PageRank centrality
//! - `shortest_path`: Find shortest path between nodes
//! - `bfs`: Breadth-first search traversal
//! - `dfs`: Depth-first search traversal
//! - `connected_components`: Find connected components
//!
//! ### Tensor Operations (with `tensor` feature)
//! - `graph_to_tensor`: Convert graph to tensor representation
//! - `gnn_inference`: Run GNN inference on graph
//!
//! ## MCP Protocol
//!
//! The server implements the Model Context Protocol v1.0:
//! - JSON-RPC 2.0 message format
//! - Stdio transport (stdin/stdout)
//! - Tool discovery and execution
//! - Resource exposure (optional)
pub use McpServer;
pub use ToolRegistry;
pub use *;