Skip to main content
Glama

GraphDB MCP Server

GraphDB MCP サーバー

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

コンポーネント

ツール

  • スパーククエリ
    • 接続されたGraphDBリポジトリに対してSPARQLクエリを実行する
    • 入力:
      • query (文字列): 実行するSPARQLクエリ
      • graph (文字列、オプション): 対象となる特定のグラフ IRI
      • format (文字列、オプション):レスポンス形式(json、xml、csv)
    • すべてのクエリは読み取り専用モードで実行されます
  • リストグラフ
    • リポジトリで利用可能なすべてのグラフを一覧表示します
    • 入力パラメータは不要

リソース

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

  • クラスリスト( graphdb://<host>/repository/<repo>/classes )
    • リポジトリ内で見つかったすべてのRDFクラスとその数を一覧表示します
  • 述語( graphdb://<host>/repository/<repo>/predicates )
    • すべての述語(プロパティ)とその使用回数を一覧表示します
  • 統計( graphdb://<host>/repository/<repo>/stats )
    • 主語、述語、目的語、およびトリプルの数を提供します
  • サンプルデータ( graphdb://<host>/repository/<repo>/sample )
    • リポジトリからのトリプルのサンプルを表示します
  • グラフコンテンツ( graphdb://<host>/repository/<repo>/graph/<graphUri> )
    • 特定のグラフからのサンプルデータをメタデータとともに提供します

構成

.envファイルを作成することにより、環境変数を使用してサーバーを構成できます。

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

あるいは、エンドポイントとリポジトリをコマンドライン引数として指定することもできます。

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

コマンドライン引数は環境変数よりも優先されます。

Claude Desktopでの使用

このサーバーを Claude Desktop アプリで使用するには、 claude_desktop_config.jsonの「mcpServers」セクションに次の構成を追加します。

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

値を特定の GraphDB 構成に置き換えます。

インストール

# 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

SPARQLクエリの例

このサーバーで実行できる SPARQL クエリの例を次に示します。

  1. オントロジー内のすべてのクラスを一覧表示します。
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. 特定のクラスのすべてのプロパティを一覧表示します。
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. クラス別にインスタンスをカウントします。
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)

ライセンス

このMCPサーバーはGPL-3.0ライセンスに基づいてライセンスされています。つまり、GNU GPL-3.0ライセンスの条件に従って、ソフトウェアを自由に使用、改変、配布することができます。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

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

  1. コンポーネント
    1. ツール
    2. リソース
  2. 構成
    1. Claude Desktopでの使用
      1. インストール
        1. SPARQLクエリの例
          1. ライセンス

            Related MCP Servers

            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server implementation that enables LLMs to interact with NebulaGraph database for graph exploration, supporting schema understanding, queries, and graph algorithms.
              Last updated -
              16
              Python
              Apache 2.0
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.
              Last updated -
              733
              1
              MIT License
              • Apple
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server that enables LLMs to interact with databases (currently MongoDB) through natural language, supporting operations like querying, inserting, deleting documents, and running aggregation pipelines.
              Last updated -
              TypeScript
              MIT License
              • Apple
            • -
              security
              F
              license
              -
              quality
              A Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.
              Last updated -
              9
              TypeScript
              • Apple
              • Linux

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/keonchennl/mcp-graphdb'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server