gradio-mcp-sparql-node
by necrose99
README.md
# gradio-mcp-sparql
[](https://opensource.org)
[](https://rust-lang.org)
[](https://gradio.app)
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.
```text
[ 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.
---
## š ļø 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:
```bash
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:
```bash
just compile
```
---
## š Execution Modes
### Mode A: Visual Dashboard & Tool Node (Default)
Launches the interactive Gradio component web panel over local system execution channels:
```bash
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:
```bash
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:
```json
{
"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
```text
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.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues