kbg-viewer

kbg-viewer

A custom Vue.js component for visualizing knowledge base graphs generated from MCP memory servers.

ocasazza

Developer Tools
Visit Server

README

Graph Visualization Application

A full-stack Rust application for visualizing graphs (nodes and edges) with customizable layout algorithms.

Features

  • Visualize graphs with nodes and edges
  • Apply different layout algorithms (fCoSE, CoSE Bilkent, CiSE, Concentric)
  • Customize visualization options
  • Store and retrieve graphs
  • Cross-platform support (desktop and web)

Project Structure

The project is organized as a Rust workspace with multiple crates:

graph-viz/
├── Cargo.toml                 # Workspace configuration
├── shared/                    # Shared library crate
│   ├── Cargo.toml
│   └── src/
│       ├── lib.rs             # Library entry point
│       ├── types.rs           # Core data structures
│       ├── schema.rs          # API schemas
│       └── api.rs             # API contracts
├── frontend/                  # EGUI frontend crate
│   ├── Cargo.toml
│   └── src/
│       ├── main.rs            # Application entry point
│       ├── ui/                # UI components
│       │   └── mod.rs
│       ├── renderer/          # Graph rendering
│       │   └── mod.rs
│       └── layout/            # Layout algorithms
│           └── mod.rs
└── backend/                   # Backend server crate
    ├── Cargo.toml
    └── src/
        ├── main.rs            # Server entry point
        ├── storage/           # Storage abstractions
        │   ├── mod.rs
        │   ├── memory.rs      # In-memory implementation
        │   └── traits.rs      # Storage traits
        └── handlers/          # API handlers
            ├── mod.rs
            └── graph.rs

The root Cargo.toml defines a workspace that includes the three main crates: shared, frontend, and backend. This structure allows for code sharing between crates while maintaining separation of concerns.

Workspace Structure

A Rust workspace is a collection of packages that share the same target/ directory and dependencies. This allows for more efficient compilation and better organization of related packages. In this project:

  • The shared crate contains common data structures and API definitions used by both frontend and backend
  • The frontend crate implements the user interface using EGUI
  • The backend crate implements the server using Axum

Each crate has its own Cargo.toml file that defines its dependencies, while the root Cargo.toml file defines the workspace structure.

Development Environment

This project includes a Docker Compose setup for development with auto-reloading.

Prerequisites

  • Docker
  • Docker Compose

Rust Version

The Dockerfiles use Rust 1.81.0, which is compatible with all the dependencies used in the project. We use specific versions of some Cargo tools to ensure compatibility:

  • cargo-watch@8.4.0
  • basic-http-server@0.8.0

These versions are known to work well with the project. If you encounter any issues related to Rust version compatibility when building the Docker images, you may need to:

  1. Use different versions of the tools
  2. Update the Rust version in the Dockerfiles
  3. Use the --locked flag for additional Cargo installations

We've also made the following changes to ensure the code works correctly:

  1. Fixed naming conflicts in the shared API module
  2. Removed unused imports
  3. Added rand dependency to all crates for random positions in layout algorithms
  4. Used a specific prerelease version of egui_plot (0.26.0-alpha.2) as there's no stable 0.22 version available

Running the Development Environment

  1. Clone the repository:

    git clone <repository-url>
    cd graph-viz
    
  2. Install go-task:

    • On macOS: brew install go-task/tap/go-task
    • On Linux: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
    • On Windows: choco install go-task
    • Or see taskfile.dev for other installation methods
  3. Start the development environment:

    task start
    

This will start three services:

  • backend: The backend server running on http://localhost:3000
  • frontend-desktop: The desktop version of the frontend (for development)
  • frontend-web: The web version of the frontend running on http://localhost:8080

Using Task Commands

The Taskfile.yml provides several commands to manage the development environment:

# List all available tasks
task

# Start all services in detached mode
task start

# Start all services with logs
task dev

# Stop all services
task stop

# Restart all services
task restart

# Start only the backend
task backend

# Start only the web frontend
task web

# Start only the desktop frontend
task desktop

# Show logs from all services
task logs

# Rebuild all services
task build

# Remove all containers and volumes
task clean

# Build the desktop application
task build-desktop

# Build the web application
task build-web

# Run all tests
task test

# Run linting checks
task lint

Auto-Reloading

The development environment is configured to automatically reload when files change:

  • Backend: Changes to files in shared/src or backend/src will trigger a rebuild and restart
  • Frontend Desktop: Changes to files in shared/src or frontend/src will trigger a rebuild and restart
  • Frontend Web: Changes to files in shared/src or frontend/src will trigger a rebuild

Development Workflow

  1. Make changes to the code
  2. The services will automatically rebuild and restart
  3. View the changes in the browser (for web) or in the desktop application

Running Individual Services

You can also run individual services:

# Run only the backend
task backend

# Run only the web frontend
task web

# Run only the desktop frontend
task desktop

Building for Production

Desktop Application

task build-desktop

The executable will be in target/release/frontend.

Web Application

Using Task

task build-web

The web application will be in the dist directory.

Using Trunk Directly

You can also build the web application directly using Trunk:

# Install Trunk if you haven't already
cargo install trunk

# Install the WebAssembly target
rustup target add wasm32-unknown-unknown

# Build the web application
cd frontend
trunk build --release

The built files will be in the frontend/dist directory.

GitHub Pages Deployment

This project is configured to automatically deploy the web frontend to GitHub Pages when changes are pushed to the main branch. The deployment is handled by a GitHub Actions workflow defined in .github/workflows/deploy-web.yml.

Viewing the Deployed Application

The web application is deployed to: https://ocasazza.github.io/kbg/

Manual Deployment

You can also manually trigger the deployment workflow from the GitHub Actions tab in the repository.

Local Testing of the Web Build

To test the web build locally before deployment:

cd frontend
trunk serve --release

This will start a local server at http://localhost:8080 serving the web application.

Academic Papers

Graphviz Papers

Graph Drawing

Information Visualization

**

License

MIT License

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python