mcp-sparql
MCP server exposing SPARQL query functionalities for LLMs, enabling query execution, validation, and graph exploration across SPARQL endpoints.
README
mcp-sparql — MCP server exposing SPARQL query functionalities for LLMs.
mcp-name: io.github.daedalus/mcp-sparql
Install
pip install mcp-sparql
Usage
As an MCP Server
Add to your MCP configuration (e.g., ~/.config/claude/mcp.json):
{
"mcpServers": {
"mcp-sparql": {
"command": "mcp-sparql"
}
}
}
Available Tools
| Tool | Description |
|---|---|
sparql_query |
Execute SPARQL SELECT queries (table or JSON output) |
sparql_ask |
Execute SPARQL ASK queries (boolean result) |
sparql_construct |
Execute SPARQL CONSTRUCT queries (Turtle or JSON-LD) |
sparql_describe |
Execute SPARQL DESCRIBE queries (Turtle or JSON-LD) |
sparql_validate |
Validate SPARQL query syntax without executing |
sparql_list_graphs |
List named graphs on a SPARQL endpoint |
sparql_get_prefixes |
Get common prefixes for a SPARQL endpoint |
Examples
Query Wikidata:
sparql_query:
endpoint: "https://query.wikidata.org/sparql"
query: "SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q5 . ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = 'en') } LIMIT 5"
Check if an entity exists:
sparql_ask:
endpoint: "https://query.wikidata.org/sparql"
query: "ASK { wd:Q42 wdt:P31 wd:Q5 }"
Validate a query:
sparql_validate:
query: "SELECT ?s WHERE { ?s ?p ?o }"
List named graphs:
sparql_list_graphs:
endpoint: "https://query.wikidata.org/sparql"
Get common prefixes:
sparql_get_prefixes:
endpoint: "https://query.wikidata.org/sparql"
Resources
| Resource | URI | Description |
|---|---|---|
| Common Prefixes | sparql://common-prefixes |
Standard SPARQL namespace prefixes |
API
sparql_query
Execute a SPARQL SELECT query.
Parameters:
endpoint(str): SPARQL endpoint URLquery(str): SPARQL SELECT querytimeout(int, default=30): Query timeout in secondsoutput_format(str, default="table"): "table" for Markdown, "json" for JSONheaders(dict, optional): HTTP headers for authenticationmax_rows(int, default=1000): Maximum result rows
sparql_ask
Execute a SPARQL ASK query. Returns "true" or "false".
sparql_construct
Execute a SPARQL CONSTRUCT query. Returns RDF triples.
Additional parameters:
output_format(str, default="turtle"): "turtle" or "json"
sparql_describe
Execute a SPARQL DESCRIBE query. Returns RDF description.
sparql_validate
Validate SPARQL query syntax without executing.
sparql_list_graphs
List available named graphs on a SPARQL endpoint.
sparql_get_prefixes
Get commonly used prefixes for a SPARQL endpoint.
Development
git clone https://github.com/daedalus/mcp-sparql.git
cd mcp-sparql
pip install -e ".[test]"
# run tests
pytest
# format
ruff format src/ tests/
# lint + type check
prospector --with-tool ruff --with-tool mypy --with-tool pylint src/
Recommended Servers
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.
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.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.