KM

keonchennl/mcp-server-graphdb

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

17 stars 8 forks 品質 65 トレンド 21GPL-3.0

Ontotext GraphDB内の特定のリポジトリにあるグラフへのアクセスのみを読み取りできるモデルコンテキストプロトコルサーバー。 LLM が SPARQL クエリを実行できるようにするサーバーです.

概要

Ontotext GraphDBへの読み取り専用アクセスを提供するモデルコンテキストプロトコルサーバー。 このサーバーでは、LM が RDF グラフを探索し、SPARQL クエリを GraphDB インスタンスに対して実行することができます。 - - 接続された GraphDB リポジトリから SPARQL クエリを実行します - 入力: - クエリ(文字列): 実行する SPARQL クエリ - グラフ(文字列、オプション): ターゲットに特定のグラフ IRI を実行します - フォーマット(文字列、オプション): レスポンス形式(json, xml, csv) - 全てのクエリは読み取り専用モードで実行されます - - リポジトリで利用可能なすべてのグラフを一覧表示 - 入力パラメータは必要ありません サーバは、リポジトリデータの複数のビューを提供します。 - (graphdb:// /repository/classes) - リポジトリにあるすべてのRDFクラスをカウントでリストする - (graphdb:// /repository//predicates) - 使用回数を含むすべての述語(properties)をリスト - (graphdb:// /repository//stats) - 被写体、述語、オブジェクト、および三重のカウントを提供 - (graphdb:// /repository//sample) - リポジトリからトリプルのサンプルを表示

概要(AI 翻訳)

Ontotext GraphDBへの読み取り専用アクセスを提供するモデルコンテキストプロトコルサーバー。 このサーバーでは、LM が RDF グラフを探索し、SPARQL クエリを GraphDB インスタンスに対して実行することができます。

コンポーネント

ツール

  • sparqlQuery
  • 接続された GraphDB リポジトリから SPARQL クエリを実行
  • 入力:
  • query (文字列): 実行するSPARQLクエリ
  • [graph] (文字列、オプション): ターゲットに特定のグラフ IRI
  • [format] (文字列、オプション): 応答形式(json、xml、csv)
  • すべてのクエリは読み取り専用モードで実行されます

-リストグラフ

  • リポジトリで利用可能なすべてのグラフをリスト
  • 必要な入力パラメータ無し

リソース

サーバは、リポジトリデータの複数のビューを提供します。

-クラス一覧([graphdb:// /repository/ /classes)

  • リポジトリにあるすべてのRDFクラスをカウントでリストする

  • 注意 ([graphdb:// /repository/ /predicates)

  • 使用回数を含むすべての述語(プロパティ)をリスト

  • 統計 ([graphdb:// /repository/ /stats)

  • 被写体、述語、オブジェクト、および三重のカウントを提供

  • サンプルデータ ([[[T6])])

  • リポジトリからトリプルのサンプルを表示

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

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