Get the FREE Ultimate OpenClaw Setup Guide →

cube

MCP server from cubedevinc/cube-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 cubedevinc-cube-mcp-server npx @cube-dev/mcp-server \
  --env CUBE_API_KEY="your_api_key_here" \
  --env EXTERNAL_USER_ID="user-123" \
  --env INTERNAL_USER_ID="analyst@yourcompany.com" \
  --env CUBE_CHAT_API_URL="https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/stream-chat-state"

How to use

Cube MCP Server provides a real-time chat-enabled analytics assistant built on Cube's AI agent. It exposes a chat tool that streams responses from the Cube AI agent for analytics, data exploration, and interactive querying. The server authenticates with Cube via API key and uses a streaming Chat API URL to deliver live, stateful conversations. Use the chat tool to ask questions like revenue trends, top products, or exploratory data queries, and receive real-time analytics, visualizations, and SQL guidance as part of the response stream.

How to install

Prerequisites:

  • Node.js installed (recommended version compatible with npx usage)
  • Internet access to fetch @cube-dev/mcp-server from npm registry

Installation steps:

  1. Ensure Node.js and npm are installed on your system.

  2. Create a working directory for your MCP configuration, or use an existing one.

  3. Prepare the mcp configuration file (see mcp_config in this document) and save it as, for example, cube-mcp.config.json.

  4. Start the MCP server via npx using the provided configuration. Example:

    npx @cube-dev/mcp-server --config cube-mcp.config.json

  5. Verify the server starts and the MCP client can connect using the configured mcpServers entry. If using internal or external user IDs, ensure the CUBE_CHAT_API_URL and CUBE_API_KEY are correctly set in the environment for authentication.

Notes:

  • Replace placeholder values in the environment variables with your actual Cube instance details and credentials.
  • Ensure network access to the Cube API URL from the host running the MCP server.

Additional notes

Tips and common issues:

  • Ensure CUBE_CHAT_API_URL is the full endpoint URL for your agent's chat stream API as shown in the Cube admin panel.
  • Use CUBE_API_KEY with appropriate permissions to access the agent's chat API.
  • Choose the appropriate user identity by configuring either INTERNAL_USER_ID or EXTERNAL_USER_ID: INTERNAL uses existing Cube user permissions; EXTERNAL allows custom identifiers for external users.
  • If you encounter authentication errors, double-check API key validity and that the agent URL matches your Cube cloud region and account.
  • The chat tool streams responses; ensure your client/parser handles streaming data to present incremental results.
  • You can switch between internal and external user configurations by setting only the relevant env variable in your deployment.

Related MCP Servers

Sponsor this space

Reach thousands of developers