GraphDB 模型上下文协议服务器

GraphDB 模型上下文协议服务器

一个为 Ontotext GraphDB 提供只读访问的 Model Context Protocol 服务器,支持 LLM 执行 SPARQL 查询。

快速入门

  1. 克隆仓库并安装依赖: git clone https://github.com/keonchennl/mcp-graphdb.git cd mcp-graphdb yarn install

  2. 构建项目: yarn build

  3. 配置环境变量(创建 .env 文件): GRAPHDB_ENDPOINT=http://localhost:7200 GRAPHDB_REPOSITORY=myRepository GRAPHDB_USERNAME=username GRAPHDB_PASSWORD=password

  4. 启动服务: node dist/index.js http://localhost:7200 myRepository

  5. 使用示例 SPARQL 查询测试服务,例如列出所有类: 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

更多配置和用法请参考 README。