- Home
- MCP servers
- Cube
Cube
- typescript
4
GitHub Stars
typescript
Language
5 months ago
First Indexed
2 months 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": {
"cubedevinc-cube-mcp-server": {
"command": "npx",
"args": [
"@cube-dev/mcp-server"
],
"env": {
"CUBE_API_KEY": "your_api_key_here",
"EXTERNAL_USER_ID": "user-123",
"INTERNAL_USER_ID": "analyst@yourcompany.com",
"CUBE_CHAT_API_URL": "https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/stream-chat-state"
}
}
}
}You can run a Cube MCP Server to enable real-time chat with Cube’s AI agent for analytics and data exploration. This server acts as a bridge between your MCP client and Cube’s chat API, supporting both internal Cube users and external users with flexible identity options.
How to use
To use the Cube MCP Server with your MCP client, you configure a local MCP server connection that runs via npx and loads the Cube MCP package. You provide the API URL for your agent and an API key for authentication. For internal users, you identify them by their Cube email; for external users, you provide a unique external ID. Once configured, your MCP client can stream real-time chat responses and analytics from the Cube AI agent.
How to install
Prerequisites you need before installing and running the MCP server: Node.js and npm.
-
Ensure Node.js is installed on your machine. You can verify by running
node -vandnpm -v. -
Prepare your MCP client configuration by using the Cube MCP server setup snippet that matches your user type (internal or external). You will run the MCP server via npx with the appropriate environment variables.
Configuration snippets
{
"mcpServers": {
"cube-mcp-server": {
"command": "npx",
"args": ["@cube-dev/mcp-server"],
"env": {
"CUBE_CHAT_API_URL": "https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/stream-chat-state",
"CUBE_API_KEY": "your_api_key_here",
"INTERNAL_USER_ID": "analyst@yourcompany.com"
}
}
}
}
"""json { "mcpServers": { "cube-mcp-server": { "command": "npx", "args": ["@cube-dev/mcp-server"], "env": { "CUBE_CHAT_API_URL": "https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/stream-chat-state", "CUBE_API_KEY": "your_api_key_here", "EXTERNAL_USER_ID": "user-123" } } } }
## Notes on credentials
Obtain the following values to configure the MCP server:\n- CUBE\_CHAT\_API\_URL: Copy the full Chat API URL from your agent settings.\n- CUBE\_API\_KEY: Obtain an API key from your Admin area.\n- User Identity: Choose INTERNAL\_USER\_ID (existing Cube user email) or EXTERNAL\_USER\_ID (custom external identifier).
## Security and identity
Internal users use their Cube account and permissions. External users rely on a custom identifier and can leverage additional attributes, groups, or row-level security as configured for your environment. Protect the API key and limit access to the MCP client configuration in your environment.
## Examples of use
Ask questions like “Show me revenue trends” or “What are our top products?” to receive real-time analytics responses, data visualizations, and SQL queries from Cube’s AI agent.
## Architecture
This is a standard MCP server setup that uses a stdio-based transport. It connects to Cube’s streaming chat API using API key authentication and supports two authentication modes: internal users (existing Cube users) and external users (custom identifiers).
## Tools and endpoints
The server exposes a chat tool to interact with Cube’s AI agent for analytics and data exploration. It streams real-time responses from the agent for interactive analysis.
## Available tools
### chat
Chat with Cube AI agent for analytics and data exploration with real-time streaming responses