Skip to main content
Glama
necrose99

gradio-mcp-sparql-node

by necrose99

gradio-mcp-sparql

License: MIT Rust Gradio

A highly efficient, open-source Gradio Extension and Open Model Context Protocol (MCP) Server built on a high-performance Rust SPARQL engine wrapper.

This scaffolding allows digital humanities labs, computational linguists, and semantic web researchers to drop in arbitrary W3C Semantic Web Graph files (.ttl, .nt) and instantly inherit an interactive visual data workbench and an AI-agent-ready tool schema out of a single zero-configuration runtime node.


๐Ÿงฌ Architecture Overview

gradio-mcp-sparql decouples your semantic graph datasets from the complex web routing, serialization, and pipeline assembly code.

  [ RDF/Turtle Store (.ttl) ] 
               โ”‚
               โ–ผ
   [ Rust Kolibrie Engine ]  <--- Compiled dynamically via PyO3 & Maturin
               โ”‚
               โ–ผ
       [ Python Extension ]
               โ”‚
      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
      โ–ผ                 โ–ผ
[ Gradio UI ]   [ Open MCP Server ] <--- Exposes raw SPARQL capability 
(Local: 8181)   (Stdio Stream)           directly to downstream LLMs
  • Rust Performance Backbone: Utilizes a native wrapper around the StreamIntelligenceLab/Kolibrie framework to offer memory-efficient, SIMD-accelerated SPARQL queries and rule-based datalog inference directly inside memory spaces.

  • Dual-Boot Execution Matrix: Can be deployed simultaneously as an interactive visual web platform or as a headless command-line daemon dedicated strictly to AI agent tool processing pipelines.


Related MCP server: MCP SPARQL Server

๐Ÿ› ๏ธ Installation & Local Build

Ensure you have Python 3.10+, Rust (Cargo 1.60+), and just installed on your system context.

1. Initialize the Isolated Workspace

Clone this repository alongside your external dataset repositories and initialize your environment runner boundary:

just init

2. Compile the PyO3 Native Bindings

Run the compilation task to pull the upstream master repository source code files, resolve workspace dependencies, and construct the shared binary objects locally:

just compile

๐Ÿš€ Execution Modes

Mode A: Visual Dashboard & Tool Node (Default)

Launches the interactive Gradio component web panel over local system execution channels:

just run
  • Dashboard Portal: Open your browser to http://127.0.0.1:8181 to dynamically upload .ttl graph segments, track POS tag metadata layers, execute query statements, and audit results tables instantly.

Mode B: Headless Open MCP Daemon Core

Launches explicitly as a stream-isolated terminal tool engine pipeline intended for agent consumption:

just run-mcp

๐Ÿค– Connecting to LLM Clients (Claude Desktop Configuration)

To turn your compiled local graph store into a global knowledge base tool that your AI assistant can query natively using standard SPARQL semantics, add the following node allocation matrix inside your local claude_desktop_config.json parameter map:

{
  "mcpServers": {
    "gradio-mcp-sparql-node": {
      "command": "python",
      "args": [
        "/absolute/path/to/gradio-mcp-sparql/src/gradio_mcp_sparql/main_app.py",
        "--mcp-only"
      ]
    }
  }
}

Once connected, you can converse with your model using intuitive instructions:

"Query my local node for all lexical entries reconstructed as Proto-Algonquian verb structures, and group them by semantic sound-change properties."


๐Ÿ“‚ Structural Layout

gradio-mcp-sparql/
โ”œโ”€โ”€ pyproject.toml              # Unified Hatch & Maturin optimization layout
โ”œโ”€โ”€ Cargo.toml                  # Rust binding pipeline and upstream pointers
โ”œโ”€โ”€ LICENSE                     # MIT License manifest
โ”œโ”€โ”€ README.md                   # System configuration and user reference documentation
โ”œโ”€โ”€ justfile                    # Local toolchain automation registry
โ””โ”€โ”€ src/
    โ”œโ”€โ”€ lib.rs                  # Native Rust PyO3 classes mapping core engine attributes
    โ””โ”€โ”€ gradio_mcp_sparql/
        โ”œโ”€โ”€ __init__.py
        โ””โ”€โ”€ main_app.py         # Gradio component wrappers and Open MCP server loop

๐Ÿค Contributing

Contributions to improve this scaffolding are welcome!

  • Optimize the underlying string parsing vectors inside src/lib.rs.

  • Build out a more sophisticated networkx topological graphing canvas interface block inside the web panel.

  • Add support for streaming sliding windows.

All submitted pull request allocations are assumed to be published natively under the open-source MIT License terms.


โš–๏ธ License

Distributed under the MIT License. See the LICENSE file for more comprehensive information metrics.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    The Model Context Protocol (MCP) server provides a conversational interface for the exploration and analysis of RDF Turtle Knowledge Graph in Local File mode or SPARQL Endpoint.
    56
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    MCP server exposing SPARQL query functionalities for LLMs, enabling query execution, validation, and graph exploration across SPARQL endpoints.
    7
    23 PyPI
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    MCP server enabling natural-language querying of SQLite databases via schema discovery, GraphRAG retrieval, and safely guarded read-only SQL execution.
    -