{"_id":"@comunica/mcp-sparql-hdt","_rev":"3-1db51dbb9bf7fc43a452bc93770706f8","name":"@comunica/mcp-sparql-hdt","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@comunica/mcp-sparql-hdt","version":"1.0.0","keywords":["mcp","agentic","comunica","sparql","hdt","engine","query","update","sparql engine","sparql query","sparql update","sparql 1.1","sparql 1.2"],"license":"MIT","_id":"@comunica/mcp-sparql-hdt@1.0.0","maintainers":[{"name":"joachimvh","email":"joachimvh@gmail.com"},{"name":"rubensworks","email":"rubensworks@gmail.com"},{"name":"rubenverborgh","email":"ruben@verborgh.org"},{"name":"dexagod","email":"dedecker.ruben@gmail.com"},{"name":"jeswr","email":"jmwright.045@gmail.com"}],"homepage":"https://comunica.dev/","bugs":{"url":"https://github.com/comunica/comunica-feature-mcp/issues"},"bin":{"comunica-mcp-sparql-hdt":"bin/mcp.js"},"dist":{"shasum":"df632db13a9d462a16f573d77bec6033bb6b3fad","tarball":"https://registry.npmjs.org/@comunica/mcp-sparql-hdt/-/mcp-sparql-hdt-1.0.0.tgz","fileCount":6,"integrity":"sha512-vPULPbVuB1kqhQ1qaEg+AKAIO6EOWVsBgsdwTlJaR5/CES7O6XeBYfHtK72GhEdDBPks8egqsYc4koBrDDyQMQ==","signatures":[{"sig":"MEUCIEWzQKjQJtaQInih1iB9MQvR9X2TZdMQo0oMJ0W7oT6HAiEArIRQZWwCR08erEwI/37xZN8rlNTc94uLpqykVvEicAQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12444},"main":"lib/index.js","funding":{"url":"https://opencollective.com/comunica-association","type":"opencollective"},"gitHead":"8a35a73d61cf1066bb1181761884d84d3b932932","scripts":{"build":"yarn run build:ts","build:ts":"node \"../../node_modules/typescript/bin/tsc\""},"typings":"lib/index","_npmUser":{"name":"rubensworks","email":"rubensworks@gmail.com"},"repository":{"url":"git+https://github.com/comunica/comunica-feature-mcp.git","type":"git","directory":"engines/mcp-sparql-hdt"},"_npmVersion":"lerna/9.0.3/node@v22.14.0+arm64 (darwin)","description":"An MCP server for executing SPARQL queries over HDT files","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@comunica/utils-mcp":"^1.0.0","@comunica/query-sparql-hdt":"^5.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mcp-sparql-hdt_1.0.0_1770818639418_0.9716606505821788","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@comunica/mcp-sparql-hdt","version":"1.0.1","keywords":["mcp","agentic","comunica","sparql","hdt","engine","query","update","sparql engine","sparql query","sparql update","sparql 1.1","sparql 1.2"],"license":"MIT","_id":"@comunica/mcp-sparql-hdt@1.0.1","maintainers":[{"name":"joachimvh","email":"joachimvh@gmail.com"},{"name":"rubensworks","email":"rubensworks@gmail.com"},{"name":"rubenverborgh","email":"ruben@verborgh.org"},{"name":"dexagod","email":"dedecker.ruben@gmail.com"},{"name":"jeswr","email":"jmwright.045@gmail.com"}],"homepage":"https://comunica.dev/","bugs":{"url":"https://github.com/comunica/comunica-feature-mcp/issues"},"bin":{"comunica-mcp-sparql-hdt":"bin/mcp.js"},"dist":{"shasum":"f9ec7f9287f247bfc9b5db56f5fe45d19b70bf4b","tarball":"https://registry.npmjs.org/@comunica/mcp-sparql-hdt/-/mcp-sparql-hdt-1.0.1.tgz","fileCount":6,"integrity":"sha512-NlszLqoClUgOszYPoCugkVBdbnZfVWRemykrJrcOTzVQk2BmoMXIZmyYtIXefwRns74YKYFbpm/l0LJRWvi9Ew==","signatures":[{"sig":"MEUCID5Re6XFrxy09fTnwO+pbco2Dp9txNFYRjH89AVQmD7yAiEA9UlPqAGnlVmEpJpZP7dFN0n6MGS3XL4jACYkMMCyFkg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12444},"main":"lib/index.js","funding":{"url":"https://opencollective.com/comunica-association","type":"opencollective"},"gitHead":"e2f1e500c0c5ce24ef6663d1dd9460525ea65594","scripts":{"build":"yarn run build:ts","build:ts":"node \"../../node_modules/typescript/bin/tsc\""},"typings":"lib/index","_npmUser":{"name":"rubensworks","email":"rubensworks@gmail.com"},"repository":{"url":"git+https://github.com/comunica/comunica-feature-mcp.git","type":"git","directory":"engines/mcp-sparql-hdt"},"_npmVersion":"lerna/9.0.7/node@v22.14.0+arm64 (darwin)","description":"An MCP server for executing SPARQL queries over HDT files","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@comunica/utils-mcp":"^1.0.0","@comunica/query-sparql-hdt":"^5.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mcp-sparql-hdt_1.0.1_1778775258864_0.1582818711266054","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@comunica/mcp-sparql-hdt","version":"1.1.0","description":"An MCP server for executing SPARQL queries over HDT files","license":"MIT","funding":{"type":"opencollective","url":"https://opencollective.com/comunica-association"},"homepage":"https://comunica.dev/","repository":{"type":"git","url":"git+https://github.com/comunica/comunica-feature-mcp.git","directory":"engines/mcp-sparql-hdt"},"bugs":{"url":"https://github.com/comunica/comunica-feature-mcp/issues"},"keywords":["mcp","agentic","comunica","sparql","hdt","engine","query","update","sparql engine","sparql query","sparql update","sparql 1.1","sparql 1.2"],"sideEffects":false,"main":"lib/index.js","typings":"lib/index","publishConfig":{"access":"public"},"bin":{"comunica-mcp-sparql-hdt":"bin/mcp.js"},"scripts":{"build":"yarn run build:ts","build:ts":"node \"../../node_modules/typescript/bin/tsc\""},"dependencies":{"@comunica/query-sparql-hdt":"^5.0.1","@comunica/utils-mcp":"^1.1.0"},"gitHead":"4d3c6e5233ec89ceeb45bd2a478652e7f74d5cd2","_id":"@comunica/mcp-sparql-hdt@1.1.0","_nodeVersion":"22.23.2","_npmVersion":"lerna/9.0.7/node@v22.23.2+arm64 (darwin)","dist":{"integrity":"sha512-A2RG0Lvw8ZE7fNjN6cdQig10JRMxIURcS7mF8XR9Gqh/ORVK21PFw5maObId8Jvv7ifzbqDd0HLvw0K0oB7gYA==","shasum":"4d9e01307fee28baf73f48299d09d45ed27ff7fe","tarball":"https://registry.npmjs.org/@comunica/mcp-sparql-hdt/-/mcp-sparql-hdt-1.1.0.tgz","fileCount":6,"unpackedSize":13933,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDRzhTZzADuIWR4FSQwgqH9pR5F1H6Q/EjX28dB5ntc2wIhAO9JB55oXrc4vbyW67Z0x2PJS/wHmPcxRocetCCxu3FN"}]},"_npmUser":{"name":"rubensworks","email":"rubensworks@gmail.com"},"directories":{},"maintainers":[{"name":"joachimvh","email":"joachimvh@gmail.com"},{"name":"rubensworks","email":"rubensworks@gmail.com"},{"name":"rubenverborgh","email":"ruben@verborgh.org"},{"name":"dexagod","email":"dedecker.ruben@gmail.com"},{"name":"jeswr","email":"jmwright.045@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-sparql-hdt_1.1.0_1788267467361_0.42348071177147517"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-11T14:03:59.314Z","modified":"2026-09-01T12:57:47.688Z","1.0.0":"2026-02-11T14:03:59.567Z","1.0.1":"2026-05-14T16:14:19.035Z","1.1.0":"2026-09-01T12:57:47.517Z"},"bugs":{"url":"https://github.com/comunica/comunica-feature-mcp/issues"},"license":"MIT","homepage":"https://comunica.dev/","keywords":["mcp","agentic","comunica","sparql","hdt","engine","query","update","sparql engine","sparql query","sparql update","sparql 1.1","sparql 1.2"],"repository":{"type":"git","url":"git+https://github.com/comunica/comunica-feature-mcp.git","directory":"engines/mcp-sparql-hdt"},"description":"An MCP server for executing SPARQL queries over HDT files","maintainers":[{"name":"joachimvh","email":"joachimvh@gmail.com"},{"name":"rubensworks","email":"rubensworks@gmail.com"},{"name":"rubenverborgh","email":"ruben@verborgh.org"},{"name":"dexagod","email":"dedecker.ruben@gmail.com"},{"name":"jeswr","email":"jmwright.045@gmail.com"}],"readme":"# Comunica MCP SPARQL HDT\n\n[![npm version](https://badge.fury.io/js/%40comunica%2Fmcp-sparql-hdt.svg)](https://www.npmjs.com/package/@comunica/mcp-sparql-hdt)\n\nComunica MCP SPARQL HDT is an [MCP server](https://modelcontextprotocol.io/) for allowing AI agents to execute SPARQL queries over [HDT files](https://www.rdfhdt.org/).\n\nHDT (Header-Dictionary-Triples) is a binary RDF serialization format that enables efficient querying of large RDF datasets with low memory consumption.\n\nIt's main distinguishing features are the following:\n\n* Improves the accuracy of your AI agent's answers by leveraging the power of SPARQL and Knowledge Graphs.\n* Execute [SPARQL 1.2](https://www.w3.org/TR/sparql12-query/) queries over HDT files.\n* Memory-efficient querying of large RDF datasets.\n* Fast query execution over compressed HDT files.\n* Supports local HDT files and remote HDT endpoints.\n\n**[Learn more about Comunica on our website](https://comunica.dev/).**\n\n_Internally, this is a [Comunica module](https://comunica.dev/) that is configured with modules to execute SPARQL queries over HDT files through MCP._\n\n## Supported by\n\nComunica is a community-driven project, sustained by the [Comunica Association](https://comunica.dev/association/).\nIf you are using Comunica, [becoming a sponsor or member](https://opencollective.com/comunica-association) is a way to make Comunica sustainable in the long-term.\n\nOur top sponsors are shown below!\n\n<a href=\"https://opencollective.com/comunica-association/sponsor/0/website\" target=\"_blank\"><img src=\"https://opencollective.com/comunica-association/sponsor/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/comunica-association/sponsor/1/website\" target=\"_blank\"><img src=\"https://opencollective.com/comunica-association/sponsor/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/comunica-association/sponsor/2/website\" target=\"_blank\"><img src=\"https://opencollective.com/comunica-association/sponsor/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/comunica-association/sponsor/3/website\" target=\"_blank\"><img src=\"https://opencollective.com/comunica-association/sponsor/3/avatar.svg\"></a>\n\n## Usage examples\n\nAfter connecting this MCP server to your AI agent (see some examples on how to do this below),\nyour agent can SPARQL query any HDT file that is accessible to you.\n\nFor example, use it to ask:\n\n> Use Comunica SPARQL HDT to query the DBpedia HDT file and find all movies directed by Christopher Nolan.\n\n### Prompt suggestions\n\nIf you want your agent to always use SPARQL for higher accuracy in answers, you can tell it the following:\n\n> When looking up data, always prefer looking them up over Knowledge Graphs via SPARQL, as this is more precise.\n> For large RDF datasets, HDT files provide efficient querying capabilities.\n> Since SPARQL queries can take a while to execute, start producing an approximate answer yourself and show it to me if the SPARQL query takes more than 1 second, but then make the answer more concrete based on the SPARQL query once it finalized, as it will be more accurate.\n\n## Installation\n\nComunica requires [Node.JS](http://nodejs.org/) 14.0 or higher and is tested on OSX and Linux.\n\nThe easiest way to install the client is by installing it from NPM as follows:\n\n```bash\n$ [sudo] npm install -g @comunica/mcp-sparql-hdt\n```\n\nAlternatively, you can install from the latest GitHub sources.\nFor this, please refer to the README of the [Comunica monorepo](https://github.com/comunica/comunica).\nIf you do so, the following examples require replacing `comunica-mcp-sparql-hdt` with `node engines/mcp-sparql-hdt/bin/mcp.js`.\n\n## Connect this MCP server to your agent\n\nBelow, a non-exhaustive list of examples is given to connect this MCP server to your agent.\n\n### Claude Desktop\n\nAfter installing, you can run the MCP server in two modes:\n\n#### Stdio Mode (Recommended for Claude Desktop)\n\nWith stdio mode, the MCP server communicates directly via standard input/output, which is simpler and doesn't require a network port.\n\nAdd the following entry to your `claude_desktop_config.json` file (can be found via Settings / Developer / Edit Config):\n\n```json\n{\n  \"mcpServers\": {\n    \"comunica-sparql-hdt\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"@comunica/mcp-sparql-hdt\",\n        \"--mode\",\n        \"stdio\"\n      ]\n    }\n  }\n}\n```\n\n#### HTTP Mode\n\nAlternatively, you can run the MCP server in HTTP mode, which requires starting the server manually first:\n\n```bash\n$ comunica-mcp-sparql-hdt --mode http --port 3123\n```\n\nThen, add the following entry to your `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"comunica-sparql-hdt\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"mcp-remote\",\n        \"http://localhost:3123/mcp\",\n        \"--allow-http\"\n      ]\n    }\n  }\n}\n```\n\nThen, you can ask Claude something like the following:\n\n> Use Comunica SPARQL HDT to query the DBpedia HDT file at /path/to/dbpedia.hdt and find all movies directed by Christopher Nolan.\n\n#### Default Sources\n\nYou can optionally configure default HDT sources when starting the MCP server. When default sources are provided, the `sources` parameter is hidden from the tools, and all queries automatically use the configured sources.\n\nThis is useful when you want to restrict queries to specific HDT files.\n\n**Stdio Mode with Default Sources:**\n\n```json\n{\n  \"mcpServers\": {\n    \"comunica-sparql-hdt\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"@comunica/mcp-sparql-hdt\",\n        \"--mode\",\n        \"stdio\",\n        \"/path/to/dbpedia.hdt\"\n      ]\n    }\n  }\n}\n```\n\n**HTTP Mode with Default Sources:**\n\n```bash\n$ comunica-mcp-sparql-hdt --mode http --port 3123 /path/to/dbpedia.hdt\n```\n\n### Claude Code\n\n#### Stdio Mode (Recommended for Claude Code)\n\nWith stdio mode, the MCP server communicates directly via standard input/output, which is simpler and doesn't require a network port.\n\n```bash\nclaude mcp add --transport stdio sparql-hdt -- npx -y @comunica/mcp-sparql-hdt --mode stdio\n```\n\nLearn more in the [Claude Code MCP docs](https://code.claude.com/docs/en/mcp),\nsuch as for running this on Windows.\n\n#### HTTP Mode\n\nAlternatively, you can run the MCP server in HTTP mode, which requires starting the server manually first:\n\n```bash\n$ comunica-mcp-sparql-hdt --mode http --port 3123\n```\n\n```bash\nclaude mcp add --transport http sparql-hdt http://localhost:3123/mcp\n```\n\n### ChatGPT\n\nAt the time of writing, ChatGPT only supports HTTP-based MCP servers.\nSo you'll need to run this tool under HTTP mode and expose it to the public Web,\npossibly combined with a reverse proxy and/or OAuth layer.\n\n```bash\n$ comunica-mcp-sparql-hdt --mode http --port 3123\n```\n\n## Query timeouts\n\nSPARQL queries can take arbitrarily long, for example when they are executed over large or slow sources.\nTo make sure that an agent never waits indefinitely, queries are aborted after `--timeout` milliseconds\n(60 seconds by default, `--timeout 0` disables this), after which the agent receives an error\nthat invites it to refine its query.\n\n```bash\n$ comunica-mcp-sparql-hdt --mode http --port 3123 --timeout 300000\n```\n\nComunica offers no way to abort a query that is already running,\nso a timed out query would keep consuming CPU and memory in the background.\nIn http mode, queries are therefore executed inside worker processes that are supervised by a primary process,\nwhich allows such workers to be replaced by a fresh one after a timeout.\nThis also makes the server recover from queries that block the event loop entirely,\nwhich would otherwise make the server unreachable forever.\n\nThe number of workers can be configured with `--workers`, which also determines\nhow many queries can be executed concurrently:\n\n```bash\n$ comunica-mcp-sparql-hdt --mode http --port 3123 --workers 4\n```\n\nIn stdio mode, the server always runs as a single process, since worker processes can not share a single\nstandard input stream, and replacing a worker would invalidate the MCP session of the connected client.\nQueries are still aborted after `--timeout` milliseconds there, but their resources are only reclaimed\nonce the query terminates by itself.\n\n## Available Tools\n\nThis MCP server provides the following tools:\n\n### query_sparql\n\nExecute SPARQL queries over one or more HDT files or remote HDT endpoints, which also includes update queries.\n\n**Parameters:**\n- `query` (required): SPARQL query string\n- `sources` (required, unless default sources are configured): List of HDT file paths or HDT endpoint URLs\n- `queryFormatLanguage` (optional): Query language (e.g., `sparql`, `graphql`). Allows you to specify alternative query languages supported by Comunica\n- `queryFormatVersion` (optional): Query language version (e.g., `1.0`, `1.1`, `1.2`). Specifies the version of the query language to use\n- `baseIRI` (optional): Base IRI for resolving relative IRIs in the query\n- `httpProxy` (optional): HTTP proxy URL (e.g., `http://proxy.example.com:8080`)\n- `httpAuth` (optional): HTTP basic authentication in the format `username:password`\n- `httpTimeout` (optional): HTTP request timeout in milliseconds\n- `httpRetryCount` (optional): Number of HTTP request retries on failure\n\n**Note:** When the MCP server is started with default sources, the `sources` parameter is not available, and all queries automatically use the configured default sources.\n\n### query_sparql_rdf\n\nExecute SPARQL queries over a serialized RDF dataset provided as a string (useful for querying Turtle, N-Triples, or other RDF formats directly).\n\n**Parameters:**\n- `query` (required): SPARQL query string\n- `value` (required): Serialized RDF dataset as a string\n- `mediaType` (required): Media type of the serialized RDF dataset (e.g., `text/turtle`, `application/n-triples`, `application/ld+json`)\n- `fileBaseIRI` (optional): Base IRI for resolving relative IRIs in the RDF dataset\n- `baseIRI` (optional): Base IRI for resolving relative IRIs in the query\n- `queryFormatLanguage` (optional): Query language (e.g., `sparql`, `graphql`). Allows you to specify alternative query languages supported by Comunica\n- `queryFormatVersion` (optional): Query language version (e.g., `1.0`, `1.1`, `1.2`). Specifies the version of the query language to use\n\n## Learn more\n\nThis README just shows the tip of the iceberg!\nLearn more about Comunica's functionalities in the following guides:\n\n* _[*Full documentation*](https://comunica.dev/docs/)_\n","readmeFilename":"README.md"}