Skip to content

thoughtspot/mcp-server

Repository files navigation

ThoughtSpot


ThoughtSpot MCP Server
Static Badge GitHub branch check runs

The ThoughtSpot MCP Server is a Cloudflare Worker-based service that exposes Model Context Protocol (MCP) endpoints for interacting with ThoughtSpot data and tools. It provides secure OAuth-based authentication and a set of tools for querying and retrieving relevant data from a ThoughtSpot instance.

Table of Contents

Features

  • OAuth Authentication: Secure endpoints using OAuth flows.
  • MCP Tools:
    • ping: Test connectivity and authentication.
    • getRelevantData: Query ThoughtSpot for relevant data based on a user question, returning answers and optionally a dashboard (Liveboard) link.
  • Cloudflare Worker: Built with Hono and wrangler.
  • Type Safety: Uses zod for schema validation and TypeScript.
  • ThoughtSpot Integration: Uses the @thoughtspot/rest-api-sdk for all data operations.

Project Structure

.
├── src/
│   ├── index.ts                # Main entry point, sets up OAuth and MCP endpoints
│   ├── handlers.ts             # HTTP route handlers (OAuth, root, etc.)
│   ├── utils.ts                # Shared types/utilities
│   └── thoughtspot/
│       ├── relevant-data.ts    # Logic for fetching relevant data/answers
│       ├── thoughtspot-client.ts # Client setup for ThoughtSpot API
│       └── thoughtspot-service.ts # Service functions for questions, answers, liveboards
├── static/                     # Static assets (if any)
├── wrangler.jsonc              # Cloudflare Worker configuration
├── package.json                # Project metadata and scripts
└── README.md                   # This file

Scripts

  • start / dev: Start the worker locally with Wrangler.
  • deploy: Deploy the worker to Cloudflare.
  • cf-typegen: Generate Cloudflare Worker types.
  • format: Format code using biome.
  • lint:fix: Lint and auto-fix code using biome.

Usage

Local Development

  1. Install dependencies:
    npm install
  2. Set up environment variables:
    • Copy .dev.vars and fill in your ThoughtSpot instance URL and access token.
  3. Start the development server:
    npm run dev

Deployment

Deploy to Cloudflare Workers using Wrangler:

npm run deploy

Endpoints

  • /mcp: MCP HTTP Streaming endpoint
  • /sse: Server-sent events for MCP
  • /authorize, /token, /register: OAuth endpoints

Configuration

  • wrangler.jsonc: Configure bindings, secrets, and compatibility.
  • Secrets: Store your secrets securely using Cloudflare secrets.

MCP Server, © ThoughtSpot, Inc. 2025

About

The ThoughtSpot MCP Server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published