About GraphDB MCP Server
GraphDB MCP Server lets MCP clients query and explore a GraphDB repository. It provides read-only SPARQL queries and returns the database ontology as RDF triples.
Key features
- 01Run read-only SPARQL queries
- 02Retrieve repository data as JSON
- 03List ontology-defining RDF triples
Use cases
- 01Querying data in a GraphDB repository
- 02Inspecting a database ontology
- 03Exploring graph data through an MCP client
MCP support
The MCP server exposes tools for executing read-only SPARQL queries and retrieving the GraphDB ontology. Results are returned as JSON-serialized data.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEGraphDB 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.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.