Get the FREE Ultimate OpenClaw Setup Guide →

Cube.js

MCP server from zsembek/Cube.js-MCP-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio zsembek-cube.js-mcp-server uvx --with cubejs-mcp-server @ git+https://github.com/zsembek/Cube.js-MCP-server.git python -m cubejs_mcp.server \
  --env CUBEJS_API_TOKEN="your_api_token" \
  --env CUBEJS_API_BASE_URL="http://localhost:4000/cubejs-api/v1"

How to use

This MCP server exposes Cube.js analytics capabilities via the Model Context Protocol, enabling AI assistants and applications to discover available cubes, their measures and dimensions, and to execute analytics queries against Cube.js. Two core tools are provided: a cube discovery function and a query function. The discovery tool lists all cubes with their metadata, including measures, dimensions, and segments, which helps clients understand the data landscape before constructing queries. The query tool executes analytics against a specified cube, allowing you to specify measures, dimensions for grouping, and optional filters to refine results. The server is built on FastMCP for asynchronous handling and supports token-based authentication to protect access to your Cube.js instance.

How to install

Prerequisites:

  • Python 3.8 or higher
  • Access to a Cube.js instance (hosted locally or remotely)
  • Python package manager (pip)

Installation steps:

  1. Clone the repository:
git clone https://github.com/zsembek/Cube.js-MCP-server.git
cd Cube.js-MCP-server
  1. Install Python dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
cp .env.example .env

Edit .env with your Cube.js configuration, for example:

CUBEJS_API_BASE_URL=http://localhost:4000/cubejs-api/v1
CUBEJS_API_TOKEN=your_api_token_here
  1. Run the server (as described in this project, the recommended approach is via uvx in Claude integration):
# Use the recommended CLI entry point for local testing or integration scripts
python server.py

Additional notes

  • Ensure CUBEJS_API_BASE_URL points to your Cube.js API endpoint and that CUBEJS_API_TOKEN is set if your Cube.js instance requires authentication.
  • For Claude or other MCP clients, you can integrate using the provided configuration snippet under Claude Configuration in the README to launch the server automatically.
  • The environment variables can be managed by your deployment platform; avoid committing tokens to version control.
  • If you encounter connection or authentication errors, verify the Cube.js API is reachable from the MCP server host and that the token (if required) is valid.
  • The server supports async query handling; long-running queries will be processed without blocking clients. Consider increasing timeouts if your Cube.js queries are large.

Related MCP Servers

Sponsor this space

Reach thousands of developers