- Home
- MCP servers
- Cube.js
Cube.js
- python
1
GitHub Stars
python
Language
3 months ago
First Indexed
3 weeks ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"zsembek-cube.js-mcp-server": {
"command": "uvx",
"args": [
"--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",
"CUBEJS_API_BASE_URL": "http://localhost:4000/cubejs-api/v1"
}
}
}
}You can run a FastMCP-based MCP server that exposes Cube.js analytics capabilities to AI assistants and applications. It lets you list cubes, query data, access metadata, and perform async, high-performance analytics against your Cube.js instance while handling authentication and errors gracefully.
How to use
You will run the MCP server locally and connect clients (such as Claude or other compatible MCP clients) to it. Use the available tools to list your Cube.js cubes and execute analytics queries against a specific cube. The server handles token-based authentication and returns structured results that you can wire into your applications.
How to install
Prerequisites: Python 3.8 or higher and a Cube.js instance that is accessible from the server host.
- Install Python dependencies using the project’s requirements file.
pip install -r requirements.txt
- Create and configure environment variables for Cube.js access.
cp .env.example .env
- Edit the environment file to point to your Cube.js instance and API token.
CUBEJS_API_BASE_URL=http://localhost:4000/cubejs-api/v1
CUBEJS_API_TOKEN=your_api_token_here
- Run the MCP server. The server uses the provided Python module to start the MCP service.
python server.py
Additional configuration and usage notes
-
The server supports token-based authentication. Ensure your CUBEJS_API_TOKEN is kept secret and configured in your environment.
-
You can customize how clients connect by configuring MCP client settings to point at the running server. The recommended CLI snippet shows how to integrate a standard MCP client with the server.
-
For automated deployments, you can persist the environment variables in your deployment system and ensure the Cube.js API base URL remains reachable from the MCP server host.
Server configuration and startup example
{
"mcpServers": {
"cubejs": {
"command": "uvx",
"args": [
"--with",
"cubejs-mcp-server @ git+https://github.com/zsembek/Cube.js-MCP-server.git",
"python",
"-m",
"cubejs_mcp.server"
],
"env": {
"CUBEJS_API_BASE_URL": "http://localhost:4000/cubejs-api/v1",
"CUBEJS_API_TOKEN": "your_api_token"
}
}
}
}
Security and best practices
Keep your Cube.js API token secure. Use restricted access for the host running the MCP server and avoid committing tokens to version control. Prefer deploying in controlled environments and use proper network security to protect the Cube.js instance.
Troubleshooting
If you encounter connection or authentication issues, verify that CUBEJS_API_BASE_URL points to a reachable Cube.js instance and that CUBEJS_API_TOKEN is valid and not expired.
Project tools and capabilities
-
list_cubes: Retrieve all cubes with their measures, dimensions, and segments.
-
query_cube: Execute analytics queries against a specific cube with specified measures, dimensions, and optional filters.
Available tools
list_cubes
Retrieves the list of available cubes with their metadata, including measures, dimensions, and segments.
query_cube
Executes a query against a specific cube, returning aggregated analytics results based on chosen measures, dimensions, and filters.