Skip to main content
Glama

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

Related MCP server: Neo4j GraphRAG MCP Server

🚨 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

# Install via npx (no installation required)
npx -y @silkspace/graphistry-mcp

# Or install globally
npm install -g @silkspace/graphistry-mcp
graphistry-mcp

MCP Client Configuration:

Add to your MCP client settings (.mcp.json, MCP client config, etc.):

{
  "graphistry": {
    "command": "npx",
    "args": ["-y", "@silkspace/graphistry-mcp"],
    "env": {
      "GRAPHISTRY_USERNAME": "your_username",
      "GRAPHISTRY_PASSWORD": "your_password"
    }
  }
}

The npm package automatically:

  • Creates a Python virtual environment

  • Installs all Python dependencies (using uv if available, otherwise pip)

  • Sets up the MCP server

Alternative: Manual 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 MCP Clients

Using npm (Recommended):

Add the MCP server to your MCP client config:

{
  "graphistry": {
    "command": "npx",
    "args": ["-y", "@silkspace/graphistry-mcp"],
    "env": {
      "GRAPHISTRY_USERNAME": "your_username",
      "GRAPHISTRY_PASSWORD": "your_password"
    }
  }
}

Using manual installation:

{
  "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"
    }
  }
}

Notes:

  • 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

Available Tools

17 tools
apply_group_in_a_box_layoutB
Apply group-in-a-box layout to the graph using Graphistry's group_in_a_box_layout API.

Args:
    graph_id (str): The ID of the graph to modify.

Returns:
    dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.

Example:
    apply_group_in_a_box_layout(graph_id)

Inputs: graph_id (required).

apply_layoutB

Apply a layout algorithm to a graph.

Args:
    graph_id: ID of the graph to apply layout to
    layout: Layout algorithm to apply (force_directed, radial, circle, grid)

Inputs: graph_id (required), layout (required).

apply_modularity_weighted_layoutB
Apply modularity weighted layout to the graph using Graphistry's modularity_weighted_layout API.

Args:
    graph_id (str): The ID of the graph to modify.

Returns:
    dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.

Example:
    apply_modularity_weighted_layout(graph_id)

Inputs: graph_id (required).

apply_ring_categorical_layoutA
Apply a categorical ring layout to the graph using Graphistry's ring_categorical_layout API.

Args:
    graph_id (str): The ID of the graph to modify.
    ring_col (str): The node column to use for determining ring membership (e.g., a categorical attribute like 'type' or 'group').

Returns:
    dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.

Example:
    apply_ring_categorical_layout(graph_id, ring_col='type')

Inputs: graph_id (required), ring_col (required).

apply_ring_continuous_layoutA
Apply a continuous ring layout to the graph using Graphistry's ring_continuous_layout API.

Args:
    graph_id (str): The ID of the graph to modify.
    ring_col (str): The node column to use for determining ring position (should be a continuous/numeric attribute, e.g., 'score').

Returns:
    dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.

Example:
    apply_ring_continuous_layout(graph_id, ring_col='score')

Inputs: graph_id (required), ring_col (required).

apply_time_ring_layoutB
Apply a time ring layout to the graph using Graphistry's time_ring_layout API.

Args:
    graph_id (str): The ID of the graph to modify.
    time_col (str): The node column to use for determining ring position (should be a datetime or timestamp attribute, e.g., 'created_at').

Returns:
    dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.

Example:
    apply_time_ring_layout(graph_id, time_col='created_at')

Inputs: graph_id (required), time_col (required).

apply_tree_layoutC
Apply a tree (layered hierarchical) layout to the graph using Graphistry's tree_layout API.

Args:
    graph_id (str): The ID of the graph to modify.

Returns:
    dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.

Example:
    apply_tree_layout(graph_id)

Inputs: graph_id (required).

detect_patternsB
Identify patterns, communities, and anomalies within graphs. Runs all supported analyses and returns a combined report.

Args:
    graph_id: ID of the graph to analyze
    ctx: MCP context for progress reporting

Returns:
    Dictionary with results from all analyses that succeeded. Keys may include:
        - degree_centrality
        - betweenness_centrality
        - closeness_centrality
        - communities (if community detection is available)
        - shortest_path (if path finding is possible)
        - path_length
        - anomalies (if anomaly detection is available)
        - errors (dict of analysis_type -> error message)

Inputs: graph_id (required), ctx.

encode_point_badgeA
Set node badge encoding for a graph using Graphistry's encode_point_badge API.

Args:
    graph_id (str): The ID of the graph to modify.
    column (str): The node column to use for badge encoding (e.g., 'type', 'origin').
    position (str, optional): Badge position on the node. Example: 'TopRight', 'BottomLeft', etc.
    categorical_mapping (dict, optional): Map of category values to badge icons or images. Example: {'macbook': 'laptop', 'Canada': 'flag-icon-ca'}.
    default_mapping (str, optional): Badge to use for values not in categorical_mapping. Example: 'question'.
    as_text (bool, optional): If True, use text as the badge (for continuous binning or direct text display).
    continuous_binning (list, optional): List of [threshold, badge] pairs for binning continuous values. Example: [[33, None], [66, 'info-circle'], [None, 'exclamation-triangle']].

Returns:
    dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.

Example:
    encode_point_badge(graph_id, column='type', position='TopRight', categorical_mapping={'macbook': 'laptop'}, default_mapping='question')

Inputs: graph_id (required), column (required), position, categorical_mapping, +3 more.

encode_point_colorA
Set node color encoding for a graph using Graphistry's encode_point_color API.

Args:
    graph_id (str): The ID of the graph to modify (from visualize_graph).
    column (str): The node column to use for color encoding (e.g., 'type', 'score').
    categorical_mapping (dict, optional): Map of category values to color codes. Example: {'mac': '#F99', 'macbook': '#99F'}. If not provided, Graphistry will auto-assign colors.
    default_mapping (str, optional): Color code to use for values not in categorical_mapping. Example: 'silver'.
    as_continuous (bool, optional): If True, treat the column as continuous and use a gradient palette. Example: True for numeric columns like 'score'.

Returns:
    dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.

Example:
    encode_point_color(graph_id, column='type', categorical_mapping={'mac': '#F99', 'macbook': '#99F'}, default_mapping='silver')

Inputs: graph_id (required), column (required), categorical_mapping, default_mapping, +1 more.

encode_point_iconA
Set node icon encoding for a graph using Graphistry's encode_point_icon API.

Args:
    graph_id (str): The ID of the graph to modify.
    column (str): The node column to use for icon encoding (e.g., 'type', 'origin').
    categorical_mapping (dict, optional): Map of category values to icon names or URLs. Example: {'macbook': 'laptop', 'Canada': 'flag-icon-ca'}. See FontAwesome 4 or ISO country codes for built-ins.
    default_mapping (str, optional): Icon to use for values not in categorical_mapping. Example: 'question'.
    as_text (bool, optional): If True, use text as the icon (for continuous binning or direct text display).
    continuous_binning (list, optional): List of [threshold, icon] pairs for binning continuous values. Example: [[33, 'low'], [66, 'mid'], [None, 'high']].

Returns:
    dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.

Example:
    encode_point_icon(graph_id, column='type', categorical_mapping={'macbook': 'laptop', 'Canada': 'flag-icon-ca'}, default_mapping='question')

Inputs: graph_id (required), column (required), categorical_mapping, default_mapping, +2 more.

encode_point_sizeB
Set node size encoding for a graph using Graphistry's encode_point_size API.

Args:
    graph_id (str): The ID of the graph to modify.
    column (str): The node column to use for size encoding (e.g., 'score', 'type').
    categorical_mapping (dict, optional): Map of category values to sizes. Example: {'mac': 50, 'macbook': 100}. If not provided, Graphistry will auto-assign sizes.
    default_mapping (float, optional): Size to use for values not in categorical_mapping. Example: 20.
    as_continuous (bool, optional): If True, treat the column as continuous and use a size gradient. Example: True for numeric columns like 'score'.

Returns:
    dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.

Example:
    encode_point_size(graph_id, column='score', as_continuous=True)

Inputs: graph_id (required), column (required), categorical_mapping, default_mapping.

get_graph_idsB

Get a list of all stored graph IDs.

Inputs: no named parameters.

get_graph_infoC

Get information about a stored graph visualization.

Inputs: graph_id (required).

pingB

Health check for Graphistry MCP server.

Inputs: ctx.

set_graph_settingsB
Set visualization settings for a graph using Graphistry's settings API.

Args:
    graph_id (str): The ID of the graph to modify.
    url_params (dict): Dictionary of Graphistry URL parameters to control visualization. Example: {'pointSize': 0.5, 'edgeInfluence': 2, 'play': 0}.

Returns:
    dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.

Example:
    set_graph_settings(graph_id, url_params={'pointSize': 0.5, 'play': 0})

Inputs: graph_id (required), url_params (required).

visualize_graphA
Visualize a graph using Graphistry's GPU-accelerated renderer.

Args:
    graph_type (str, optional): Type of graph to visualize. Must be one of "graph" (two-way edges, default), "hypergraph" (many-to-many edges).
    graph_data (dict): Dictionary describing the graph to visualize. Fields:
        - edges (list, required): List of edges, each as a dict with at least 'source' and 'target' keys (e.g., [{"source": "A", "target": "B"}, ...]) and any other columns you want to include in the edge table
        - nodes (list, optional): List of nodes, each as a dict with at least 'id' key (e.g., [{"id": "A"}, ...]) and any other columns you want to include in the node table
        - node_id (str, optional): Column name for node IDs, if nodes are provided, must be provided.
        - source (str, optional): Column name for edge source (default: "source")
        - destination (str, optional): Column name for edge destination (default: "target")
        - columns (list, optional): List of column names for hypergraph edge table, use if graph_type is hypergraph.
        - title (str, optional): Title for the visualization
        - description (str, optional): Description for the visualization
    ctx: MCP context for progress reporting

Example (graph):
    graph_data = {
        "graph_type": "graph",
        "edges": [
            {"source": "A", "target": "B", "weight": 1},
            {"source": "A", "target": "C", "weight": 2},
            ...
        ],
        "nodes": [
            {"id": "A", "label": "Node A"},
            {"id": "B", "label": "Node B"},
            ...
        ],
        "node_id": "id",
        "source": "source",
        "destination": "target",
        "title": "My Graph",
        "description": "A simple example graph."
    }

Example (hypergraph):
    graph_data = {
        "graph_type": "hypergraph",
        "edges": [
            {"source": "A", "target": "B", "group": "G1", "weight": 1},
            {"source": "A", "target": "C", "group": "G1", "weight": 1},
            ...
        ],
        "columns": ["source", "target", "group"],
        "title": "My Hypergraph",
        "description": "A simple example hypergraph."
    }

Inputs: graph_data (required), ctx.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 17 tools

    Disambiguation4/5

    Most tools have distinct purposes, with clear separation between layout, encoding, and management functions. However, some layout tools like 'apply_layout' (general) and specific ones like 'apply_group_in_a_box_layout' could cause confusion due to overlapping functionality, though descriptions help clarify their differences.

    Naming Consistency5/5

    Tool names follow a highly consistent verb_noun pattern throughout, such as 'apply_group_in_a_box_layout', 'encode_point_color', and 'get_graph_ids'. All tools use snake_case and start with a verb, making the naming predictable and easy to understand.

    Tool Count4/5

    With 17 tools, the count is slightly high but reasonable for a graph visualization server covering layout, encoding, analysis, and management. It's well-scoped for the domain, though some tools could potentially be consolidated to reduce complexity.

    Completeness5/5

    The toolset provides comprehensive coverage for graph visualization workflows, including creation (visualize_graph), layout (multiple apply_* tools), encoding (encode_point_*), analysis (detect_patterns), settings (set_graph_settings), and management (get_graph_ids, get_graph_info). No obvious gaps are present for the server's purpose.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      A graph-based MCP server that provides AI coding agents with persistent memory to store patterns, track complex relationships, and retrieve knowledge across sessions. It leverages graph structures to handle temporal queries and relational paths that traditional vector stores often miss.
      257
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that enables LLMs to perform semantic and fulltext searches within Neo4j while executing complex, search-augmented Cypher queries for GraphRAG applications. It provides tools for database schema discovery and supports multi-provider embeddings to facilitate advanced graph traversals.
      5
      3
      MIT