The first NetworkX integration for Model Context Protocol, enabling graph analysis and visualization directly in AI conversations. Supports 13 operations including centrality algorithms, community detection, PageRank, and graph visualization.
A comprehensive Model Context Protocol (MCP) server providing advanced graph analysis capabilities using NetworkX.
The server follows a clean modular architecture:
โโโ Core Layer # Basic graph operations and MCP server
โโโ Handler Layer # Function organization and re-exports
โโโ Advanced Layer # Specialized algorithms and features
โโโ Supporting Layer # Monitoring, security, and infrastructure
See ARCHITECTURE.md for detailed architectural documentation.
git clone https://github.com/username/networkx-mcp-server.git
cd networkx-mcp-server
pip install -e .
from networkx_mcp.server import create_graph, add_nodes, add_edges
# Create a graph
result = create_graph("my_graph", "undirected")
# Add nodes and edges
add_nodes("my_graph", ["A", "B", "C"])
add_edges("my_graph", [("A", "B"), ("B", "C")])
# Start the MCP server
python -m networkx_mcp
# Or use the development script
./run_tests.sh
The project maintains 80%+ test coverage with comprehensive test suites:
# Run all tests
pytest
# Run with coverage
pytest --cov=src/networkx_mcp --cov-report=html
# Run specific test categories
pytest tests/unit/ # Unit tests
pytest tests/integration/ # Integration tests
pytest tests/performance/ # Performance tests
We welcome contributions! Please see our Development Guide for:
# Install development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Run the test suite
pytest
This project maintains high quality standards:
See pyproject.toml for complete dependency list.
# Build and run with Docker
docker build -t networkx-mcp-server .
docker run -p 8000:8000 networkx-mcp-server
# Deploy to Kubernetes
kubectl apply -f k8s/
See deployment documentation for production deployment guides.
The server is optimized for performance:
Security is a top priority:
Built-in observability features:
networkx-mcp-server/
โโโ src/networkx_mcp/ # Main source code
โ โโโ core/ # Core graph operations
โ โโโ handlers/ # Function handlers
โ โโโ advanced/ # Advanced algorithms
โ โโโ monitoring/ # Monitoring and observability
โ โโโ security/ # Security features
โโโ tests/ # Comprehensive test suite
โโโ docs/ # Documentation
โโโ scripts/ # Development and deployment scripts
โโโ examples/ # Usage examples
This project is licensed under the MIT License - see the LICENSE file for details.
Built with โค๏ธ for the graph analysis community