ianormy/mcp-graphdb
If you are the rightful owner of mcp-graphdb and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The GraphDB MCP Server is a Model Context Protocol server implementation that facilitates database interaction and graph exploration using GraphDB, enabling the execution of SPARQL graph queries.
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
- Install
uv
(Universal Virtualenv):
# Using pip
pip install uv
# Using Homebrew on macOS
brew install uv
# Using cargo (Rust package manager)
cargo install uv
- 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.