|  | 
|  | 1 | +--- | 
|  | 2 | +title: Hypermode Graph MCP | 
|  | 3 | +description: | 
|  | 4 | +  "Connect your Dgraph database to AI coding assistants using the Model Context | 
|  | 5 | +  Protocol for exploratory data analysis and intelligent graph operations" | 
|  | 6 | +mode: "wide" | 
|  | 7 | +sidebarTitle: "Graph MCP" | 
|  | 8 | +"og:title": "Graph MCP" | 
|  | 9 | +--- | 
|  | 10 | + | 
|  | 11 | +## Overview | 
|  | 12 | + | 
|  | 13 | +The Hypermode Graph MCP (Model Context Protocol) server enables seamless | 
|  | 14 | +integration between your graph database and AI coding assistants like Claude | 
|  | 15 | +Desktop, Cursor, a nd other MCP-compatible tools. Two MCP endpoints are | 
|  | 16 | +available with common tools for AI coding assistants: `mcp` – a server that | 
|  | 17 | +provides tools and data from your Dgraph cluster · `mcp-ro` – a server that | 
|  | 18 | +provides tools and data from your Dgraph cluster in read-only mode | 
|  | 19 | + | 
|  | 20 | +<Note> | 
|  | 21 | +  **What is MCP?** The Model Context Protocol is an open standard that enables | 
|  | 22 | +  developers to build secure, two-way connections between their data sources and | 
|  | 23 | +  AI-powered tools. Think of it as a universal connector that allows AI | 
|  | 24 | +  assistants to understand and interact with your graph data. | 
|  | 25 | +</Note> | 
|  | 26 | + | 
|  | 27 | +## Why use Hypermode Graph MCP? | 
|  | 28 | + | 
|  | 29 | +### For exploratory data analysis | 
|  | 30 | + | 
|  | 31 | +- **Interactive graph exploration**: Query your knowledge graphs using natural | 
|  | 32 | +  language through your AI assistant | 
|  | 33 | +- **Pattern Discovery**: Let AI help identify relationships, clusters, and | 
|  | 34 | +  anomalies in your graph data | 
|  | 35 | +- **Dynamic schema understanding**: AI assistants can introspect your graph | 
|  | 36 | +  structure and suggest optimal queries | 
|  | 37 | +- **Real-time insights**: Get immediate answers about your data without writing | 
|  | 38 | +  complex DQL queries | 
|  | 39 | + | 
|  | 40 | +### For AI coding assistants | 
|  | 41 | + | 
|  | 42 | +- **Context-aware development**: Your coding assistant understands your graph | 
|  | 43 | +  schema and data patterns | 
|  | 44 | +- **Intelligent query generation**: AI can write and optimize DQL queries based | 
|  | 45 | +  on your specific use case | 
|  | 46 | +- **Schema evolution support**: Get suggestions for schema changes and | 
|  | 47 | +  migrations | 
|  | 48 | +- **Debugging assistance**: AI can help troubleshoot graph queries and | 
|  | 49 | +  performance issues | 
|  | 50 | + | 
|  | 51 | +## Architecture | 
|  | 52 | + | 
|  | 53 | +The Dgraph MCP server follows the standard MCP architecture: | 
|  | 54 | + | 
|  | 55 | +```mermaid | 
|  | 56 | +graph LR | 
|  | 57 | +    A[AI Assistant<br/>Claude/Cursor] --> B[MCP Client] | 
|  | 58 | +    B --> C[Dgraph MCP Server] | 
|  | 59 | +    C --> D[Hypermode Graph] | 
|  | 60 | +    C --> E[Local Dgraph Cluster] | 
|  | 61 | +``` | 
|  | 62 | + | 
|  | 63 | +**Components:** | 
|  | 64 | + | 
|  | 65 | +- **MCP Host**: Your AI-powered application (Claude Desktop, IDE with AI | 
|  | 66 | +  features) | 
|  | 67 | +- **MCP Client**: Protocol client that maintains connection with the Dgraph | 
|  | 68 | +  server | 
|  | 69 | +- **Dgraph MCP Server**: Exposes graph capabilities through standardized MCP | 
|  | 70 | +  interface | 
|  | 71 | +- **Graph Database**: Your Dgraph cluster (local or on Hypermode) | 
|  | 72 | + | 
|  | 73 | +## MCP server types | 
|  | 74 | + | 
|  | 75 | +Dgraph provides two MCP server variants to match your security and usage | 
|  | 76 | +requirements: | 
|  | 77 | + | 
|  | 78 | +### Standard MCP server (`mcp`) | 
|  | 79 | + | 
|  | 80 | +- **Full Access**: Read and write operations on your graph | 
|  | 81 | +- **Use Cases**: Development environments, data modeling, schema evolution | 
|  | 82 | +- **Capabilities**: Query execution, mutations, schema modifications, namespace | 
|  | 83 | +  management | 
|  | 84 | + | 
|  | 85 | +### Read-only MCP server (`mcp-ro`) | 
|  | 86 | + | 
|  | 87 | +- **Safe Exploration**: Query-only access to your graph data | 
|  | 88 | +- **Use Cases**: Production analysis, reporting, exploratory data analysis | 
|  | 89 | +- **Capabilities**: DQL queries, schema introspection, data visualization | 
|  | 90 | +  support | 
|  | 91 | + | 
|  | 92 | +<Warning> | 
|  | 93 | +  Choose the read-only server (`mcp-ro`) for production environments or when | 
|  | 94 | +  working with sensitive data to prevent accidental modifications. | 
|  | 95 | +</Warning> | 
|  | 96 | + | 
|  | 97 | +## Setup guide | 
|  | 98 | + | 
|  | 99 | +When using Hypermode Graphs, the MCP configuration is available on the graph | 
|  | 100 | +details screen in the console: | 
|  | 101 | + | 
|  | 102 | +<Steps> | 
|  | 103 | +<Step title="Access Graph Console"> | 
|  | 104 | +Navigate to your Hypermode workspace and select your graph instance. | 
|  | 105 | +</Step> | 
|  | 106 | + | 
|  | 107 | +<Step title="Copy MCP Configuration"> | 
|  | 108 | +  From the graph details screen, copy the provided MCP configuration. | 
|  | 109 | +</Step> | 
|  | 110 | + | 
|  | 111 | +<Step title="Configure Your AI Assistant"> | 
|  | 112 | +Add the configuration to your AI assistant's settings: | 
|  | 113 | + | 
|  | 114 | +```json | 
|  | 115 | +{ | 
|  | 116 | +  "mcpServers": { | 
|  | 117 | +    "hypermode-graph": { | 
|  | 118 | +      "command": "npx", | 
|  | 119 | +      "args": [ | 
|  | 120 | +        "mcp-remote", | 
|  | 121 | +        "https://<graph-workspace>.hypermode.host/mcp/sse", | 
|  | 122 | +        "--header", | 
|  | 123 | +        "Authorization: Bearer <bearer-token>" | 
|  | 124 | +      ] | 
|  | 125 | +    } | 
|  | 126 | +  } | 
|  | 127 | +} | 
|  | 128 | +``` | 
|  | 129 | + | 
|  | 130 | +</Step> | 
|  | 131 | +</Steps> | 
|  | 132 | + | 
|  | 133 | +## Available Capabilities | 
|  | 134 | + | 
|  | 135 | +```mermaid | 
|  | 136 | +graph TD | 
|  | 137 | +    subgraph TopRow [" "] | 
|  | 138 | +        direction LR | 
|  | 139 | +        subgraph Client ["MCP Client"] | 
|  | 140 | +            C1["Invokes Tools"] | 
|  | 141 | +            C2["Queries for Resources"] | 
|  | 142 | +            C3["Interpolates Prompts"] | 
|  | 143 | +        end | 
|  | 144 | +
 | 
|  | 145 | +        subgraph Server ["MCP Server"] | 
|  | 146 | +            S1["Exposes Tools"] | 
|  | 147 | +            S2["Exposes Resources"] | 
|  | 148 | +            S3["Exposes Prompt Templates"] | 
|  | 149 | +        end | 
|  | 150 | +
 | 
|  | 151 | +        Client <--> Server | 
|  | 152 | +    end | 
|  | 153 | +
 | 
|  | 154 | +    subgraph BottomRow [" "] | 
|  | 155 | +        direction LR | 
|  | 156 | +        subgraph Tools ["Tools"] | 
|  | 157 | +            direction TB | 
|  | 158 | +            T1["Functions and tools that<br/>can be invoked by the<br/>client"] | 
|  | 159 | +            T2["Retrieve / search"] | 
|  | 160 | +            T3["Send a message"] | 
|  | 161 | +            T4["Update DB records"] | 
|  | 162 | +        end | 
|  | 163 | +
 | 
|  | 164 | +        subgraph Resources ["Resources"] | 
|  | 165 | +            direction TB | 
|  | 166 | +            R1["Read-only data or<br/>exposed by the server"] | 
|  | 167 | +            R2["Files"] | 
|  | 168 | +            R3["Database Records"] | 
|  | 169 | +            R4["API Responses"] | 
|  | 170 | +        end | 
|  | 171 | +
 | 
|  | 172 | +        subgraph Templates ["Prompt Templates"] | 
|  | 173 | +            direction TB | 
|  | 174 | +            P1["Pre-defined templates<br/>for AI interactions"] | 
|  | 175 | +            P2["Document Q&A"] | 
|  | 176 | +            P3["Transcript Summary"] | 
|  | 177 | +            P4["Output as JSON"] | 
|  | 178 | +        end | 
|  | 179 | +    end | 
|  | 180 | +
 | 
|  | 181 | +    TopRow --> BottomRow | 
|  | 182 | +
 | 
|  | 183 | +    classDef clientBox fill:#f9f9f9,stroke:#d4b896,stroke-width:2px,color:#000 | 
|  | 184 | +    classDef serverBox fill:#e8dcc6,stroke:#d4b896,stroke-width:2px,color:#000 | 
|  | 185 | +    classDef sectionHeader fill:#8b4513,color:#fff,font-weight:bold | 
|  | 186 | +    classDef description fill:#e8dcc6,stroke:#d4b896,stroke-width:1px,color:#000 | 
|  | 187 | +    classDef example fill:#e8dcc6,stroke:#d4b896,stroke-width:1px,color:#000 | 
|  | 188 | +
 | 
|  | 189 | +    class Client clientBox | 
|  | 190 | +    class Server serverBox | 
|  | 191 | +    class T1,R1,P1 description | 
|  | 192 | +    class T2,T3,T4,R2,R3,R4,P2,P3,P4 example | 
|  | 193 | +``` | 
|  | 194 | + | 
|  | 195 | +### Tools | 
|  | 196 | + | 
|  | 197 | +Interactive tools for graph operations: | 
|  | 198 | + | 
|  | 199 | +The MCP servers provide the following tools: | 
|  | 200 | + | 
|  | 201 | +#### `get_schema` | 
|  | 202 | + | 
|  | 203 | +Retrieve the current schema of your graph database. | 
|  | 204 | + | 
|  | 205 | +#### `run_query` | 
|  | 206 | + | 
|  | 207 | +Run a DQL query on your graph database. | 
|  | 208 | + | 
|  | 209 | +**Parameters:** | 
|  | 210 | + | 
|  | 211 | +- `query` (string): DQL query to execute | 
|  | 212 | + | 
|  | 213 | +#### `run_mutation` | 
|  | 214 | + | 
|  | 215 | +Run a DQL mutation on your graph database. | 
|  | 216 | + | 
|  | 217 | +**Parameters:** | 
|  | 218 | + | 
|  | 219 | +- `mutation` (string): DQL mutation to execute | 
|  | 220 | + | 
|  | 221 | +#### `alter_schema` | 
|  | 222 | + | 
|  | 223 | +Modify the DQL schema of your graph database. | 
|  | 224 | + | 
|  | 225 | +**Parameters:** | 
|  | 226 | + | 
|  | 227 | +- `schema` (string): DQL schema to apply | 
|  | 228 | + | 
|  | 229 | +#### `get_common_queries` | 
|  | 230 | + | 
|  | 231 | +Provides reference queries to aide in query syntax. | 
|  | 232 | + | 
|  | 233 | +### Resources | 
|  | 234 | + | 
|  | 235 | +The MCP server exposes your graph data as accessible resources: | 
|  | 236 | + | 
|  | 237 | +#### `dgraph://schema` | 
|  | 238 | + | 
|  | 239 | +The current Dgraph DQL schema. | 
|  | 240 | + | 
|  | 241 | +#### `dgraph://common_queries` | 
|  | 242 | + | 
|  | 243 | +Pre-built query patterns for common operations. | 
|  | 244 | + | 
|  | 245 | +### Prompts | 
|  | 246 | + | 
|  | 247 | +Pre-configured prompt templates for common graph operations: | 
|  | 248 | + | 
|  | 249 | +- **Data Exploration**: "Analyze the structure and relationships in this graph" | 
|  | 250 | +- **Performance Optimization**: "Suggest improvements for this query | 
|  | 251 | +  performance" | 
|  | 252 | +- **Schema Design**: "Help design an optimal schema for this data model" | 
|  | 253 | +- **Migration Planning**: "Plan a migration strategy for this schema change" | 
|  | 254 | + | 
|  | 255 | +#### `quickstart_prompt` | 
|  | 256 | + | 
|  | 257 | +A quickstart prompt for getting started with graph MCP. | 
|  | 258 | + | 
|  | 259 | +## Example workflows | 
|  | 260 | + | 
|  | 261 | +### Exploratory data analysis | 
|  | 262 | + | 
|  | 263 | +<iframe | 
|  | 264 | +  src="https://www.youtube.com/embed/cKJuzAs5Www" | 
|  | 265 | +  title="Hypermode Graph MCP With Claude Desktop" | 
|  | 266 | +  frameborder="0" | 
|  | 267 | +  allow="accelerometer; autoplay; clipboard-write; | 
|  | 268 | +encrypted-media; gyroscope; picture-in-picture" | 
|  | 269 | +  allowfullscreen | 
|  | 270 | +  style={{ aspectRatio: "16 / 9", width: "100%" }} | 
|  | 271 | +></iframe> | 
|  | 272 | + | 
|  | 273 | +<Steps> | 
|  | 274 | +<Step title="Understand your data"> | 
|  | 275 | +Ask your AI assistant: "What does my graph schema look like and what are the main entity types?" | 
|  | 276 | +</Step> | 
|  | 277 | + | 
|  | 278 | +<Step title="Discover Patterns"> | 
|  | 279 | +  "Find all users who have more than 10 connections and show me their | 
|  | 280 | +  relationship patterns." | 
|  | 281 | +</Step> | 
|  | 282 | + | 
|  | 283 | +<Step title="Analyze Distributions"> | 
|  | 284 | +  "What's the distribution of node types in my graph? Are there any outliers or | 
|  | 285 | +  interesting clusters?" | 
|  | 286 | +</Step> | 
|  | 287 | + | 
|  | 288 | +<Step title="Performance Insights"> | 
|  | 289 | +"Which queries are running slowly and how can I optimize them?" | 
|  | 290 | +</Step> | 
|  | 291 | +</Steps> | 
|  | 292 | + | 
|  | 293 | +### AI-assisted development | 
|  | 294 | + | 
|  | 295 | +<Steps> | 
|  | 296 | +<Step title="Schema design"> | 
|  | 297 | +"I want to model a social network with users, posts, and interactions. What's the optimal schema design?" | 
|  | 298 | +</Step> | 
|  | 299 | + | 
|  | 300 | +<Step title="Query Optimization"> | 
|  | 301 | +  "This query is slow: `[paste query]`. How can I improve its performance?" | 
|  | 302 | +</Step> | 
|  | 303 | + | 
|  | 304 | +<Step title="Index Recommendations"> | 
|  | 305 | +  "Based on my query patterns, what indices should I add to improve | 
|  | 306 | +  performance?" | 
|  | 307 | +</Step> | 
|  | 308 | + | 
|  | 309 | +<Step title="Migration Planning"> | 
|  | 310 | +"I need to add a new 'tags' predicate to existing posts. What's the safest migration approach?" | 
|  | 311 | +</Step> | 
|  | 312 | +</Steps> | 
|  | 313 | + | 
|  | 314 | +## Best practices | 
|  | 315 | + | 
|  | 316 | +### Security | 
|  | 317 | + | 
|  | 318 | +- **Use Read-Only Servers**: Default to `mcp-ro` for analysis and exploration | 
|  | 319 | +- **Authentication**: Always use bearer tokens for Hypermode connections | 
|  | 320 | + | 
|  | 321 | +### Development workflow | 
|  | 322 | + | 
|  | 323 | +- **Start with Read-Only**: Begin exploration with `mcp-ro` to understand your | 
|  | 324 | +  data | 
|  | 325 | +- **Iterative Schema Design**: Use AI assistance for gradual schema evolution | 
|  | 326 | +- **Query Testing**: Validate AI-generated queries in development before | 
|  | 327 | +  production | 
|  | 328 | +- **Documentation**: Keep schema documentation updated for better AI | 
|  | 329 | +  understanding | 
|  | 330 | + | 
|  | 331 | +## Community and support | 
|  | 332 | + | 
|  | 333 | +<CardGroup cols={3}> | 
|  | 334 | +<Card title="Discord Community" icon="discord" href="https://discord.gg/hypermode"> | 
|  | 335 | +Join discussions about Graph MCP and get help from the community | 
|  | 336 | +</Card> | 
|  | 337 | + | 
|  | 338 | +<Card | 
|  | 339 | +  title="GitHub Issues" | 
|  | 340 | +  icon="github" | 
|  | 341 | +  href="https://github.com/hypermodeinc/dgraph/issues" | 
|  | 342 | +> | 
|  | 343 | +  Report bugs and request features for the MCP server | 
|  | 344 | +</Card> | 
|  | 345 | + | 
|  | 346 | +<Card title="Documentation" icon="book" href="https://docs.hypermode.com/dgraph"> | 
|  | 347 | +Comprehensive Dgraph documentation and guides | 
|  | 348 | +</Card> | 
|  | 349 | +</CardGroup> | 
|  | 350 | +``` | 
0 commit comments