Home / MCP / RDF Explorer MCP Server

RDF Explorer MCP Server

Provides a conversational interface to explore RDF graphs via local Turtle data or SPARQL endpoints.

python
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "rdf_explorer": {
            "command": "C:\\\\path\\\\to\\\\venv\\\\Scripts\\\\python.exe",
            "args": [
                "C:\\\\path\\\\to\\\\server.py",
                "--triple-file",
                "your_file.ttl"
            ]
        }
    }
}

RDF Explorer is an MCP server that provides a conversational interface to explore and analyze RDF (Turtle) knowledge graphs. It supports working with a local Turtle file or querying a remote SPARQL endpoint, making graph exploration and data analysis accessible to AI applications and research workflows.

How to use

You interact with RDF Explorer through an MCP client to run SPARQL queries, perform full-text searches, inspect graph structure, and generate reports. The server can operate using a local RDF Turtle file or connect to a remote SPARQL endpoint. Start in the mode that matches your data source, then issue natural language prompts or predefined prompts to retrieve results, statistics, or relationship queries. Use the dedicated prompts to analyze graph structure, find relationships for a subject, or convert a text prompt into a SPARQL query for execution.

How to install

{
  "mcpServers": {
    "rdf_explorer": {
      "command": "C:\\path\\to\\venv\\Scripts\\python.exe",
      "args": ["C:\\path\\to\\server.py", "--triple-file", "your_file.ttl"]
    }
  }
}

Additional notes and usage tips

To switch to SPARQL Endpoint mode, use the equivalent configuration where you point to a remote SPARQL endpoint instead of a local file. The same MCP entry structure applies; simply replace the triple-file argument with the endpoint configuration when starting the server.

Troubleshooting and common questions

If you encounter connectivity issues, verify that the Python environment is activated and that the path to server.py is correct. Ensure that the specified Turtle file exists and is readable. In endpoint mode, confirm that the SPARQL endpoint URL is reachable and accepts queries. If the server reports an unhealthy triplestore connection, check network access, endpoint availability, and any required authentication.

Security and access considerations

Limit access to the MCP server to trusted applications and clients. If you expose a SPARQL endpoint, apply appropriate access controls and monitor query load to prevent abuse. Store any credentials securely and avoid embedding sensitive information directly in configuration files.

Available tools

execute_on_endpoint

Execute a SPARQL query directly on an external endpoint. Requires endpoint URL and the query string; returns results as a newline-separated string or an error message.

sparql_query

Execute a SPARQL query on the current graph or active external endpoint. Optionally uses a SERVICE clause for federated queries in local mode and returns results as a newline-separated string or an error message.

graph_stats

Calculate and return statistics about the graph in JSON format, such as triple count and unique subjects.

count_triples

Count triples in the graph. Disabled when operating in SPARQL Endpoint Mode; use a custom prompt to obtain results.

full_text_search

Perform a full-text search on the graph or endpoint, avoiding proprietary syntax, and return results as a newline-separated string or an error message.

health_check

Check the health of the triplestore connection and return either Healthy or Unhealthy with details.

get_mode

Return the current mode of RDF Explorer to indicate whether you are exploring a local graph or an endpoint.