{
  "markdown": "**mcp-sparql** — MCP server exposing SPARQL query functionalities for LLMs.\n\n[![PyPI](https://img.shields.io/pypi/v/mcp-sparql.svg)](https://pypi.org/project/mcp-sparql/)\n[![Python](https://img.shields.io/pypi/pyversions/mcp-sparql.svg)](https://pypi.org/project/mcp-sparql/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/master/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\nmcp-name: io.github.daedalus/mcp-sparql\n\n## Install\n\n```bash\npip install mcp-sparql\n```\n\n## Usage\n\n### As an MCP Server\n\nAdd to your MCP configuration (e.g., `~/.config/claude/mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"mcp-sparql\": {\n      \"command\": \"mcp-sparql\"\n    }\n  }\n}\n```\n\n### Available Tools\n\n| Tool | Description |\n|------|-------------|\n| `sparql_query` | Execute SPARQL SELECT queries (table or JSON output) |\n| `sparql_ask` | Execute SPARQL ASK queries (boolean result) |\n| `sparql_construct` | Execute SPARQL CONSTRUCT queries (Turtle or JSON-LD) |\n| `sparql_describe` | Execute SPARQL DESCRIBE queries (Turtle or JSON-LD) |\n| `sparql_validate` | Validate SPARQL query syntax without executing |\n| `sparql_list_graphs` | List named graphs on a SPARQL endpoint |\n| `sparql_get_prefixes` | Get common prefixes for a SPARQL endpoint |\n\n### Examples\n\n**Query Wikidata:**\n\n```\nsparql_query:\n  endpoint: \"https://query.wikidata.org/sparql\"\n  query: \"SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q5 . ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = 'en') } LIMIT 5\"\n```\n\n**Check if an entity exists:**\n\n```\nsparql_ask:\n  endpoint: \"https://query.wikidata.org/sparql\"\n  query: \"ASK { wd:Q42 wdt:P31 wd:Q5 }\"\n```\n\n**Validate a query:**\n\n```\nsparql_validate:\n  query: \"SELECT ?s WHERE { ?s ?p ?o }\"\n```\n\n**List named graphs:**\n\n```\nsparql_list_graphs:\n  endpoint: \"https://query.wikidata.org/sparql\"\n```\n\n**Get common prefixes:**\n\n```\nsparql_get_prefixes:\n  endpoint: \"https://query.wikidata.org/sparql\"\n```\n\n### Resources\n\n| Resource | URI | Description |\n|----------|-----|-------------|\n| Common Prefixes | `sparql://common-prefixes` | Standard SPARQL namespace prefixes |\n\n## API\n\n### `sparql_query`\n\nExecute a SPARQL SELECT query.\n\n**Parameters:**\n\n- `endpoint` (str): SPARQL endpoint URL\n- `query` (str): SPARQL SELECT query\n- `timeout` (int, default=30): Query timeout in seconds\n- `output_format` (str, default=\"table\"): \"table\" for Markdown, \"json\" for JSON\n- `headers` (dict, optional): HTTP headers for authentication\n- `max_rows` (int, default=1000): Maximum result rows\n\n### `sparql_ask`\n\nExecute a SPARQL ASK query. Returns \"true\" or \"false\".\n\n### `sparql_construct`\n\nExecute a SPARQL CONSTRUCT query. Returns RDF triples.\n\n**Additional parameters:**\n\n- `output_format` (str, default=\"turtle\"): \"turtle\" or \"json\"\n\n### `sparql_describe`\n\nExecute a SPARQL DESCRIBE query. Returns RDF description.\n\n### `sparql_validate`\n\nValidate SPARQL query syntax without executing.\n\n### `sparql_list_graphs`\n\nList available named graphs on a SPARQL endpoint.\n\n### `sparql_get_prefixes`\n\nGet commonly used prefixes for a SPARQL endpoint.\n\n## Development\n\n```bash\ngit clone https://github.com/daedalus/mcp-sparql.git\ncd mcp-sparql\npip install -e \".[test]\"\n\n# run tests\npytest\n\n# format\nruff format src/ tests/\n\n# lint + type check\nprospector --with-tool ruff --with-tool mypy --with-tool pylint src/\n```\n",
  "bytes": 3357,
  "sha": "ce01bad9df4c50197104d34062ca0058b9c40605315891ced851083b0cb77f69",
  "repo_slug": "daedalus/mcp-sparql",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_daedalus_mcp_sparql_dfb14608/readme"
}