{"_id":"@comunica/mcp-sparql-link-traversal","_rev":"2-2f2793803a03e4643ebf194543aaf3ed","name":"@comunica/mcp-sparql-link-traversal","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@comunica/mcp-sparql-link-traversal","version":"1.0.0","keywords":["mcp","agentic","comunica","sparql","link-traversal","linked-data","engine","query","update","sparql engine","sparql query","sparql update","sparql 1.1","sparql 1.2"],"license":"MIT","_id":"@comunica/mcp-sparql-link-traversal@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-link-traversal":"bin/mcp.js"},"dist":{"shasum":"456ca69ea72a82e72e60c961219599508130435e","tarball":"https://registry.npmjs.org/@comunica/mcp-sparql-link-traversal/-/mcp-sparql-link-traversal-1.0.0.tgz","fileCount":6,"integrity":"sha512-E0EgC5IxotirUiEF1z8cQZjOKAvz1e/SAnSLt/5ctogBEJKmfA7Zl9Lk2qD6VvE3D+v7IWwM/BwcLDSEXkxe6w==","signatures":[{"sig":"MEUCICLUpep0W5tIrh8BvqT7BEGydTT70RhnMCg+jrOF7tH0AiEAoiwZs0mHXv1gXhKeM+K0F3LiY0saBjZG/+0WAdg6zWE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13163},"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-link-traversal"},"_npmVersion":"lerna/9.0.3/node@v22.14.0+arm64 (darwin)","description":"An MCP server for executing SPARQL queries with link traversal capabilities","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@comunica/utils-mcp":"^1.0.0","@comunica/query-sparql-link-traversal":"^0.8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mcp-sparql-link-traversal_1.0.0_1770818639411_0.2561565682064517","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@comunica/mcp-sparql-link-traversal","version":"1.1.0","description":"An MCP server for executing SPARQL queries with link traversal capabilities","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-link-traversal"},"bugs":{"url":"https://github.com/comunica/comunica-feature-mcp/issues"},"keywords":["mcp","agentic","comunica","sparql","link-traversal","linked-data","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-link-traversal":"bin/mcp.js"},"scripts":{"build":"yarn run build:ts","build:ts":"node \"../../node_modules/typescript/bin/tsc\""},"dependencies":{"@comunica/query-sparql-link-traversal":"^0.8.0","@comunica/utils-mcp":"^1.1.0"},"gitHead":"4d3c6e5233ec89ceeb45bd2a478652e7f74d5cd2","_id":"@comunica/mcp-sparql-link-traversal@1.1.0","_nodeVersion":"22.23.2","_npmVersion":"lerna/9.0.7/node@v22.23.2+arm64 (darwin)","dist":{"integrity":"sha512-F5ripDVzDSBXssYXMf6FZsthwCPvXhRS0c4lh3qRhTACeQtgdi9Fn1ZPge6bZw0+2zM6kfxzFnJQNKrdgKqSJw==","shasum":"f622c6c8015d13ebfa537578e90e70c068a2d03a","tarball":"https://registry.npmjs.org/@comunica/mcp-sparql-link-traversal/-/mcp-sparql-link-traversal-1.1.0.tgz","fileCount":6,"unpackedSize":14674,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCij8NU1LHTUnjmB7g+Vw9sghDaTU1b0hyGe1iCXqp5fgIgTUrtQMzgYZuO34lBTQZ8PgePJ6n6c7osQpqw409wlGc="}]},"_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-link-traversal_1.1.0_1788267466192_0.10653801871700197"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-11T14:03:59.318Z","modified":"2026-09-01T12:57:46.522Z","1.0.0":"2026-02-11T14:03:59.540Z","1.1.0":"2026-09-01T12:57:46.331Z"},"bugs":{"url":"https://github.com/comunica/comunica-feature-mcp/issues"},"license":"MIT","homepage":"https://comunica.dev/","keywords":["mcp","agentic","comunica","sparql","link-traversal","linked-data","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-link-traversal"},"description":"An MCP server for executing SPARQL queries with link traversal capabilities","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 Link Traversal\n\n[![npm version](https://badge.fury.io/js/%40comunica%2Fmcp-sparql-link-traversal.svg)](https://www.npmjs.com/package/@comunica/mcp-sparql-link-traversal)\n\nComunica MCP SPARQL Link Traversal is an [MCP server](https://modelcontextprotocol.io/) for allowing AI agents to execute SPARQL queries with link traversal capabilities over decentralized RDF knowledge graphs on the Web.\n\nLink traversal enables querying over interconnected Linked Data by following links between resources during query execution, allowing for dynamic discovery and querying of data across the Web.\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 with automatic link traversal.\n* Dynamically discover and query linked data across the Web.\n* Follow RDF links during query execution to find relevant data.\n* Query over distributed knowledge graphs without prior knowledge of all sources.\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 with link traversal 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 Knowledge Graph that is accessible to you with automatic link traversal.\n\nFor example, use it to ask:\n\n> Use Comunica SPARQL Link Traversal to find information about a person starting from their homepage URL.\n\nThe query engine will automatically follow links to discover related data across multiple sources.\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 with link traversal, as this enables dynamic discovery of data.\n> Link traversal allows queries to follow links between resources to find relevant data without knowing all sources upfront.\n> Since SPARQL queries with link traversal 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-link-traversal\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-link-traversal` with `node engines/mcp-sparql-link-traversal/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-link-traversal\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"@comunica/mcp-sparql-link-traversal\",\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-link-traversal --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-link-traversal\": {\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 Link Traversal to find information about Tim Berners-Lee starting from his homepage.\n\n#### Default Sources\n\nYou can optionally configure default starting points 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 as starting points for link traversal.\n\n**Stdio Mode with Default Sources:**\n\n```json\n{\n  \"mcpServers\": {\n    \"comunica-sparql-link-traversal\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"@comunica/mcp-sparql-link-traversal\",\n        \"--mode\",\n        \"stdio\",\n        \"https://example.org/person/alice\"\n      ]\n    }\n  }\n}\n```\n\n**HTTP Mode with Default Sources:**\n\n```bash\n$ comunica-mcp-sparql-link-traversal --mode http --port 3123 https://example.org/person/alice\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-link-traversal -- npx -y @comunica/mcp-sparql-link-traversal --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-link-traversal --mode http --port 3123\n```\n\n```bash\nclaude mcp add --transport http sparql-link-traversal 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-link-traversal --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-link-traversal --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-link-traversal --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 with link traversal over one or more starting sources, which also includes update queries.\n\n**Parameters:**\n- `query` (required): SPARQL query string\n- `sources` (required, unless default sources are configured): List of starting point URLs for link traversal\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"}