docs-mintlify/docs/integrations/mcp-server.mdx
Cube MCP (Model Context Protocol) lets MCP-compatible AI clients connect to Cube over HTTPS using OAuth.
<Note>The MCP server is available on Premium and Enterprise plans. Users need the Viewer role or higher to interact with the MCP server.
</Note>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 an 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 MCP, make sure you have:
MCP uses your Cube MCP server host. If the URL isn’t configured, the MCP page will show “MCP configuration is unavailable.”
Go to Admin → MCP Server and use the Deployment Access section to control which deployments MCP clients can reach and where they connect by default:
Deployment access is always intersected with the user's role-based permissions — clients can only reach deployments the authenticated user is allowed to see.
</Note> <Frame> </Frame>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 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:
An MCP client is not locked to a single deployment for the whole session. After connecting, it can discover the deployments and agents you can access and target a specific one on each request.
Three tools work together:
listDeployments — discovery. Returns every deployment you can access via MCP
(already filtered by the admin's deployment-access settings and your permissions) and
each deployment's agents. Use it to find valid deploymentId and agentId values
before calling chat. Every deployment offers an Auto agent (agentId: null) in
addition to any configured agents.chat — accepts two optional selection parameters:
deploymentId — the deployment to use for this request. When omitted, the chat
uses the deployment from the current session (the default resolved at connect time).agentId — the agent to use for this request. When omitted or null, the
deployment's Auto agent is used. Pass a specific agentId to route to a
configured agent.loadQueryResults — paginates through the results of a previous query on the same
deployment context.A typical client workflow:
<Steps> <Step title="Connect"> Complete the OAuth flow. The session is scoped to the tenant default deployment (or the first one you can access). </Step> <Step title="Discover"> Call `listDeployments` to see the available `deploymentId` / `agentId` values. </Step> <Step title="Chat"> Call `chat` with your `input`, optionally passing `deploymentId` and/or `agentId` to target a specific deployment or agent. Omit both to use the session default deployment with its Auto agent. </Step> </Steps>Requests are always validated against the admin's deployment-access settings. A deployment
that is outside the allow-list — or that you don't have permission to see — is rejected
with a 403 Forbidden (Deployment <id> is not available via MCP for this account), so
neither listDeployments nor the chat selection can reach an excluded deployment.
listDeploymentsDeployment <id> is not available via MCP for this account (403): The requested deployment is excluded by the deployment-access allow-list or by the user's permissions. Call listDeployments to see which deployments are reachable, or adjust the allow-list in Admin → MCP Server → Deployment Access.