io.github.daedalus/mcp-sparql

Official registry Other

MCP server exposing SPARQL query functionalities for LLMs

Install

Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).

PYPI package mcp-sparql
Claude Code
claude mcp add mcp-sparql -- uvx mcp-sparql==0.1.0
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "mcp-sparql": {
            "command": "uvx",
            "args": [
                "mcp-sparql==0.1.0"
            ]
        }
    }
}

Documentation

From the project's README on GitHub, refreshed weekly. Links open on GitHub.

Contents
  1. Install
  2. Usage
  3. API
  4. Development

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
ToolDescription
sparql_queryExecute SPARQL SELECT queries (table or JSON output)
sparql_askExecute SPARQL ASK queries (boolean result)
sparql_constructExecute SPARQL CONSTRUCT queries (Turtle or JSON-LD)
sparql_describeExecute SPARQL DESCRIBE queries (Turtle or JSON-LD)
sparql_validateValidate SPARQL query syntax without executing
sparql_list_graphsList named graphs on a SPARQL endpoint
sparql_get_prefixesGet 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
ResourceURIDescription
Common Prefixessparql://common-prefixesStandard SPARQL namespace prefixes

API

sparql_query

Execute a SPARQL SELECT query.

Parameters:

  • endpoint (str): SPARQL endpoint URL
  • query (str): SPARQL SELECT query
  • timeout (int, default=30): Query timeout in seconds
  • output_format (str, default="table"): "table" for Markdown, "json" for JSON
  • headers (dict, optional): HTTP headers for authentication
  • max_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/

Frequently asked questions

What is io.github.daedalus/mcp-sparql?

MCP server exposing SPARQL query functionalities for LLMs

How do I install io.github.daedalus/mcp-sparql?

It runs on your machine. In Claude Code: claude mcp add mcp-sparql -- uvx mcp-sparql==0.1.0. For other clients, paste the JSON configuration from this page into their MCP settings.

Does io.github.daedalus/mcp-sparql need an API key?

Its registry entry lists no required key or secret. Some features may still need an account with the service it connects to.

Is io.github.daedalus/mcp-sparql open source?

Yes. Its code is on GitHub under the MIT license.

Who maintains io.github.daedalus/mcp-sparql?

It is published by daedalus. AI.tn lists it but does not maintain or endorse it.

From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.