Skip to main content
Glama
7BlockLabs

Cube MCP Server

by 7BlockLabs
README.md
# Cube MCP Server

A production-shaped [Model Context Protocol](https://modelcontextprotocol.io) server for **Cube**,
built by **[7Block Labs](https://7blocklabs.com)**. It makes Cube's API usable directly by AI agents
(Claude, ChatGPT, Cursor) — metered to the caller's own key — instead of leaving it to community wrappers.

Built for the Cube team as a working example of the official MCP server we'd ship & launch for you
(OAuth + per-plan metering + listings in the Claude and ChatGPT directories).

```bash
python -m venv .venv && source .venv/bin/activate && pip install -e .
export CUBE_API_TOKEN=...        # your Cube API key
python -m cube_mcp.server                       # stdio
TRANSPORT=http PORT=8000 python -m cube_mcp.server   # remote
```
Claude Code: `claude mcp add --transport http cube http://localhost:8000/mcp`

API: `https://your-deployment.cubecloud.dev/cubejs-api/v1` · docs: https://cube.dev/docs/product/apis-integrations/rest-api/reference · auth: raw JWT in Authorization header (no 'Bearer' prefix); set CUBE_API_BASE to your deployment

## Tools
| Tool | What it does |
|---|---|
| `get_metadata` | List cubes/views with measures, dimensions, segments |
| `run_query` | Run a Cube query and return result rows |
| `get_generated_sql` | Return the SQL Cube generates for a query |

Want this hardened (OAuth, metering) and listed in Claude + ChatGPT? **[7Block Labs](https://7blocklabs.com)**
builds and launches MCP servers for data & API companies. MIT licensed.