Skip to content

Claude Code Plugin

The Drizzle Cube plugin for Claude Code lets you query your semantic layer using natural language. Ask questions like “show me revenue by region” and get real results, validated queries, and dashboard configurations.

Install the plugin from the Claude Code marketplace:

Terminal window
claude /install-plugin github:cliftonc/drizzle-cube-plugin

Or add it manually to your Claude Code settings.

The plugin needs to know where your Drizzle Cube API is running. Create a .drizzle-cube.json file in your project:

{
"apiUrl": "http://localhost:4000/cubejs-api/v1",
"apiToken": "your-optional-api-token"
}

Or use the setup command:

/dc-setup

The plugin reads configuration in this order:

  1. .drizzle-cube.json in current project directory
  2. ~/.drizzle-cube/config.json (global)
  3. Environment variables (DRIZZLE_CUBE_API_URL, DRIZZLE_CUBE_API_TOKEN)
CommandDescription
/dc-queryBuild and execute semantic queries with natural language
/dc-debugDebug a query - validate, show SQL, explain plan
/dc-setupConfigure API URL and authentication
/dc-create-cubeGenerate a new cube definition from a Drizzle table
/dc-create-dashboardCreate a dashboard configuration
/dc-add-chartAdd a chart to an existing dashboard

The plugin provides these tools via the Model Context Protocol:

ToolPurpose
drizzle_cube_metaFetch all cubes, measures, dimensions, relationships
drizzle_cube_loadExecute a query and return results
drizzle_cube_dry_runValidate query and preview generated SQL
drizzle_cube_explainGet query execution plan for performance analysis
drizzle_cube_batchExecute multiple queries in parallel
drizzle_cube_configCheck current configuration status
/dc-query show me average happiness by department for the last 3 months

Claude will:

  1. Fetch available cubes from your API
  2. Build the appropriate query
  3. Validate it with a dry-run
  4. Execute and show results
/dc-debug {"measures": ["Sales.revenue"], "dimensions": ["Products.category"]}

Returns:

  • Validation status
  • Generated SQL
  • Execution plan
  • Performance recommendations
/dc-create-dashboard Sales Overview

Claude will ask about your metrics and generate a complete DashboardConfig with KPIs, charts, and tables.

You: Show me total employees and average salary by department

Claude: Uses drizzle_cube_meta to find available cubes, then builds query:

{
measures: ['Employees.count', 'Employees.avgSalary'],
dimensions: ['Departments.name']
}

Validates with drizzle_cube_dry_run, then executes with drizzle_cube_load:

DepartmentTotal EmployeesAverage Salary
Engineering45$125,000
Sales32$85,000
Marketing18$78,000

The plugin also includes reference skills that Claude can use for detailed information:

SkillDescription
dc-query-buildingCubeQuery structure, filters, time dimensions
dc-analysis-configAnalysisConfig for dashboards and persistence
dc-chart-configChart types, axis mapping, display options
dc-cube-definitionHow to define cubes with measures and dimensions
dc-dashboard-configDashboard layout, portlets, filters
  • Claude Code - Install Claude Code
  • Running Drizzle Cube API - Your semantic layer must be accessible
  • Node.js 18+ - For the MCP server

Make sure:

  1. The plugin is installed: claude /plugins
  2. Your API is running and accessible
  3. Configuration file exists with correct URL

Check your API token in .drizzle-cube.json or environment variables.

Verify your Drizzle Cube server is running and has cubes registered. Test with:

Terminal window
curl http://localhost:4000/cubejs-api/v1/meta

The plugin is open source: