KM

keonchennl/mcp-server-graphdb

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

17 stars 8 forks 품질 65 트렌드 21GPL-3.0

A Model Context Protocol server that provides read only access to graphs in a certain repository in Ontotext GraphDB. This server enables LLMs to execute SPARQL queries.

개요

A Model Context Protocol server that provides read-only access to Ontotext GraphDB. This server enables LLMs to explore RDF graphs and execute SPARQL queries against a GraphDB instance. - - Execute SPARQL queries against the connected GraphDB repository - Input: - query (string): The SPARQL query to execute - graph (string, optional): Specific graph IRI to target - format (string, optional): Response format (json, xml, csv) - All queries are executed in read-only mode - - Lists all graphs available in the repository - No input parameters required The server provides multiple views of the repository data: - (graphdb:// /repository/ /classes) - Lists all RDF classes found in the repository with counts - (graphdb:// /repository/ /predicates) - Lists all predicates (properties) with usage counts - (graphdb:// /repository/ /stats) - Provides counts of subjects, predicates, objects, and triples - (graphdb:// /repository/ /sample) - Shows a sample of triples from the repository

README

원문 README의 일부입니다. 원문 보기.

GraphDB MCP Server

A Model Context Protocol server that provides read-only access to Ontotext GraphDB. This server enables LLMs to explore RDF graphs and execute SPARQL queries against a GraphDB instance.

Components

Tools

  • sparqlQuery

    • Execute SPARQL queries against the connected GraphDB repository
    • Input:
      • query (string): The SPARQL query to execute
      • graph (string, optional): Specific graph IRI to target
      • format (string, optional): Response format (json, xml, csv)
    • All queries are executed in read-only mode
  • listGraphs

    • Lists all graphs available in the repository
    • No input parameters required

Resources

The server provides multiple views of the repository data:

  • Class List (graphdb:///repository//classes)

    • Lists all RDF classes found in the repository with counts
  • Predicates (graphdb:///repository//predicates)

    • Lists all predicates (properties) with usage counts
  • Statistics (graphdb:///repository//stats)

    • Provides counts of subjects, predicates, objects, and triples
  • Sample Data (graphdb:///repository//sample)

    • Shows a sample of triples from the repository
  • Graph Content (graphdb:///repository//graph/)

    • Provides sample data from specific graphs along with metadata

Configuration

You can configure the server using environment variables by creating a .env file:

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

Alternatively, you can provide the endpoint and repository as command-line arguments:

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

The command-line arguments take precedence over environment variables.

Usage with Claude Desktop

To use this server with the Claude Desktop app, add the following configuration to the “mcpServers” section of your claude_desktop_config.json:

{
  "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"
      }
    }
  }
}

Replace the values with your specific GraphDB configuration.

Installation

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

# Install dependencies
yarn install

# Build the project
yarn build

Example SPARQL Queries

Here are some example SPARQL queries you can run with this server:

  1. List all classes in the ontology:
PREFIX rdf:
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "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" } } } }