NetworkX Graph MCP Server
Supports exporting and importing state graphs in YAML format for human-readable configuration and data storage.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@NetworkX Graph MCP Server create a decision graph for user authentication flow"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NetworkX Graph MCP Server
State/decision graph MCP server using NetworkX. Supports directed graphs (cycles allowed), explicit edge ordering, conditional branches, import/export, and visualization.
Setup
cd ~/Documents/networkx-graph-mcp-server
uv venv
source .venv/bin/activate
uv syncMCP client config (example)
Add to your mcp_config.json:
{
"mcpServers": {
"networkx-graph": {
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "~/Documents/networkx-graph-mcp-server/.venv/bin/python",
"args": ["-m", "networkx_graph"]
}
}
}Tools (summary)
Graph: create_state_graph, delete_state_graph, list_state_graphs, get_state_graph_info
Nodes: add_node, update_node, remove_node, get_node, list_nodes
Edges: add_edge, remove_edge, get_edges, set_edge_order, set_edge_condition, get_node_edges
Bulk: bulk_add_nodes, bulk_add_edges
Export/Visualize: export_graph (yaml/json), import_graph, visualize_graph (PNG)
Analysis: validate_graph (warnings only, cycles allowed), get_graph_stats, find_path
Web Visualization
Interactive web browser for visualizing graphs:
uv run app.pyThen open your browser to: http://localhost:5000
Features:
Load YAML/JSON graph files via file upload
Interactive graph visualization with zoom, pan, and node selection
View node details, statistics, and graph structure
Color-coded nodes by type (action, decision, verification, loop, success, failure)
Available Tools
24 toolsadd_edgeC
Add an edge with order and optional condition.
Inputs: graph_id (required), from (required), to (required), order, +2 more.
add_nodeC
Add a node (action/decision/verification/loop/success/failure).
Inputs: graph_id (required), node_id (required), node_type (required), label, +3 more.
bulk_add_edgesC
Add multiple edges at once (with order/condition).
Inputs: graph_id (required), edges (required).
bulk_add_nodesB
Add multiple nodes at once (parents before children).
Inputs: graph_id (required), nodes (required).
create_state_graphC
Create a new state/decision graph (directed, cycles allowed).
Inputs: graph_id (required).
delete_state_graphC
Delete a state graph.
Inputs: graph_id (required).
export_graphC
Export graph to YAML or JSON file.
Inputs: graph_id (required), format, output_dir, filename.
find_pathC
Find shortest path between two nodes.
Inputs: graph_id (required), from (required), to (required).
get_edgesC
Get edges (optionally filter by node).
Inputs: graph_id (required), node_id.
get_execution_sequenceA
Get nodes in execution order from a start node, following edges by order attribute. Stops at first decision node by default. Returns sequence of nodes with their details.
Inputs: graph_id (required), from (required), until_decision.
get_graph_statsC
Get statistics: node counts by type, edges, phases, decision points, loops.
Inputs: graph_id (required).
get_nodeD
Get node details.
Inputs: graph_id (required), node_id (required).
get_node_edgesC
Get incoming/outgoing edges for a node.
Inputs: graph_id (required), node_id (required).
get_state_graph_infoC
Get graph metadata and stats.
Inputs: graph_id (required).
import_graphC
Import graph from YAML or JSON file.
Inputs: graph_id (required), path (required).
list_nodesD
List all nodes.
Inputs: graph_id (required).
list_state_graphsB
List all available state graph files on disk (memory resets each session, so this scans for YAML/JSON files in graphs directories). Returns file paths that can be imported.
Inputs: directory.
remove_edgeD
Remove an edge.
Inputs: graph_id (required), from (required), to (required).
remove_nodeD
Remove a node.
Inputs: graph_id (required), node_id (required).
set_edge_conditionC
Set condition label for an edge.
Inputs: graph_id (required), from (required), to (required), condition.
set_edge_orderC
Set execution order for an edge.
Inputs: graph_id (required), from (required), to (required), order (required).
update_nodeC
Update node properties (label, phase, tool, properties).
Inputs: graph_id (required), node_id (required), label, phase, +2 more.
validate_graphC
Validate graph structure (cycles allowed, warnings only).
Inputs: graph_id (required).
visualize_graphB
Render graph to PNG file (saves to disk, not base64).
Inputs: graph_id (required), layout, output_dir, filename, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Most tools have distinct purposes, such as add_edge vs. add_node or get_edges vs. get_node_edges, but some overlap exists, like get_graph_stats and get_state_graph_info both providing statistical insights, which could cause mild confusion. The descriptions generally clarify differences, but the overlap in statistical tools is noticeable.
Tool names follow a consistent verb_noun pattern throughout, such as add_edge, remove_node, and validate_graph, with no deviations in style or convention. This predictability makes it easy for agents to understand and use the tool set without naming confusion.
With 24 tools, the count is borderline high for a graph management server, as it includes many specific operations like set_edge_condition and visualize_graph that might be consolidated. While comprehensive, it feels slightly heavy compared to typical well-scoped sets of 3-15 tools, potentially overwhelming for agents.
The tool set provides complete CRUD/lifecycle coverage for graph management, including creation (create_state_graph), reading (get_node, list_nodes), updating (update_node, set_edge_order), deletion (delete_state_graph, remove_node), and additional utilities like import/export, validation, and visualization. No obvious gaps exist for the domain.
Related MCP Connectors
Create and manage Mermaid.js flowcharts and diagrams with AI agents via MCP.
Design, save, and run outcome-aligned AI workflows and verifiers, with reliable image output.
Flowcharts that people and agents edit together on one live canvas, exported as Mermaid.
Live, editable canvas for AI agents — author graphs via MCP, then watch and reroute runs live.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI agents to create, manipulate, and manage BPMN 2.0 diagrams programmatically, with support for Mermaid conversion, auto-layout, and file persistence.2414MIT
- AlicenseNot gradedqualityDmaintenanceEnables creating, manipulating, and managing Mermaid diagrams with automatic saving and multi-format conversion from JSON, CSV, Python, Markdown, and plain text.9MIT
- AlicenseCqualityFmaintenanceComprehensive Model Context Protocol server for advanced graph analysis using NetworkX, enabling graph creation, manipulation, and algorithm execution through natural language.4622MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to create, edit, and export flowcharts through a local web-based editor with visual drag-and-drop, real-time sync, and 14 MCP tools for full node/edge CRUD.2Apache 2.0