Skip to main content
Glama

@zhoujinandrew/mcp-te-server-v2

MCP (Model Context Protocol) server for ThinkingEngine (TE) analytics platform. Enables AI assistants like Claude to query events, run SQL, manage dashboards, user segments, and operations directly through TE's API.

Quick Setup

Add to your MCP client configuration (e.g. Claude Code ~/.claude.json, Cursor, etc.):

{
  "mcpServers": {
    "mcp-te-v2": {
      "command": "npx",
      "args": ["-y", "@zhoujinandrew/mcp-te-server-v2@latest"],
      "env": {
        "TE_HOST": "ta.thinkingdata.cn"
      }
    }
  }
}

Related MCP server: Sensors MCP Server

Prerequisites

  • Node.js >= 18 (for native fetch support)

  • A TE platform account with access to the target project

For zero-interaction token capture from Chrome:

  1. Open Chrome → View → Developer → Allow JavaScript from Apple Events (one-time toggle)

  2. macOS will prompt for Automation permission on first run — click Allow

Authentication Flow

The server uses a 4-step auth cascade. No manual configuration needed in most cases:

Step

What happens

User action

1. Cache

Reads ~/.te-mcp/token.json

None

2. osascript (macOS)

Extracts ACCESS_TOKEN from an open TE Chrome tab

None

3. Open & Poll (macOS)

Opens TE login page, polls Chrome until token appears

Login to TE

4. Manual Fallback

Opens a local page with a text input for pasting token

Paste token from DevTools

Token is cached at ~/.te-mcp/token.json and reused until it expires (401/403 triggers re-auth automatically).

Manual Token Reset

rm ~/.te-mcp/token.json

Environment Variables

Variable

Required

Default

Description

TE_HOST

Yes

ta.thinkingdata.cn

TE platform hostname

Available Tools

Metadata

Tool

Description

te_list_events

Get event catalog for a project

te_load_event_props

Load filterable properties for events

te_load_measure_props

Load measurable/aggregatable properties

te_list_entities

List analysis entities (user, account, device, etc.)

te_list_metrics

List predefined metrics

te_list_tables

List SQL-queryable tables

te_get_table_columns

Get column definitions for a SQL table

Analysis

Tool

Description

te_list_reports

List all reports

te_get_report

Get report definition details

te_save_report

Create or update a report

te_list_dashboards

List all dashboards

te_get_dashboard

Get dashboard details

te_create_dashboard

Create a new dashboard

te_update_dashboard

Update dashboard layout

te_list_dashboard_reports

List reports in a dashboard

te_query_report_data

Query report data via WebSocket

te_query_sql

Execute SQL queries

Audience & Segments

Tool

Description

te_list_tags

List user tags

te_get_tag

Get tag details and rules

te_list_clusters

List user clusters/segments

te_predict_cluster_count

Predict entity count for cluster conditions

te_list_audience_events

List events for audience targeting

te_load_audience_props

Load audience targeting properties

Operations

Tool

Description

te_create_task

Create and submit an operation task

te_list_tasks

List operation tasks

te_get_task_stats

Get task statistics

te_save_flow

Create or update a flow canvas

te_list_flows

List flow canvases

te_get_flow

Get flow definition

te_list_channels

List push channels

te_get_channel

Get channel details

Helpers

Tool

Description

te_get_space_tree

Get navigation space tree

te_get_timezone

Get project timezone offset

te_list_mark_times

List date annotations/milestones

Development

git clone https://github.com/zjandrew/mcp-te-server-v2.git
cd mcp-te-server-v2
npm install
TE_HOST=ta.thinkingdata.cn node src/index.js

License

MIT

Available Tools

34 tools
te_create_dashboardC

Create a new dashboard

Inputs: projectId (required), dashboardName (required), host.

te_create_taskC

Create and submit an operation task

Inputs: projectId (required), host, taskConfig.

te_get_channelC

Get channel details and meta info

Inputs: channelId (required), projectId (required), host.

te_get_dashboardC

Get dashboard details including its reports

Inputs: projectId (required), dashboardId (required), host.

te_get_flowC

Get flow canvas definition by UUID

Inputs: flowUuid (required), projectId (required), host.

te_get_reportB

Get report definition details (events, eventView, graphConf)

Inputs: reportId (required), projectId (required), host.

te_get_space_treeC

Get navigation space tree (folders, dashboards, reports hierarchy)

Inputs: projectId (required), host.

te_get_table_columnsC

Get column definitions for a specific SQL table

Inputs: table (required), projectId (required), host, schema, +1 more.

te_get_tagC

Get tag details including its rule definition

Inputs: tagId (required), projectId (required), host.

te_get_task_statsC

Get operation task status statistics and performance data

Inputs: projectId (required), host, taskId.

te_get_timezoneC

Get project timezone offset

Inputs: projectId (required), host.

te_list_audience_eventsC

List events available for audience targeting in operations module

Inputs: projectId (required), host.

te_list_channelsC

List push channels for a project

Inputs: projectId (required), host.

te_list_clustersC

List user clusters/segments for a project (from operations module)

Inputs: projectId (required), host.

te_list_dashboard_reportsB

List reports within a dashboard with their definitions

Inputs: projectId (required), dashboardId (required), host.

te_list_dashboardsB

List all dashboards for a project

Inputs: projectId (required), host.

te_list_entitiesC

List analysis entities (user, account, device, etc.) for a project

Inputs: projectId (required), host.

te_list_eventsC

Get event catalog for a project

Inputs: projectId (required), host.

te_list_flowsC

List flow canvases for a project

Inputs: projectId (required), host.

te_list_mark_timesC

List date annotations/milestones for a project

Inputs: projectId (required), host.

te_list_metricsC

List predefined metrics for a project

Inputs: projectId (required), host.

te_list_reportsC

List all reports for a project

Inputs: projectId (required), host.

te_list_tablesB

List SQL-queryable tables for a project (event views, user views, tag tables, etc.)

Inputs: projectId (required), host.

te_list_tagsC

List user tags for a project

Inputs: projectId (required), host.

te_list_tasksC

List operation tasks for a project

Inputs: projectId (required), host, page, pageSize.

te_load_audience_propsC

Load filterable and measurable properties for audience targeting

Inputs: projectId (required), host, events.

te_load_event_propsB

Load filterable properties for events (includes event props and user props)

Inputs: projectId (required), host, events.

te_load_measure_propsC

Load measurable/aggregatable properties for events

Inputs: events (required), projectId (required), host.

te_predict_cluster_countC

Predict the entity count for a given cluster condition

Inputs: projectId (required), host, conditions.

te_query_report_dataB

Query report data via WebSocket (supports event analysis, retention, funnel, etc.)

Inputs: reportId (required), projectId (required), host, endTime, +2 more.

te_query_sqlC

Execute a SQL query via WebSocket and return results

Inputs: sql (required), projectId (required), host.

te_save_flowC

Create or update a flow canvas

Inputs: projectId (required), host, flowConfig.

te_save_reportC

Create or update a report

Inputs: projectId (required), reportName (required), reportModel (required), host, +2 more.

te_update_dashboardC

Update a dashboard (add reports, change layout)

Inputs: reports (required), projectId (required), dashboardId (required), host.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 34 tools

    Disambiguation4/5

    Most tools target a clearly distinct resource+action pair (reports vs dashboards vs flows vs channels vs tasks vs clusters), and descriptions clarify the boundaries. The main confusions are between the property-loading trio (te_load_event_props / te_load_measure_props / te_load_audience_props) and between te_list_events and te_list_audience_events, which are distinguishable only by the 'operations module' context mentioned in descriptions.

    Naming Consistency5/5

    All 34 tools use a uniform te_ prefix plus snake_case verb_noun form (list_/get_/create_/update_/save_/load_/query_/predict_). Minor semantic inconsistency between upsert-style verbs (te_save_report, te_save_flow) and split create/update verbs (te_create_dashboard, te_update_dashboard), but the naming form itself is highly predictable.

    Tool Count2/5

    At 34 tools this is a heavy flat namespace; an agent must scan many near-siblings (5 list_* catalog loaders, 12 report/dashboard tools) with no grouping or namespacing beyond the shared te_ prefix. The breadth of the analytics platform justifies many of them, but the count exceeds what is comfortably navigable in a single flat tool list.

    Completeness3/5

    Read/query coverage is strong (events, props, metrics, tables, reports, dashboards, flows, channels, tasks, tags) and core analysis paths are closed. However, write lifecycle is uneven: there are no delete operations anywhere (reports, dashboards, flows, tasks), tags and channels are read-only, and tasks cannot be updated or cancelled — notable gaps that will cause agent dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers