Chartbrew MCP

Chartbrew + AI agents. MCP server exposing Chartbrew's documented API: teams, connections, datasets, dashboards, charts, live queries, and secure embedding. TypeScript · stdio · restricted/unrestricted tool modes.

Documentation

Chartbrew MCP Server

The Chartbrew MCP server exposes Chartbrew's documented API to AI coding agents and MCP-compatible clients — letting them list and inspect teams, connections, datasets, dashboards, and charts, run live queries, fetch data, manage share policies/tokens for secure embedding, and create or update resources, all through natural language.

Chartbrew MCP Server

TypeScript MCP server built on the official MCP SDK for documented Chartbrew API endpoints.

Chartbrew Docs

Chartbrew Docs

Showcase

Chartbrew MCP in action — managing analytics resources through natural language.

Chartbrew MCP screenshot 1Chartbrew MCP screenshot 2Chartbrew MCP screenshot 3
Chartbrew MCP screenshot 4Chartbrew MCP screenshot 5Chartbrew MCP screenshot 6

Prerequisites

  • Node.js and npm installed (used to install dependencies and build the server).
  • A Chartbrew API key — create one in your Chartbrew account (cloud or self-hosted). See How to create API keys in Chartbrew.
  • For a self-hosted Chartbrew instance, the API base URL of that instance (default http://localhost:4019).
  • An MCP-compatible client to host the server (e.g. Claude Code, Claude Desktop, Cursor, VS Code, Codex, GitHub Copilot, OpenCode, Kimi Code).

Scope

This server only implements operations documented in the official Chartbrew API reference and avoids undocumented behavior.

Implemented resources:

  • Teams: list, get
  • Connections: list, get, test, create, update, delete
  • Datasets: list, get, fetch data, create, update, delete
  • Data Requests: list, run
  • Dashboards (projects): list, get, create, update, delete
  • Charts: get, create, query, delete

Not implemented in this version:

  • Variable binding create/update endpoints

These can be added later if needed.

Authentication

Chartbrew API docs specify Bearer token authentication.

Required header used by this server:

  • Authorization: Bearer <CHARTBREW_API_KEY>

Configuration Options

VariableDescriptionRequired
CHARTBREW_API_KEYChartbrew API key used for Bearer token authenticationYes
CHARTBREW_API_BASE_URLAPI base URL. Use https://api.chartbrew.com for an official Chartbrew cloud account, or your self-hosted URL (default http://localhost:4019; change the port if yours differs)No (default: https://api.chartbrew.com)
CHARTBREW_REQUEST_TIMEOUT_MSRequest timeout in milliseconds to prevent hanging requestsNo (default: 30000)
CHARTBREW_TOOL_MODETool exposure mode. Allowed values: restricted, unrestricted. If unset or set to any value other than unrestricted, the server runs in restricted modeNo (default: restricted)

Tool mode behavior:

  • unrestricted: all implemented tools are available.
  • restricted: only data-retrieval/query tools are available (list/get/fetch/query/run/test). Create/update/delete tools are disabled.

You can provide these values in either of two ways (pick one):

  • .env file in this mcp folder — copy .env-template to .env and fill in the values. The server auto-loads it on startup.
  • The env block of your coding agent's MCP config — set the variables directly in the env object of the server entry (e.g. .mcp.json for Claude Code, or the equivalent MCP config for Codex, GitHub Copilot, OpenCode, Kimi Code, etc.). Use this when you don't want a local .env file.

Install

  1. Change directory to mcp.

  2. Install dependencies:

    npm install
    
  3. Build:

    npm run build
    
  4. Run

npm start

The server uses stdio transport and is intended to be launched by an MCP client host.

Standalone binary (no Node.js required)

Prefer not to install Node.js? Download a prebuilt binary from the Releases page and run it directly. Binaries are provided for:

OSx64 (Intel/AMD)arm64 (Apple Silicon / ARM)
Windowschartbrew-mcp-windows-x64.exechartbrew-mcp-windows-arm64.exe
Linuxchartbrew-mcp-linux-x64chartbrew-mcp-linux-arm64
macOSchartbrew-mcp-darwin-x64chartbrew-mcp-darwin-arm64

Setup:

Releases include both raw binaries and compressed archives (.zip for Windows, .tar.gz for Linux/macOS) — grab the archive for a smaller download, then extract it.

  • Windows: download chartbrew-mcp-windows-x64.zip (or arm64), extract, run the .exe.
  • macOS / Linux: download e.g. chartbrew-mcp-darwin-arm64.tar.gz, extract, then make it executable once: chmod +x chartbrew-mcp-darwin-arm64
  • macOS Gatekeeper: if macOS blocks the unsigned binary, remove the quarantine attribute: xattr -d com.apple.quarantine chartbrew-mcp-darwin-arm64

You do not need a .env file — set configuration through your MCP client's env block (or the OS environment). Example for Claude Desktop / Claude Code (.mcp.json or claude_desktop_config.json):

{
  "mcpServers": {
    "chartbrew": {
      "command": "/absolute/path/to/chartbrew-mcp-darwin-arm64",
      "env": {
        "CHARTBREW_API_KEY": "your-api-key",
        "CHARTBREW_API_BASE_URL": "https://api.chartbrew.com",
        "CHARTBREW_TOOL_MODE": "restricted"
      }
    }
  }
}

Build the binaries yourself

From a checkout, install Bun (the compiler), then:

npm install
npm run build:bin   # writes binaries to dist-bin/

Full setup, Bun install commands, and the Windows cross-compile caveat are in CONTRIBUTING.md.

Add to an MCP client

After npm install and npm run build, register the server with your MCP host. The server runs over stdio via node dist/index.js. Replace <ABSOLUTE_PATH_TO_MCP_DIR> with the absolute path to this mcp directory and set your API key.

Claude Code CLI (claude mcp add)

If you use Claude Code, you can register the server directly from the terminal instead of editing a config file:

claude mcp add chartbrew \
  -e CHARTBREW_API_KEY=your-api-key \
  -e CHARTBREW_API_BASE_URL=https://api.chartbrew.com \
  -e CHARTBREW_TOOL_MODE=restricted \
  -- node <ABSOLUTE_PATH_TO_MCP_DIR>/dist/index.js
  • Use http://localhost:4019 for CHARTBREW_API_BASE_URL on a self-hosted instance (change the port if yours differs).
  • Add -s user (or -s project) to control the scope the server is registered in.
  • Verify with claude mcp list; remove with claude mcp remove chartbrew.

Claude Desktop / Claude Code (claude_desktop_config.json or .mcp.json)

{
  "mcpServers": {
    "chartbrew": {
      "command": "node",
      "args": ["<ABSOLUTE_PATH_TO_MCP_DIR>/dist/index.js"],
      "env": {
        "CHARTBREW_API_KEY": "your-api-key",
        "CHARTBREW_API_BASE_URL": "https://api.chartbrew.com",
        "CHARTBREW_TOOL_MODE": "unrestricted"
      }
    }
  }
}

Cursor / VS Code (settings UI → MCP servers)

{
  "mcpServers": {
    "chartbrew": {
      "command": "node",
      "args": ["<ABSOLUTE_PATH_TO_MCP_DIR>/dist/index.js"],
      "env": {
        "CHARTBREW_API_KEY": "your-api-key"
      }
    }
  }
}

API base URL: use https://api.chartbrew.com for an official Chartbrew cloud account. For a self-hosted instance use your local URL — default http://localhost:4019 (change the port if yours differs).

Notes:

  • CHARTBREW_API_KEY is required. See How to create API keys in Chartbrew.
  • The MCP host launches the server; it does not need to be run manually.
  • The default tool mode is restricted (read/query only). Set CHARTBREW_TOOL_MODE: "unrestricted" to also enable create/update/delete tools.
  • Alternatively, set the env vars in a .env file in the mcp directory and omit the env block.

Available Tools

ToolCategoryDescription
chartbrew_teams_listTeamsList teams available to the authenticated API key
chartbrew_teams_getTeamsGet details for one team by team_id
chartbrew_teams_createTeamsCreate a new team; owner is derived from the authenticated API key
chartbrew_teams_updateTeamsUpdate an existing team by team_id
chartbrew_connection_providers_listConnectionsList all supported connection providers
chartbrew_connections_schema_getConnectionsGet the schema structure for a specific connection
chartbrew_connections_listConnectionsList all connections in a team
chartbrew_connections_getConnectionsGet one connection by connection_id
chartbrew_connections_testConnectionsRun the Chartbrew connection test for a team connection
chartbrew_connections_createConnectionsCreate a new connection in a team
chartbrew_connections_updateConnectionsUpdate an existing connection
chartbrew_connections_update_filesConnectionsUpload SSL CA/cert/key files (base64) for a connection via multipart — for PostgreSQL/MySQL SSL/TLS auth
chartbrew_connections_deleteConnectionsDelete a connection; optionally remove linked datasets
chartbrew_datasets_listDatasetsList datasets for a team
chartbrew_datasets_getDatasetsGet one dataset by dataset_id
chartbrew_datasets_fetch_dataDatasetsRun a dataset request and return the dataset data
chartbrew_datasets_createDatasetsCreate a new dataset in a team
chartbrew_datasets_quick_createDatasetsCreate a dataset and all its data requests in a single call
chartbrew_datasets_updateDatasetsUpdate an existing dataset by dataset_id
chartbrew_datasets_deleteDatasetsDelete a dataset
chartbrew_data_requests_listData RequestsList data requests for a dataset
chartbrew_data_requests_runData RequestsExecute one dataset data request
chartbrew_dashboards_listDashboardsList dashboards for a team
chartbrew_dashboards_getDashboardsGet dashboard details by project_id
chartbrew_dashboards_createDashboardsCreate a new dashboard (Project); private by default
chartbrew_dashboards_updateDashboardsUpdate an existing dashboard by project_id
chartbrew_dashboards_deleteDashboardsDelete a dashboard by project_id
chartbrew_dashboards_create_share_policyDashboardsCreate a share policy for secure sharing via signed URLs
chartbrew_dashboards_update_share_policyDashboardsUpdate a dashboard share policy (params, allow_params, expiration)
chartbrew_dashboards_delete_share_policyDashboardsDelete a share policy for a dashboard
chartbrew_dashboards_generate_share_tokenDashboardsGenerate a signed JWT for secure dashboard embedding
chartbrew_charts_getChartsGet a chart by project_id and chart_id
chartbrew_charts_createChartsCreate a chart inside a dashboard project
chartbrew_charts_quick_createChartsCreate a chart and its chart dataset configurations in a single call
chartbrew_chart_dataset_configs_createChartsAttach a dataset to a chart via ChartDatasetConfig
chartbrew_chart_dataset_configs_updateChartsUpdate an existing ChartDatasetConfig by cdc_id
chartbrew_chart_dataset_configs_deleteChartsDelete a ChartDatasetConfig by cdc_id
chartbrew_charts_queryChartsRun the chart query endpoint and return result data
chartbrew_charts_deleteChartsDelete a chart by project_id and chart_id
chartbrew_charts_create_share_policyChartsCreate a share policy for a chart for secure embedding
chartbrew_charts_update_share_policyChartsUpdate a chart share policy (params, allow_params, expiration)
chartbrew_charts_delete_share_policyChartsDelete a share policy for a chart
chartbrew_charts_generate_share_tokenChartsGenerate a signed JWT for secure chart embedding
chartbrew_charts_get_for_sharingChartsRetrieve a chart for embedding via public access or SharePolicy token

Known documentation limitations reflected in implementation

  • ID types are inconsistent in docs (number vs string), so tool inputs accept strings.
  • Some create/update payload required fields are not consistently documented, so payload is typed as flexible object.
  • Dataset fetch filters query-object encoding is undocumented; this server sends object values as JSON strings.
  • Error response schemas vary by endpoint; parser handles both error and message fields when available.