app.thoughtspot/mcp-server

MCP Server for ThoughtSpot - provides OAuth authentication and tools for querying data

30NOASSERTIONother

Install

Config snippet generator goes here (5 client tabs)

README

<p align="center">
    <img src="https://cdn.jsdelivr.net/gh/thoughtspot/visual-embed-sdk@main/static/doc-images/images/ThoughtSpot_appicon.png" width=120 align="center" alt="ThoughtSpot" />
</p>

<br/>

# ThoughtSpot MCP Server <br/> ![MCP Server](https://badge.mcpx.dev?type=server 'MCP Server') ![Static Badge](https://img.shields.io/badge/cloudflare%20worker-deployed-green?link=https%3A%2F%2Fdash.cloudflare.com%2F485d90aa3d1ea138ad7ede769fe2c35e%2Fworkers%2Fservices%2Fview%2Fthoughtspot-mcp-server%2Fproduction%2Fmetrics) ![GitHub branch check runs](https://img.shields.io/github/check-runs/thoughtspot/mcp-server/main) [![Coverage Status](https://coveralls.io/repos/github/thoughtspot/mcp-server/badge.svg?branch=main)](https://coveralls.io/github/thoughtspot/mcp-server?branch=main) <a href="https://developer.thoughtspot.com/join-discord" target="_blank"> <img alt="Discord: ThoughtSpot" src="https://img.shields.io/discord/1143209406037758065?style=flat-square&label=Chat%20on%20Discord" /> </a>


The ThoughtSpot MCP Server provides secure OAuth-based authentication and a set of tools for querying and retrieving relevant data from your ThoughtSpot instance. It's a remote server hosted on Cloudflare.

If you do not have a Thoughtspot account, create one for free [here](https://thoughtspot.com/trial).

Learn more about [ThoughtSpot](https://thoughtspot.com).

Join our [Discord](https://developers.thoughtspot.com/join-discord) to get support.

## Table of Contents

- [Connect](#connect)
- [Usage](#usage)
- [Demo video](#demo)
- [Usage in APIs](#usage-in-apis)
  - [OpenAI / ChatGPT](#openai-responses-api)
  - [Claude](#claude-mcp-connector)
  - [Gemini](#gemini-api)
- [Features](#features)
  - [Supported transports](#supported-transports)
- [Manual client registration](#manual-client-registration)
  - [Associating with a ThoughtSpot instance](#associate-with-a-thoughtspot-instance)
- [How to obtain a TS_AUTH_TOKEN](#how-to-obtain-a-ts_auth_token)
- [Troubleshooting](#troubleshooting)
- [Contributing](#contributing)
  - [Local Development](#local-development)
  - [Endpoints](#endpoints)


## Connect

If using a client which supports remote MCPs natively (Claude.ai etc) then just enter:

MCP Server URL: 

```
https://agent.thoughtspot.app/mcp
```
Preferred Auth method: Oauth

- For OpenAI ChatGPT Deep Research, add the URL as:
```js
https://agent.thoughtspot.app/openai/mcp
```

To configure this MCP server in your MCP client (such as Claude Desktop, Windsurf, Cursor, etc.) which do not support remote MCPs, add the following configuration to your MCP client settings:

```json
{
  "mcpServers": {
    "ThoughtSpot": {
      "command": "npx",
      "args": [
         "mcp-remote",
         "https://agent.thoughtspot.app/mcp"
      ]
    }
  }
}
```

See the [Troubleshooting](#troubleshooting) section for any errors / more details.

## Usage

1. Once the connection is done, ThoughtSpot datasources would show under the resources section.
2. Select a datasource (resource), to set the context of your query.
3. Now you could ask analytical questions, which claude can decide to use the relevant ThoughtSpot tools for.

See the video below for a complete demo.

## Demo

Here is a demo video using Claude Desktop.

https://github.com/user-attachments/assets/72a5383a-7b2a-4987-857a-b6218d7eea22

Watch on [Loom](https://www.loom.com/share/433988d98a7b41fb8df2239da014169a?sid=ef2032a2-6e9b-4902-bef0-57df5623963e)

## Usage in APIs

ThoughtSpot's remote MCP server can be used in LLM APIs which support calling MCP tools. 

Here are examples with the common LLM providers:

### OpenAI Responses API

```bash
curl https://api.openai.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
  "model": "gpt-4.1",
  "tools": [
    {
      "type": "mcp",
      "server_label": "thoughtspot",
      "server_url": "https://agent.thoughtspot.app/bearer/mcp",
      "headers": {
        "Authorization": "Bearer $TS_AUTH_TOKEN",
        "x-ts-host": "my-thoughtspot-instance.thoughtspot.cloud"
      }
    }
  ],
  "input": "How can I increase my sales ?"
}'
```

More details on how can you use OpenAI API with MCP tool calling can be found [here](https://platform.openai.com/docs/guides/tools-remote-mcp).


### Claude MCP Connector

```bash
curl https://api.anthropic.com/v1/messages \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: mcp-client-2025-04-04" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "max_tokens": 1000,
    "messages": [{
      "role": "user", 
      "content": "How do I increase my sales ?"
    }],
    "mcp_servers": [
      {
        "type": "url",
        "url": "https://agent.thoughtspot.app/bearer/mcp",
        "name": "thoughtspot",
        "authorization_token": "$TS_AUTH_TOKEN@my-thoughtspot-instance.thoughtspot.cloud"
      }
    ]
  }'
```

Note: In the `authorization_token`