Graphistry MCP

Graphistry MCP

GPU-accelerated graph visualization and analytics server for Large Language Models that integrates with Model Control Protocol (MCP), enabling AI assistants to visualize and analyze complex network data.

Category
访问服务器

README

Graphistry MCP Integration

GPU-accelerated graph visualization and analytics for Large Language Models using Graphistry and MCP.

Overview

This project integrates Graphistry's powerful GPU-accelerated graph visualization platform with the Model Control Protocol (MCP), enabling advanced graph analytics capabilities for AI assistants and LLMs. It allows LLMs to visualize and analyze complex network data through a standardized, LLM-friendly interface.

Key features:

  • GPU-accelerated graph visualization via Graphistry
  • Advanced pattern discovery and relationship analysis
  • Network analytics (community detection, centrality, path finding, anomaly detection)
  • Support for various data formats (Pandas, NetworkX, edge lists)
  • LLM-friendly API: single graph_data dict for graph tools

🚨 Important: Graphistry Registration Required

This MCP server requires a free Graphistry account to use visualization features.

  1. Sign up for a free account at hub.graphistry.com
  2. Set your credentials as environment variables or in a .env file before starting the server:
    export GRAPHISTRY_USERNAME=your_username
    export GRAPHISTRY_PASSWORD=your_password
    # or create a .env file with:
    # GRAPHISTRY_USERNAME=your_username
    # GRAPHISTRY_PASSWORD=your_password
    
    See .env.example for a template.

MCP Configuration (.mcp.json)

To use this project with Cursor or other MCP-compatible tools, you need a .mcp.json file in your project root. A template is provided as .mcp.json.example.

Setup:

cp .mcp.json.example .mcp.json

Edit .mcp.json to:

  • Set the correct paths for your environment (e.g., project root, Python executable, server script)
  • Set your Graphistry credentials (or use environment variables/.env)
  • Choose between HTTP and stdio modes:
    • graphistry-http: Connects via HTTP (set the url to match your server's port)
    • graphistry: Connects via stdio (set the command, args, and env as needed)

Note:

  • .mcp.json.example contains both HTTP and stdio configurations. Enable/disable as needed by setting the disabled field.
  • See .env.example for environment variable setup.

Installation

Recommended Installation (Python venv + pip)

# Clone the repository
git clone https://github.com/graphistry/graphistry-mcp.git
cd graphistry-mcp

# Set up virtual environment and install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# Set up your Graphistry credentials (see above)

Or use the setup script:

./setup-graphistry-mcp.sh

Usage

Starting the Server

# Activate your virtual environment if not already active
source .venv/bin/activate

# Start the server (stdio mode)
python run_graphistry_mcp.py

# Or use the start script for HTTP or stdio mode (recommended, sources .env securely)
./start-graphistry-mcp.sh --http 8080

Security & Credential Handling

  • The server loads credentials from environment variables or .env using python-dotenv, so you can safely use a .env file for local development.
  • The start-graphistry-mcp.sh script sources .env and is the most robust and secure way to launch the server.

Adding to Cursor (or other LLM tools)

  • Add the MCP server to your .cursor/mcp.json or equivalent config:
    {
      "graphistry": {
        "command": "/path/to/your/.venv/bin/python",
        "args": ["/path/to/your/run_graphistry_mcp.py"],
        "env": {
          "GRAPHISTRY_USERNAME": "your_username",
          "GRAPHISTRY_PASSWORD": "your_password"
        },
        "type": "stdio"
      }
    }
    
  • Make sure the virtual environment is used (either by using the full path to the venv's python, or by activating it before launching).
  • If you see errors about API version or missing credentials, double-check your environment variables and registration.

Example: Visualizing a Graph (LLM-friendly API)

The main tool, visualize_graph, now accepts a single graph_data dictionary. Example:

{
  "graph_data": {
    "graph_type": "graph",
    "edges": [
      {"source": "A", "target": "B"},
      {"source": "A", "target": "C"},
      {"source": "A", "target": "D"},
      {"source": "A", "target": "E"},
      {"source": "B", "target": "C"},
      {"source": "B", "target": "D"},
      {"source": "B", "target": "E"},
      {"source": "C", "target": "D"},
      {"source": "C", "target": "E"},
      {"source": "D", "target": "E"}
    ],
    "nodes": [
      {"id": "A"}, {"id": "B"}, {"id": "C"}, {"id": "D"}, {"id": "E"}
    ],
    "title": "5-node, 10-edge Complete Graph",
    "description": "A complete graph of 5 nodes (K5) where every node is connected to every other node."
  }
}

Example (hypergraph):

{
  "graph_data": {
    "graph_type": "hypergraph",
    "edges": [
      {"source": "A", "target": "B", "group": "G1", "weight": 0.7},
      {"source": "A", "target": "C", "group": "G1", "weight": 0.6},
      {"source": "B", "target": "C", "group": "G2", "weight": 0.8},
      {"source": "A", "target": "D", "group": "G2", "weight": 0.5}
    ],
    "columns": ["source", "target", "group"],
    "title": "Test Hypergraph",
    "description": "A simple test hypergraph."
  }
}

Available MCP Tools

The following MCP tools are available for graph visualization, analysis, and manipulation:

  • visualize_graph: Visualize a graph or hypergraph using Graphistry's GPU-accelerated renderer.
  • get_graph_ids: List all stored graph IDs in the current session.
  • get_graph_info: Get metadata (node/edge counts, title, description) for a stored graph.
  • apply_layout: Apply a standard layout (force_directed, radial, circle, grid) to a graph.
  • detect_patterns: Run network analysis (centrality, community detection, path finding, anomaly detection).
  • encode_point_color: Set node color encoding by column (categorical or continuous).
  • encode_point_size: Set node size encoding by column (categorical or continuous).
  • encode_point_icon: Set node icon encoding by column (categorical, with icon mapping or binning).
  • encode_point_badge: Set node badge encoding by column (categorical, with icon mapping or binning).
  • apply_ring_categorical_layout: Arrange nodes in rings by a categorical column (e.g., group/type).
  • apply_group_in_a_box_layout: Arrange nodes in group-in-a-box layout (requires igraph).
  • apply_modularity_weighted_layout: Arrange nodes by modularity-weighted layout (requires igraph).
  • apply_ring_continuous_layout: Arrange nodes in rings by a continuous column (e.g., score).
  • apply_time_ring_layout: Arrange nodes in rings by a datetime column (e.g., created_at).
  • apply_tree_layout: Arrange nodes in a tree (layered hierarchical) layout.
  • set_graph_settings: Set advanced visualization settings (point size, edge influence, etc.).

Contributing

PRs and issues welcome! This project is evolving rapidly as we learn more about LLM-driven graph analytics and tool integration.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选