A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.hypermode.com/graphs/graph-mcp below:

Graph MCP

OverviewThe Hypermode Graph MCP (Model Context Protocol) server enables integration between your Hypermode Graph and AI coding assistants like Claude Desktop, Cursor, and other MCP-compatible tools. Two MCP endpoints are available with common tools for AI coding assistants: mcp (an endpoint that provides tools and data from your Graph) and mcp-ro (an endpoint that provides tools and data from your Graph in read-only mode). Why use Hypermode Graph MCP? For exploratory data analysis For AI coding assistants ArchitectureThe Hypermode Graph MCP server follows the standard MCP architecture: Components: MCP server typesHypermode Graph provides two MCP server variants to match your security and usage requirements: Standard MCP server (mcp) Read-only MCP server (mcp-ro) Setup guide Running with Hypermode GraphsWhen using Hypermode Graphs, the MCP configuration is available on the graph details screen in the console: Running with local DgraphYou can also run MCP with your local Dgraph instance by starting the Alpha server with the --mcp flag: Starting Dgraph Alpha with MCP
# Start Dgraph Zero
dgraph zero --my=localhost:5080

# Start Dgraph Alpha with MCP enabled
dgraph alpha --my=localhost:7080 --zero=localhost:5080 --mcp
This enables two MCP endpoints on your Alpha server: Configure AI assistant for local Dgraph
{
  "mcpServers": {
    "dgraph-local": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:8080/mcp/sse"]
    },
    "dgraph-local-readonly": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:8080/mcp-ro/sse"]
    }
  }
}
Standalone MCP serverFor development or testing, you can also run a standalone MCP server:
# Run standalone MCP server
dgraph mcp --conn-str="dgraph://localhost:9080"

# Run in read-only mode
dgraph mcp --conn-str="dgraph://localhost:9080" --read-only
For standalone servers, configure your AI assistant with:
{
  "mcpServers": {
    "dgraph-standalone": {
      "command": "dgraph",
      "args": ["mcp", "--conn-str=dgraph://localhost:9080"]
    }
  }
}
Available capabilities ToolsInteractive tools for graph operations: The Hypermode Graph MCP server provide the following tools: get_schemaRetrieve the current schema of your graph database. Example User request:
"What's the current schema for our financial data model?"
Tool call:
{
  "name": "get_schema",
  "arguments": {}
}
Response:
{
  "schema": [
    {
      "predicate": "account_number",
      "type": "string",
      "index": true,
      "tokenizer": ["exact"]
    },
    {
      "predicate": "balance",
      "type": "float"
    },
    {
      "predicate": "amount",
      "type": "float"
    },
    {
      "predicate": "status",
      "type": "string",
      "index": true,
      "tokenizer": ["exact"]
    },
    {
      "predicate": "from_account",
      "type": "uid"
    },
    {
      "predicate": "to_account",
      "type": "uid"
    }
  ]
}
run_queryRun a DQL query on your graph database. Parameters: Example User request:
"Show me all pending transactions and their amounts"
Tool call:
{
  "name": "run_query",
  "arguments": {
    "query": "{
      transactions(func: eq(status, \"pending\")) {
        uid
        amount
        status
        timestamp
        from_account {
          account_number
          balance
        }
        to_account {
          account_number
          balance
        }
      }
    }"
  }
}
Response:
{
  "transactions": [
    {
      "uid": "0x1a",
      "amount": 150.5,
      "status": "pending",
      "timestamp": "2024-06-06T10:30:00Z",
      "from_account": {
        "account_number": "ACC001",
        "balance": 2500.0
      },
      "to_account": {
        "account_number": "ACC002",
        "balance": 1800.0
      }
    }
  ]
}
run_mutationRun a DQL mutation on your graph database. Parameters: Example User request:
"Process a $500 transfer from account ACC001 to account ACC003"
Tool call:
{
  "name": "run_mutation",
  "arguments": {
    "mutation": "{
      \"set\": [
        {
          \"uid\": \"_:txn\",
          \"dgraph.type\": \"Transaction\",
          \"amount\": 500.00,
          \"status\": \"pending\",
          \"timestamp\": \"2024-06-06T11:15:00Z\",
          \"from_account\": {
            \"uid\": \"0x10\"
          },
          \"to_account\": {
            \"uid\": \"0x11\"
          }
        }
      ]
    }"
  }
}
Response:
Mutation completed, 1 UIDs created
alter_schemaModify the DQL schema of your graph database. Parameters: Example User request:
"Add support for transaction fees and currency types to our payment system"
Tool call:
{
  "name": "alter_schema",
  "arguments": {
    "schema": "transaction_fee: float .
      currency: string @index(exact) .
      exchange_rate: float .
      fee_type: string @index(term) ."
  }
}
Response:
Schema updated successfully
get_common_queriesProvides reference queries to aid in query syntax. ResourcesThe MCP server exposes read only data from your graph as resources: dgraph://schemaThe current Dgraph DQL schema. dgraph://common_queriesPre-built query patterns for common operations. PromptsPre-configured prompt templates for common graph operations: quickstart_promptA quickstart prompt for getting started with graph MCP. Here are additional examples of AI assistant interactions with the MCP tools using a financial transaction theme: Complex transaction analysisExample User request:
"Find all high-value transactions over $1000 from the last week and show
which accounts were involved"
Tool call:
{
  "name": "run_query",
  "arguments": {
    "query": "{
      high_value_txns(func: ge(amount, 1000.0))
      @filter(ge(timestamp, \"2024-05-30T00:00:00Z\")) {
        uid
        amount
        timestamp
        status
        from_account {
          account_number
          account_holder
          balance
        }
        to_account {
          account_number
          account_holder
          balance
        }
      }
    }"
  }
}
Response:
{
  "high_value_txns": [
    {
      "uid": "0x2b",
      "amount": 2500.0,
      "timestamp": "2024-06-05T14:22:00Z",
      "status": "completed",
      "from_account": {
        "account_number": "ACC005",
        "account_holder": "Tech Corp Ltd",
        "balance": 45000.0
      },
      "to_account": {
        "account_number": "ACC007",
        "account_holder": "Supplier Inc",
        "balance": 12000.0
      }
    }
  ]
}
Account balance updatesExample User request:
"Update account ACC001's balance to $3000 after processing pending
transactions"
Tool call:
{
  "name": "run_mutation",
  "arguments": {
    "mutation": "{
      \"set\": [
        {
          \"uid\": \"0x10\",
          \"balance\": 3000.00,
          \"last_updated\": \"2024-06-06T11:30:00Z\"
        }
      ]
    }"
  }
}
Response:
Mutation completed, 1 UIDs created
Example workflows Exploratory data analysis AI-assisted development Best practices Security Development workflow Community and support

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4