Skip to main content
Glama
GraphDB MCP Server

GraphDB MCP Server

by keonchennl

GraphDB MCP-Server

Ein Model Context Protocol-Server, der schreibgeschützten Zugriff auf Ontotext GraphDB bietet. Dieser Server ermöglicht LLMs die Untersuchung von RDF-Graphen und die Ausführung von SPARQL-Abfragen an eine GraphDB-Instanz.

Komponenten

Werkzeuge

  • sparqlQuery

    • Führen Sie SPARQL-Abfragen für das verbundene GraphDB-Repository aus

    • Eingang:

      • query (Zeichenfolge): Die auszuführende SPARQL-Abfrage

      • graph (Zeichenfolge, optional): Spezifischer Graph-IRI zum Ziel

      • format (Zeichenfolge, optional): Antwortformat (JSON, XML, CSV)

    • Alle Abfragen werden im Nur-Lese-Modus ausgeführt

  • listGraphs

    • Listet alle im Repository verfügbaren Graphen auf

    • Keine Eingabeparameter erforderlich

Ressourcen

Der Server bietet mehrere Ansichten der Repository-Daten:

  • Klassenliste ( graphdb://<host>/repository/<repo>/classes )

    • Listet alle im Repository gefundenen RDF-Klassen mit Anzahl auf

  • Prädikate ( graphdb://<host>/repository/<repo>/predicates )

    • Listet alle Prädikate (Eigenschaften) mit Nutzungszählungen auf

  • Statistiken ( graphdb://<host>/repository/<repo>/stats )

    • Bietet Zählungen von Subjekten, Prädikaten, Objekten und Tripeln

  • Beispieldaten ( graphdb://<host>/repository/<repo>/sample )

    • Zeigt eine Auswahl von Tripeln aus dem Repository

  • Graph-Inhalt ( graphdb://<host>/repository/<repo>/graph/<graphUri> )

    • Bietet Beispieldaten aus bestimmten Diagrammen zusammen mit Metadaten

Related MCP server: RDF Explorer

Konfiguration

Sie können den Server mithilfe von Umgebungsvariablen konfigurieren, indem Sie eine .env Datei erstellen:

GRAPHDB_ENDPOINT=http://localhost:7200
GRAPHDB_REPOSITORY=myRepository
GRAPHDB_USERNAME=username
GRAPHDB_PASSWORD=password

Alternativ können Sie den Endpunkt und das Repository als Befehlszeilenargumente angeben:

node dist/index.js http://localhost:7200 myRepository

Die Befehlszeilenargumente haben Vorrang vor Umgebungsvariablen.

Verwendung mit Claude Desktop

Um diesen Server mit der Claude Desktop-App zu verwenden, fügen Sie dem Abschnitt „mcpServers“ Ihrer claude_desktop_config.json die folgende Konfiguration hinzu:

{
  "mcpServers": {
    "graphdb": {
      "command": "node",
      "args": [
        "/path/to/mcp-server-graphdb/dist/index.js"
      ],
      "env": {
        "GRAPHDB_ENDPOINT": "http://localhost:7200",
        "GRAPHDB_REPOSITORY": "myRepository",
        "GRAPHDB_USERNAME": "username",
        "GRAPHDB_PASSWORD": "password"
      }
    }
  }
}

Ersetzen Sie die Werte durch Ihre spezifische GraphDB-Konfiguration.

Installation

# Clone the repository
git clone https://github.com/yourname/mcp-server-graphdb.git
cd mcp-server-graphdb

# Install dependencies
yarn install

# Build the project
yarn build

Beispiele für SPARQL-Abfragen

Hier sind einige Beispiele für SPARQL-Abfragen, die Sie mit diesem Server ausführen können:

  1. Listen Sie alle Klassen in der Ontologie auf:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?class ?label
WHERE {
  { ?class a rdfs:Class } UNION { ?class a owl:Class }
  OPTIONAL { ?class rdfs:label ?label }
}
ORDER BY ?class
  1. Alle Eigenschaften für eine bestimmte Klasse auflisten:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?property ?label ?range
WHERE {
  ?property rdfs:domain <http://example.org/YourClass> .
  OPTIONAL { ?property rdfs:label ?label }
  OPTIONAL { ?property rdfs:range ?range }
}
ORDER BY ?property
  1. Instanzen nach Klasse zählen:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?class (COUNT(?instance) AS ?count)
WHERE {
  ?instance a ?class
}
GROUP BY ?class
ORDER BY DESC(?count)

Lizenz

Dieser MCP-Server ist unter der GPL-3.0-Lizenz lizenziert. Das bedeutet, dass Sie die Software unter den Bedingungen der GNU GPL-3.0-Lizenz frei verwenden, ändern und verbreiten können.

Available Tools

2 tools
listGraphsB

List all graphs in the repository

Inputs: no named parameters.

sparqlQueryA

Execute a read-only SPARQL query against the GraphDB repository

Inputs: query (required), format, graph.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: one lists available graphs, while the other executes queries against them. There is no overlap in functionality, making it impossible to confuse their intended use.

    Naming Consistency4/5

    Both tools use camelCase naming, which is consistent, but they follow different patterns: 'listGraphs' uses a verb-noun structure, while 'sparqlQuery' uses a noun-verb structure. This minor deviation prevents a perfect score.

    Tool Count2/5

    With only two tools, the server feels thin for a GraphDB domain, lacking essential operations like creating, updating, or deleting graphs or data. This minimal set is insufficient for typical database workflows.

    Completeness2/5

    The server covers listing and querying but misses critical CRUD operations for a GraphDB system, such as creating graphs, inserting data, or modifying content. This creates significant gaps that will hinder agent tasks.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that connects AI agents to Apache Jena, enabling them to execute SPARQL queries and updates against RDF data stored in Jena Fuseki.
      8
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      The Model Context Protocol (MCP) server provides a conversational interface for the exploration and analysis of RDF Turtle Knowledge Graph in Local File mode or SPARQL Endpoint.
      56
      MIT
    • A
      license
      C
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server that connects GraphDB's SPARQL endpoints and Ollama models to Claude, enabling Claude to query and manipulate ontology data while leveraging various AI models.
      28
      3
      MIT
    • A
      license
      C
      quality
      Not graded
      maintenance
      A lightweight server implementation of the Model Context Protocol that connects Memgraph database with LLMs, allowing users to interact with graph databases through natural language.
      1
      25
      MIT