Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Join our [Discord](https://developers.thoughtspot.com/join-discord) to get suppo
- [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)
- [Self hosted](#self-hosted)
- [Stdio support (fallback)](#stdio-support-fallback)
- [How to obtain a TS_AUTH_TOKEN](#how-to-obtain-a-ts_auth_token)
- [Troubleshooting](#troubleshooting)
Expand All @@ -43,6 +46,7 @@ MCP Server URL:
```
https://agent.thoughtspot.app/mcp
```
Preferred Auth method: Oauth

- For OpenAI ChatGPT Deep Research, add the URL as:
```js
Expand Down Expand Up @@ -236,6 +240,14 @@ For API usage, you would the token endpoints with a `secret_key` to generate the
- Streamed HTTP [https://agent.thoughtspot.app/mcp]()


## Manual client registration

For MCP hosts which do not(yet) support Dynamic client registration, or they require statically adding Oauth Client Id etc. Go to [this](https://agent.thoughtspot.app/clients) page, to register a new client and copy the details over.

### Associate with a ThoughtSpot instance

Manual client registration also allows to associate with a specific ThoughtSpot instance, so that your users do not have to enter the Thoughtspot instance URL when doing the authorization flow.

## Self hosted

Use the published docker image to deploy the MCP server in your own environment.
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@modelcontextprotocol/sdk": "^1.20.1",
"@thoughtspot/rest-api-sdk": "^2.13.1",
"agents": "^0.2.14",
"hono": "^4.9.7",
"hono": "^4.10.3",
"rxjs": "^7.8.2",
"yaml": "^2.7.1",
"zod": "^3.24.3",
Expand Down
7 changes: 5 additions & 2 deletions src/oauth-manager/oauth-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@ export interface ApprovalDialogOptions {
* @returns A Response containing the HTML approval dialog
*/
export function renderApprovalDialog(request: Request, options: ApprovalDialogOptions): Response {
const { server, state } = options;
const { server, state, client } = options;
const encodedState = btoa(JSON.stringify(state));
const serverName = sanitizeHtml(server.name);
const mcpLogoUrl = 'https://raw.githubusercontent.com/thoughtspot/mcp-server/refs/heads/main/static/MCP%20Server%20Logo.svg';
const thoughtspotLogoUrl = 'https://avatars.githubusercontent.com/u/8906680?s=200&v=4';
const clientUrl = client?.clientUri;
const tsInstanceUrlMatch = clientUrl?.match(/x-ts-host:(.*)/);
const tsInstanceUrl = tsInstanceUrlMatch ? tsInstanceUrlMatch[1].trim() : '';

const htmlContent = `
<!DOCTYPE html>
Expand Down Expand Up @@ -296,7 +299,7 @@ export function renderApprovalDialog(request: Request, options: ApprovalDialogOp
<form class="approval-form" method="post" action="${new URL(request.url).pathname}" id="approvalForm" autocomplete="off" novalidate>
<div class="form-group">
<label for="instanceUrl" id="instanceUrlLabel">ThoughtSpot Instance URL</label>
<input type="text" id="instanceUrl" name="instanceUrl" placeholder="https://your-instance.thoughtspot.cloud" autocomplete="off">
<input type="text" id="instanceUrl" name="instanceUrl" value="${tsInstanceUrl}" placeholder="https://your-instance.thoughtspot.cloud" autocomplete="off">
<input type="hidden" name="state" value="${encodedState}">
</div>
<div class="approval-subtitle">ThoughtSpot MCP Server will be able to:</div>
Expand Down
Loading