sparql-llm
Verified Safeby sib-swiss
Overview
This project provides tools for Large Language Model (LLM)-powered SPARQL query generation over specific knowledge graphs, including a chat interface for user interaction and a Model Context Protocol (MCP) server for tool exposure.
Installation
uv run sparql-llm --http --port 8888Environment Variables
- CHAT_API_KEY
- LOGS_API_KEY
- OPENAI_API_KEY
- OPENROUTER_API_KEY
- LANGFUSE_HOST
- LANGFUSE_PUBLIC_KEY
- LANGFUSE_SECRET_KEY
- VECTORDB_URL
- SETTINGS_FILEPATH
- AZURE_INFERENCE_CREDENTIAL
- AZURE_INFERENCE_ENDPOINT
Security Notes
The system avoids hardcoded secrets by relying on environment variables for API keys. It employs DOMPurify for frontend HTML sanitization. A significant security feature is the automatic validation of generated SPARQL queries against endpoint schemas (VoID descriptions), which helps mitigate SPARQL injection risks. However, the complexity of federated SPARQL queries and the reliance on external VoID descriptions mean that sophisticated or unforeseen query patterns could potentially bypass validation if the schemas are incomplete or flawed. The `httpx` client follows redirects for external SPARQL endpoints, a potential SSRF vector if `endpoint_url` could be maliciously manipulated beyond the configured list.
Similar Servers
MaxKB
An enterprise-grade intelligent agent platform for building knowledge bases, RAG, complex workflows, and AI agents, targeting intelligent customer service and office assistants.
flexible-graphrag
The Flexible GraphRAG MCP Server provides a Model Context Protocol (MCP) interface for AI assistants (like Claude Desktop) to interact with a sophisticated RAG and GraphRAG system for document processing, knowledge graph auto-building, hybrid search, and AI Q&A.
Web-Algebra
Translates natural language instructions into RDF operations for loading, querying, and writing Linked Data, consumable via executable JSON or as MCP tools for AI agents.
mcp-local-rag
A privacy-first, local document search server that leverages semantic search for Model Context Protocol (MCP) clients.