# NetworkX MCP Server
**The first NetworkX integration for Model Context Protocol** - Bringing graph analysis directly into your AI conversations.
[](https://www.python.org/downloads/)
[](https://networkx.org/)
[](https://modelcontextprotocol.io/)
[](https://opensource.org/licenses/MIT)
[](#-enterprise-edition)
## 🚀 What is this?
NetworkX MCP Server enables Large Language Models (like Claude) to perform graph analysis operations directly within conversations. No more context switching between tools - analyze networks, find communities, calculate centrality, and visualize graphs all through natural language.
### 🎯 Key Features
- **13 Essential Graph Operations**: From basic graph creation to advanced algorithms like PageRank and community detection
- **Visualization**: Generate graph visualizations on-demand with multiple layout options
- **Import/Export**: Load graphs from CSV, export to JSON
- **Zero Setup**: Works immediately with Claude Desktop or any MCP-compatible client
- **First of Its Kind**: The first NetworkX server in the MCP ecosystem
## 🌟 Why NetworkX MCP Server?
- **Natural Language Graph Analysis**: Describe what you want to analyze in plain English
- **No Database Required**: Unlike graph database integrations, this works with in-memory graphs
- **Instant Insights**: Get centrality metrics, find communities, and discover patterns immediately
- **Visual Understanding**: See your graphs, don't just analyze them
- **Enterprise Ready**: Production-grade security, monitoring, and scale (Enterprise Edition)
## 📊 Editions
### Community Edition (Free)
- **13 Graph Operations**: Complete NetworkX functionality
- **Visualization**: PNG output with multiple layouts
- **Import/Export**: CSV and JSON support
- **Zero Setup**: Works with Claude Desktop immediately
```bash
pip install networkx-mcp-server
```
### 🏢 Enterprise Edition
- **Everything in Community Edition** +
- **🔐 Enterprise Security**: OAuth 2.1, API keys, RBAC
- **⚡ Rate Limiting**: Per-user and per-operation quotas
- **📊 Monitoring**: Prometheus metrics, audit logging
- **🛡️ Input Validation**: Comprehensive security validation
- **📈 Resource Control**: Memory and execution limits
- **🚀 Production Ready**: Health checks, Docker support
```bash
pip install networkx-mcp-server[enterprise]
```
📖 **[Enterprise Guide](ENTERPRISE_GUIDE.md)** | **[Demo](demos/)** | **[Security](SECURITY.md)**
## 📊 Available Operations
### Core Operations
- `create_graph` - Create directed or undirected graphs
- `add_nodes` - Add nodes to your graph
- `add_edges` - Connect nodes with edges
- `get_info` - Get basic graph statistics
- `shortest_path` - Find optimal paths between nodes
### Analysis Operations
- `degree_centrality` - Find the most connected nodes
- `betweenness_centrality` - Identify bridges and key connectors
- `pagerank` - Google's PageRank algorithm for node importance
- `connected_components` - Find isolated subgraphs
- `community_detection` - Discover natural groupings
### Visualization & I/O
- `visualize_graph` - Create PNG visualizations with multiple layouts
- `import_csv` - Load graphs from edge lists
- `export_json` - Export graphs in standard formats
## 🚦 Quick Start
### Community Edition
```bash
# Install community edition
pip install networkx-mcp-server
```
Add to your `claude_desktop_config.json`:
```json
{
"mcpServers": {
"networkx": {
"command": "networkx-mcp",
"args": []
}
}
}
```
### Enterprise Edition
```bash
# Install enterprise edition with security features
pip install networkx-mcp-server[enterprise]
# Set up authentication (generate secure key)
export NETWORKX_MCP_SECURITY_API_KEYS="$(python -c 'import secrets; print(secrets.token_urlsafe(32))')"
```
Add to your `claude_desktop_config.json`:
```json
{
"mcpServers": {
"networkx-enterprise": {
"command": "networkx-mcp-enterprise",
"args": [],
"env": {
"NETWORKX_MCP_SECURITY_API_KEYS": "your-secure-api-key-here",
"NETWORKX_MCP_RATE_LIMIT_ENABLED": "true",
"NETWORKX_MCP_MONITORING_METRICS_ENABLED": "true"
}
}
}
}
```
📖 **[Complete Enterprise Setup Guide](ENTERPRISE_GUIDE.md)**
### Basic Usage Example
```
Human: Create a social network graph and analyze it
Claude: I'll help you create and analyze a social network graph.
[Creates graph "social_network"]
[Adds nodes: Alice, Bob, Charlie, David, Eve]
[Adds edges: Alice-Bob, Alice-Charlie, Bob-Charlie, Bob-David, Charlie-Eve]
Now let me analyze this network:
[Calculates degree centrality]
Most connected: Bob and Charlie (degree centrality: 0.75)
[Calculates betweenness centrality]
Key bridges: Charlie (betweenness: 0.58) - connects different parts of the network
[Detects communities]
Found 2 communities: [Alice, Bob, Charlie] and [David, Eve]
[Visualizes the graph]
Here's what your social network looks like: [displays graph image]
```
## 🎓 Example Use Cases
### 1. Social Network Analysis
- Identify influencers and key connectors
- Find communities and cliques
- Analyze information flow patterns
### 2. Transportation Planning
- Find shortest routes between locations
- Identify critical intersections
- Analyze network resilience
### 3. Knowledge Graphs
- Map concept relationships
- Find learning paths
- Identify prerequisite chains
See the [demos/](demos/) folder for complete examples.
## 📈 Performance
- **Memory**: ~70MB (including Python, NetworkX, and visualization)
- **Graph Size**: Tested up to 10,000 nodes
- **Operations**: Most complete in milliseconds
- **Visualization**: 1-2 seconds for complex graphs
## 🛠️ Development
### Running from Source
```bash
# Clone the repository
git clone https://github.com/Bright-L01/networkx-mcp-server
cd networkx-mcp-server
# Install dependencies
pip install -e .
# Run the server
python -m networkx_mcp.server_minimal
```
### Running Tests
```bash
pytest tests/working/
```
## 📚 Documentation
- [API Reference](docs/api.md) - Detailed operation descriptions
- [Examples](demos/) - Real-world use cases
- [Contributing](CONTRIBUTING.md) - How to contribute
## 🤝 Contributing
We welcome contributions! This is the first NetworkX MCP server, and there's lots of room for improvement:
- Add more graph algorithms
- Improve visualization options
- Add graph file format support
- Optimize performance
- Write more examples
## 📄 License
MIT License - See [LICENSE](LICENSE) for details.
## 🙏 Acknowledgments
- [NetworkX](https://networkx.org/) - The amazing graph library that powers this server
- [Anthropic](https://anthropic.com/) - For creating the Model Context Protocol
- The MCP community - For inspiration and examples
---
**Built with ❤️ for the AI and Graph Analysis communities**
Raw data
{
"_id": null,
"home_page": "https://github.com/brightliu/networkx-mcp-server",
"name": "networkx-mcp-server",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "Bright Liu <brightliu@college.harvard.edu>",
"keywords": "networkx, graph, analysis, mcp, ai, claude, visualization, network, centrality, community",
"author": "NetworkX MCP Team",
"author_email": "Bright Liu <brightliu@college.harvard.edu>",
"download_url": "https://files.pythonhosted.org/packages/f2/d7/16ab3e32cd4b0b7ec3864d3565736b90fe8dd87cef619e005d159d19e5ff/networkx_mcp_server-1.1.0.tar.gz",
"platform": null,
"description": "# NetworkX MCP Server\n\n**The first NetworkX integration for Model Context Protocol** - Bringing graph analysis directly into your AI conversations.\n\n[](https://www.python.org/downloads/)\n[](https://networkx.org/)\n[](https://modelcontextprotocol.io/)\n[](https://opensource.org/licenses/MIT)\n[](#-enterprise-edition)\n\n## \ud83d\ude80 What is this?\n\nNetworkX MCP Server enables Large Language Models (like Claude) to perform graph analysis operations directly within conversations. No more context switching between tools - analyze networks, find communities, calculate centrality, and visualize graphs all through natural language.\n\n### \ud83c\udfaf Key Features\n\n- **13 Essential Graph Operations**: From basic graph creation to advanced algorithms like PageRank and community detection\n- **Visualization**: Generate graph visualizations on-demand with multiple layout options\n- **Import/Export**: Load graphs from CSV, export to JSON\n- **Zero Setup**: Works immediately with Claude Desktop or any MCP-compatible client\n- **First of Its Kind**: The first NetworkX server in the MCP ecosystem\n\n## \ud83c\udf1f Why NetworkX MCP Server?\n\n- **Natural Language Graph Analysis**: Describe what you want to analyze in plain English\n- **No Database Required**: Unlike graph database integrations, this works with in-memory graphs\n- **Instant Insights**: Get centrality metrics, find communities, and discover patterns immediately\n- **Visual Understanding**: See your graphs, don't just analyze them\n- **Enterprise Ready**: Production-grade security, monitoring, and scale (Enterprise Edition)\n\n## \ud83d\udcca Editions\n\n### Community Edition (Free)\n- **13 Graph Operations**: Complete NetworkX functionality\n- **Visualization**: PNG output with multiple layouts\n- **Import/Export**: CSV and JSON support\n- **Zero Setup**: Works with Claude Desktop immediately\n\n```bash\npip install networkx-mcp-server\n```\n\n### \ud83c\udfe2 Enterprise Edition\n- **Everything in Community Edition** +\n- **\ud83d\udd10 Enterprise Security**: OAuth 2.1, API keys, RBAC\n- **\u26a1 Rate Limiting**: Per-user and per-operation quotas\n- **\ud83d\udcca Monitoring**: Prometheus metrics, audit logging\n- **\ud83d\udee1\ufe0f Input Validation**: Comprehensive security validation\n- **\ud83d\udcc8 Resource Control**: Memory and execution limits\n- **\ud83d\ude80 Production Ready**: Health checks, Docker support\n\n```bash\npip install networkx-mcp-server[enterprise]\n```\n\n\ud83d\udcd6 **[Enterprise Guide](ENTERPRISE_GUIDE.md)** | **[Demo](demos/)** | **[Security](SECURITY.md)**\n\n## \ud83d\udcca Available Operations\n\n### Core Operations\n- `create_graph` - Create directed or undirected graphs\n- `add_nodes` - Add nodes to your graph\n- `add_edges` - Connect nodes with edges\n- `get_info` - Get basic graph statistics\n- `shortest_path` - Find optimal paths between nodes\n\n### Analysis Operations\n- `degree_centrality` - Find the most connected nodes\n- `betweenness_centrality` - Identify bridges and key connectors\n- `pagerank` - Google's PageRank algorithm for node importance\n- `connected_components` - Find isolated subgraphs\n- `community_detection` - Discover natural groupings\n\n### Visualization & I/O\n- `visualize_graph` - Create PNG visualizations with multiple layouts\n- `import_csv` - Load graphs from edge lists\n- `export_json` - Export graphs in standard formats\n\n## \ud83d\udea6 Quick Start\n\n### Community Edition\n\n```bash\n# Install community edition\npip install networkx-mcp-server\n```\n\nAdd to your `claude_desktop_config.json`:\n\n```json\n{\n \"mcpServers\": {\n \"networkx\": {\n \"command\": \"networkx-mcp\",\n \"args\": []\n }\n }\n}\n```\n\n### Enterprise Edition\n\n```bash\n# Install enterprise edition with security features\npip install networkx-mcp-server[enterprise]\n\n# Set up authentication (generate secure key)\nexport NETWORKX_MCP_SECURITY_API_KEYS=\"$(python -c 'import secrets; print(secrets.token_urlsafe(32))')\"\n```\n\nAdd to your `claude_desktop_config.json`:\n\n```json\n{\n \"mcpServers\": {\n \"networkx-enterprise\": {\n \"command\": \"networkx-mcp-enterprise\",\n \"args\": [],\n \"env\": {\n \"NETWORKX_MCP_SECURITY_API_KEYS\": \"your-secure-api-key-here\",\n \"NETWORKX_MCP_RATE_LIMIT_ENABLED\": \"true\",\n \"NETWORKX_MCP_MONITORING_METRICS_ENABLED\": \"true\"\n }\n }\n }\n}\n```\n\n\ud83d\udcd6 **[Complete Enterprise Setup Guide](ENTERPRISE_GUIDE.md)**\n\n### Basic Usage Example\n\n```\nHuman: Create a social network graph and analyze it\n\nClaude: I'll help you create and analyze a social network graph.\n\n[Creates graph \"social_network\"]\n[Adds nodes: Alice, Bob, Charlie, David, Eve]\n[Adds edges: Alice-Bob, Alice-Charlie, Bob-Charlie, Bob-David, Charlie-Eve]\n\nNow let me analyze this network:\n\n[Calculates degree centrality]\nMost connected: Bob and Charlie (degree centrality: 0.75)\n\n[Calculates betweenness centrality]\nKey bridges: Charlie (betweenness: 0.58) - connects different parts of the network\n\n[Detects communities]\nFound 2 communities: [Alice, Bob, Charlie] and [David, Eve]\n\n[Visualizes the graph]\nHere's what your social network looks like: [displays graph image]\n```\n\n## \ud83c\udf93 Example Use Cases\n\n### 1. Social Network Analysis\n- Identify influencers and key connectors\n- Find communities and cliques\n- Analyze information flow patterns\n\n### 2. Transportation Planning\n- Find shortest routes between locations\n- Identify critical intersections\n- Analyze network resilience\n\n### 3. Knowledge Graphs\n- Map concept relationships\n- Find learning paths\n- Identify prerequisite chains\n\nSee the [demos/](demos/) folder for complete examples.\n\n## \ud83d\udcc8 Performance\n\n- **Memory**: ~70MB (including Python, NetworkX, and visualization)\n- **Graph Size**: Tested up to 10,000 nodes\n- **Operations**: Most complete in milliseconds\n- **Visualization**: 1-2 seconds for complex graphs\n\n## \ud83d\udee0\ufe0f Development\n\n### Running from Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/Bright-L01/networkx-mcp-server\ncd networkx-mcp-server\n\n# Install dependencies\npip install -e .\n\n# Run the server\npython -m networkx_mcp.server_minimal\n```\n\n### Running Tests\n\n```bash\npytest tests/working/\n```\n\n## \ud83d\udcda Documentation\n\n- [API Reference](docs/api.md) - Detailed operation descriptions\n- [Examples](demos/) - Real-world use cases\n- [Contributing](CONTRIBUTING.md) - How to contribute\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions! This is the first NetworkX MCP server, and there's lots of room for improvement:\n\n- Add more graph algorithms\n- Improve visualization options\n- Add graph file format support\n- Optimize performance\n- Write more examples\n\n## \ud83d\udcc4 License\n\nMIT License - See [LICENSE](LICENSE) for details.\n\n## \ud83d\ude4f Acknowledgments\n\n- [NetworkX](https://networkx.org/) - The amazing graph library that powers this server\n- [Anthropic](https://anthropic.com/) - For creating the Model Context Protocol\n- The MCP community - For inspiration and examples\n\n---\n\n**Built with \u2764\ufe0f for the AI and Graph Analysis communities**\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The first NetworkX MCP server - Graph analysis in your AI conversations",
"version": "1.1.0",
"project_urls": {
"Homepage": "https://github.com/Bright-L01/networkx-mcp-server",
"Issues": "https://github.com/Bright-L01/networkx-mcp-server/issues",
"Repository": "https://github.com/Bright-L01/networkx-mcp-server"
},
"split_keywords": [
"networkx",
" graph",
" analysis",
" mcp",
" ai",
" claude",
" visualization",
" network",
" centrality",
" community"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "db218ef522c2c6d25ee0cd2845ac1d9a7501600ff3238f845c9808202ee4ebba",
"md5": "d8a20c34d63f6729499d65bb6965ae53",
"sha256": "7ed4d18e060bd7ac2e3d7b296bf31e6e1d656501bacbb3ab5858c796a2e0255a"
},
"downloads": -1,
"filename": "networkx_mcp_server-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d8a20c34d63f6729499d65bb6965ae53",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 173156,
"upload_time": "2025-07-16T01:52:05",
"upload_time_iso_8601": "2025-07-16T01:52:05.656773Z",
"url": "https://files.pythonhosted.org/packages/db/21/8ef522c2c6d25ee0cd2845ac1d9a7501600ff3238f845c9808202ee4ebba/networkx_mcp_server-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f2d716ab3e32cd4b0b7ec3864d3565736b90fe8dd87cef619e005d159d19e5ff",
"md5": "53de503f197f004e25881fbbb9f599e6",
"sha256": "dddfa8df0b6c4a1a9c678d735d9c0c0f98fc6e696c35d5d85f69edb99ffca3ef"
},
"downloads": -1,
"filename": "networkx_mcp_server-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "53de503f197f004e25881fbbb9f599e6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 411658,
"upload_time": "2025-07-16T01:52:07",
"upload_time_iso_8601": "2025-07-16T01:52:07.189162Z",
"url": "https://files.pythonhosted.org/packages/f2/d7/16ab3e32cd4b0b7ec3864d3565736b90fe8dd87cef619e005d159d19e5ff/networkx_mcp_server-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-16 01:52:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "brightliu",
"github_project": "networkx-mcp-server",
"github_not_found": true,
"lcname": "networkx-mcp-server"
}