docs/content/product/apis-integrations/mcp-server.mdx
Cube MCP (Model Context Protocol) lets MCP-compatible AI clients connect to Cube over HTTPS using OAuth. You don’t need to run a local MCP server or manage API keys.
<InfoBox>The MCP server is available on Premium and Enterprise plans. Users need the Viewer role or higher to interact with the MCP server.
</InfoBox>Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect to external data sources and tools. The Cube MCP Server acts as a bridge between your AI assistant and Cube's analytics platform, allowing you to ask data questions directly from your coding environment.
Cube hosts a remote MCP server endpoint for your tenant. MCP clients connect over HTTPS and authenticate via OAuth.
https://<cube-mcp-server-host>/api/mcphttps://<cube-mcp-server-host>/.well-known/oauthclient_id = cube-mcp-client, scope = mcp-agent-accessBefore enabling Remote MCP, make sure you have:
Remote MCP uses your Cube MCP server host. If the URL isn’t configured, the Remote MCP page will show “Remote MCP configuration is unavailable.”
Go to <Btn>Admin → Remote MCP</Btn> and select:
These defaults are required for the OAuth token exchange.
<Screenshot src="https://lgo0ecceic.ucarecd.net/284e72c6-c536-4a24-b5ae-9c0a9bf0e8b7/"/>claude mcp add --transport http cube-mcp-server https://<cube-mcp-server-host>/api/mcp
/mcp to list available servers.cube-mcp-server and choose Authenticate.https://<cube-mcp-server-host>/api/mcp{
"mcpServers": {
"cube-mcp-server": {
"command": "npx",
"args": ["-y", "mcp-remote", "--transport", "http", "https://<cube-mcp-server-host>/api/mcp"]
}
}
}
Add the Remote MCP endpoint under Tools & MCP Settings, then complete the OAuth flow.
{
"mcpServers": {
"cube-mcp-server": {
"command": "npx",
"args": ["-y", "mcp-remote", "--transport", "http", "https://<cube-mcp-server-host>/api/mcp"]
}
}
}
Preferred (CLI):
codex mcp add cube-mcp-server --url https://<cube-mcp-server-host>/api/mcp
If this is your first time using MCP in Codex, enable the feature in ~/.codex/config.toml:
[features]
rmcp_client = true
Manual setup:
[features]
rmcp_client = true
[mcp_servers."cube-mcp-server"]
url = "https://<cube-mcp-server-host>/api/mcp"
Then run codex mcp login cube-mcp-server to authenticate.
For any MCP-compatible client:
MCP_ALLOWED_REDIRECT_PATTERNS on console-server.The local MCP server runs on the client and talks directly to the Chat API using an API key. Use this for self-hosted or development setups. Remote MCP is recommended for most users.
Basic config example:
{
"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": "[email protected]"
}
}
}
}
For local server details and updates, see the GitHub repo for @cube-dev/mcp-server: cubedevinc/cube-mcp-server.