KosmoKrator

data

Dgraph MCP Integration for Claude Agent SDK

Connect Dgraph to Claude Agent SDK through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.

9 functions 6 read 2 write API token auth

Connect Dgraph to Claude Agent SDK

Give Claude Agent SDK workflows access to KosmoKrator integrations through a local MCP server.

Add a KosmoKrator stdio MCP server to the Claude Agent SDK options. The gateway is local, scoped to this integration, and starts with --write=deny so Claude Agent SDK can inspect read-capable tools without receiving write access by default.

Dgraph MCP Config for Claude Agent SDK

Use a narrow integration list so the agent does not load unrelated tools.

{
  "mcpServers": {
    "kosmokrator-dgraph": {
      "type": "stdio",
      "command": "kosmo",
      "args": [
        "mcp:serve",
        "--integration=dgraph",
        "--write=deny"
      ]
    }
  }
}

Run the Gateway Manually

kosmokrator mcp:serve --integration=dgraph --write=deny

Why Use KosmoKrator Here

Scoped tools

Expose only Dgraph instead of a broad multi-service tool list.

Local credentials

Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.

Write policy

Start read-only, then opt into ask or allow for trusted workspaces.

Dgraph Tools Visible to Claude Agent SDK

Claude Agent SDK sees stable MCP tool names generated from the Dgraph integration catalog.

MCP toolSource functionTypeDescription
integration__dgraph__dgraph_list_schema dgraph.dgraph_list_schema Read List the full GraphQL schema from Dgraph. Returns all types, their fields, and field types. Useful for understanding the overall data model.
integration__dgraph__dgraph_get_schema dgraph.dgraph_get_schema Read Get the GraphQL schema for a specific type in Dgraph. Returns the type definition including all fields and their types. Provide the type name to inspect.
integration__dgraph__dgraph_list_types dgraph.dgraph_list_types Read List all types defined in the Dgraph GraphQL schema. Returns type names for all user-defined and system types available in the database.
integration__dgraph__dgraph_list_indexes dgraph.dgraph_list_indexes Read List all indexes defined in the Dgraph schema. Returns types with their fields and directives, allowing you to identify indexed fields and their index types (hash, exact, term, fulltext, trigram, etc.).
integration__dgraph__dgraph_get_node dgraph.dgraph_get_node Read Get a specific node from Dgraph by providing its type and ID. Returns the node data including all populated fields. Use the type name as defined in your GraphQL schema.
integration__dgraph__dgraph_mutate dgraph.dgraph_mutate Write Execute a GraphQL mutation to add or update data in Dgraph. Provide the full GraphQL mutation string and optional variables. Supports all mutation operations including add, update, and upsert.
integration__dgraph__dgraph_drop_mutation dgraph.dgraph_drop_mutation Write Execute a GraphQL drop/delete mutation to remove data from Dgraph. Provide the full GraphQL mutation string for deleting nodes and optional variables. Use with caution as this permanently removes data.
integration__dgraph__dgraph_query dgraph.dgraph_query action Execute a custom GraphQL query against Dgraph. Provide the full GraphQL query string and optional variables. Supports all query operations including filtering, pagination, sorting, and nested traversals.
integration__dgraph__dgraph_get_current_user dgraph.dgraph_get_current_user Read Get the current authenticated Dgraph user identity. Verifies the configured bearer token and returns the associated user information including ID, name, and email.

Related Dgraph Pages