Sponsored by Deepsite.site

GraphDB MCP Server

Created By
ianormy7 months ago
MCP server tools for GraphDB
Content

GraphDB MCP Server

Overview

A Model Context Protocol (MCP) server implementation that provides database interaction and allows graph exploration capabilities through GraphDB. This server enables running SPARQL graph queries.

Components

Tools

The server offers these core tools:

  • read-graphdb-sparql

    • Execute SPARQL read queries to read data from a repository
    • Input:
      • query (string): The SPARQL query to execute
    • Returns: Query results as JSON serialized array of objects
  • get-graphdb-schema

    • Get a list of the RDF triples that define the ontology for the GraphDB database
    • No input required
    • Returns: JSON serialized list of the RDF triples that define the ontology of the GraphDB database

Usage with Claude Desktop

"mcpServers": {
    "mcp-graphdb": {
        "command": "uvx",
        "args": [
            "D:\\Source\\mcp\\mcp-graphdb",
            "--db-url",
            "http://localhost:7200/repositories/starwars",
            "--schema-file",
            "D:\\Source\\mcp\\mcp-graphdb\\data\\starwars-ontology.trig",
            "--username",
            "ignore",
            "--password",
            "ignore"
        ]
    }
}

Development

Prerequisites

  1. Install uv (Universal Virtualenv):
# Using pip
pip install uv

# Using Homebrew on macOS
brew install uv

# Using cargo (Rust package manager)
cargo install uv
  1. Clone the repository and set up the development environment:
# Clone the repository
git clone https://github.com/ianormy/mcp-graphdb.git
cd mcp-graphdb

# Create and activate virtual environment using uv
uv venv
source .venv/bin/activate  # On Unix/macOS
.venv\Scripts\activate     # On Windows

# Install dependencies
uv pip install -e .

Development Configuration

# Add the server to your claude_desktop_config.json
"mcpServers": {
    "mcp-graphdb": {
        "command": "uvx",
        "args": [
            "D:\\Source\\mcp\\mcp-graphdb",
            "--db-url",
            "http://localhost:7200/repositories/starwars",
            "--schema-file",
            "D:\\Source\\mcp\\mcp-graphdb\\data\\starwars-ontology.trig",
            "--username",
            "ignore",
            "--password",
            "ignore"
        ]
    }
}

Data

This uses a modified version of the Star Wars ontology and some instance data. The original data is maintained by Nick Drummand:

https://nickdrummond.github.io/star-wars-ontology/

Blog Post

I created a blog post about my experiences creating and using this MCP Server:

https://medium.com/@ianormy/mcp-for-graphdb-d3d3cd00cd4e

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Playwright McpPlaywright MCP server
ChatWiseThe second fastest AI chatbot™
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
DeepChatYour AI Partner on Desktop
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
WindsurfThe new purpose-built IDE to harness magic
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
CursorThe AI Code Editor
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Serper MCP ServerA Serper MCP Server
Tavily Mcp
Amap Maps高德地图官方 MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"