dgraph
A Model Context Protocol (MCP) server implementation for Dgraph graph database, built using the [mcp-go](https://github.com/mark3labs/mcp-go) library.
claude mcp add --transport stdio johnymontana-dgraph-mcp-server go run main.go \ --env DGRAPH_HOST="Dgraph host address (default: localhost:9080)"
How to use
This MCP server provides a bridge between large language model workflows and a Dgraph graph database. It exposes tools that let you run DQL queries, apply mutations, and manage the Dgraph schema. The server communicates over standard input/output to integrate with LLM frameworks that support the MCP protocol. To use it, start the server (for example with go run main.go) with DGRAPH_HOST set to your Dgraph endpoint, then send MCP-style tool invocations to perform queries, mutations, or schema changes. The available tools ensure you can fetch data, mutate the graph, alter the schema, and retrieve the current schema as needed by your LLM-driven workflows.
How to install
Prerequisites:
- Go 1.18 or higher
- Dgraph database (local or remote)
Installation steps:
- Clone the repository:
git clone https://github.com/johnymontana-dgraph-mcp-server.git
cd johnymontana-dgraph-mcp-server
- Install dependencies and build/run:
# Since this project uses Go modules, fetch dependencies and run the server:
go mod download
go run main.go
- Configure the Dgraph host via environment variable when launching the server:
DGRAPH_HOST=localhost:9080 go run main.go
Additional notes
Tips and common issues:
- Ensure Dgraph is reachable at the DGRAPH_HOST address (default localhost:9080).
- If you modify the Dgraph connection, restart the server to pick up the new host.
- The server uses standard input/output for MCP communication; ensure your LLM framework is configured to send and receive MCP messages accordingly.
- If you encounter schema-related errors, verify the schema syntax you pass through dgraph_alter_schema and that it conforms to Dgraph expectations.
- The Dgraph tools (dgraph_query, dgraph_mutate, dgraph_alter_schema) expect parameters in the MCP tool format described in the README.
Related MCP Servers
trpc-agent-go
trpc-agent-go is a powerful Go framework for building intelligent agent systems using large language models (LLMs) and tools.
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
tiger-cli
Tiger CLI is the command-line interface for Tiger Cloud. It includes an MCP server for helping coding agents write production-level Postgres code.
gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
kubernetes
A Model Context Protocol (MCP) server for the Kubernetes API.
gcp-cost
💰 An MCP server that enables AI assistants to estimate Google Cloud costs, powered by Cloud Billing Catalog API and built with Genkit for Go