Preset MCP Server Authentication

Prev Next
This feature is available as an add-on to Enterprise plans.

If you have a Starter or Professional subscription, contact us to upgrade.

Overview

The Preset MCP (Model Context Protocol) server allows AI assistants like Claude and ChatGPT to interact with your Preset workspace — listing dashboards, querying datasets, executing SQL, and more.


Prerequisites

  • A Preset account with access to a workspace

  • Your Preset workspace MCP URL:

    https://<workspace-slug>.<region>.app.preset.io/mcp

Auth Method AI Client Plan Requirements
OAuth Claude (Web, Desktop, Code) Free (1 connector), Pro, Max, Team, or Enterprise
OAuth ChatGPT Plus, Pro, Business, Enterprise, or Edu
OAuth Gemini CLI Free
OAuth (confidential client) Gemini Enterprise Team Admin access in Preset Manager to generate client credentials
JWT / Bearer Any (programmatic) Preset API credentials (Token Name + Secret)

Method 1: OAuth (Recommended)

Claude Web (claude.ai) & Claude Desktop

Steps

  1. Open claude.ai in your browser
  2. Expand the sidebar and navigate to Customize
  3. Click on Connectors
  4. Click on the + icon next to the magnifying glass > Add custom connector
  5. Fill in the details:
    • Name: A descriptive name (e.g., My Preset Workspace)
    • URL: Your workspace MCP URL (e.g., https://<workspace-slug>.<region>.app.preset.io/mcp)
  6. Click Add
  7. You'll be redirected to Preset Cloud to obtain an OAuth token. If you're already logged in to Preset, you'll be redirected back to Claude automatically.

Reference: Getting Started with Custom Connectors Using Remote MCP


Claude Code (Terminal)

Claude Code is Anthropic's terminal-based coding assistant. It supports OAuth for MCP servers via the CLI.

Steps

Step 1: Add the MCP server (one time)

claude mcp add --transport http preset-mcp https://<workspace-slug>.<region>.app.preset.io/mcp

Step 2: Launch Claude Code

claude

Step 3: Trigger the OAuth flow

Once inside the Claude Code session, run:

/mcp

This will open a browser window where you can authenticate with Preset. After logging in, the connection will be established and Preset tools will be available in your session.


ChatGPT Web

Step 1: Enable Developer Mode (if needed)

  1. Click on your profile icon at the top left of the ChatGPT page
  2. Select Settings
  3. Go to Apps and Connectors
  4. Scroll down and select Advanced Settings
  5. Enable Developer Mode

Step 2: Add the MCP Server

  1. Press the + button in the chat composer
  2. Click Add sources
  3. Go to App -> Connect more
  4. Click Create app
  5. Fill in the details:
    • Name: A descriptive name (e.g., My Preset Workspace)
    • MCP server URL: Your workspace MCP URL
  6. Press I understand and continue
  7. Authenticate with Preset when prompted via OAuth

Reference: Connect from ChatGPT


Gemini CLI (Terminal)

Gemini CLI is Google's open-source terminal-based AI agent. It supports remote MCP servers with automatic OAuth discovery — no token management required.

Prerequisites

Steps

Step 1: Add the MCP server configuration

Add your Preset workspace to ~/.gemini/settings.json:

{
  "mcpServers": {
    "preset": {
      "url": "https://<workspace-slug>.<region>.app.preset.io/mcp"
    }
  }
}

Replace <workspace-slug> and <region> with the values from your Preset workspace URL.

Step 2: Launch Gemini CLI and authenticate

Start Gemini CLI:

gemini

Then authenticate with the Preset MCP server:

/mcp auth preset

A browser window will open for OAuth authentication. Log in with your Preset credentials. You should see:

ℹ ✅ Successfully authenticated with MCP server 'preset'!

ℹ Restarting MCP server 'preset'...

ℹ Successfully authenticated and reloaded tools for 'preset'

Step 3: Verify the connection

Try a command like "List my dashboards" or "What datasets are available?"

Notes:

  • The OAuth token is cached in ~/.gemini/mcp-oauth-tokens.json for subsequent sessions
  • If your token expires or you encounter a stale session, delete the cached token and re-authenticate:
rm ~/.gemini/mcp-oauth-tokens.json
gemini

Multiple Workspaces

To connect to multiple Preset workspaces, add entries with unique names:

{
  "mcpServers": {
    "preset-production": {
      "url": "https://<workspace-1-slug>.<region>.app.preset.io/mcp"
    },
    "preset-staging": {
      "url": "https://<workspace-2-slug>.<region>.app.preset.io/mcp"
    }
  }
}

Reference: Gemini CLI MCP Server Documentation

Gemini Enterprise

Gemini Enterprise connects to the Preset MCP server as a Custom MCP Server data store. Unlike Gemini CLI, it does not use OAuth auto-discovery or dynamic client registration, so instead of registering itself it requires a confidential OAuth client — a Client ID and Client Secret that you generate in Preset Manager.

Prerequisites

  • MCP enabled for the workspace (Edit Workspace -> AI and MCP -> Enable MCP for this workspace)
  • Team Admin access to Preset Manager, in order to generate OAuth client credentials
  • Permission in Google Cloud to create a Custom MCP Server data store

Step 1: Generate OAuth client credentials in Preset

  1. In Preset Manager, open the workspace's menu and select Edit Workspace

  2. Go to the AI and MCP tab and expand MCP OAuth Clients

  3. Enter a Client name, for example Gemini Enterprise

  4. In Redirect URIs, enter Gemini Enterprise's fixed callback address and click ADD URI:

    https://vertexaisearch.cloud.google.com/oauth-redirect
    
  5. Click GENERATE CREDENTIALS

  6. Copy both the Client ID and the Client Secret, then click I have the values saved

The redirect URI must be added with the ADD URI button before you generate credentials — the interface will warn you that the URI is not saved yet. The Client Secret is displayed only once and cannot be retrieved afterwards, so copy it before dismissing the panel.

Step 2: Collect the connection URLs

The same MCP OAuth Clients panel displays the three URLs Gemini Enterprise requires. They follow this pattern:

MCP Base URL:      https://<workspace-slug>.<region>.app.preset.io/mcp
Authorization URL: https://<workspace-slug>.<region>.app.preset.io/mcp/authorize
Token URL:         https://<workspace-slug>.<region>.app.preset.io/mcp/token

Step 3: Configure the data store in Gemini Enterprise

Create a Custom MCP Server data store and complete the OAuth 2.0 configuration with the following values:

Gemini Enterprise field Value
MCP Server URL The MCP Base URL from Step 2
Authorization URL The Authorization URL from Step 2
Token URL The Token URL from Step 2
Client ID From Step 1
Client Secret From Step 1
Scopes openid email profile offline_access
Enable PKCE Support Enabled — the Preset MCP server supports S256

Include the offline_access scope. Without it, Gemini Enterprise cannot refresh its access token — the connection will work initially and then fail once the first token expires.

Authenticate with your Preset credentials when prompted. All MCP operations respect your existing Preset roles and permissions.

Managing existing clients

Generated clients are listed at the bottom of the MCP OAuth Clients panel, showing the client name, Client ID, the last four characters of the secret, and the creation date. Each entry offers:

  • Rotate — issues a new Client Secret while keeping the same Client ID
  • Revoke — deletes the client

Revoking a client stops new sign-ins once the workspace refreshes its configuration, typically in under a minute. Tokens that have already been issued may remain valid for up to 24 hours.

Tool discovery in Gemini Enterprise

The Preset MCP server's tools/list response advertises four top-level operations — call_tool, search_tools, get_instance_info and health_check. Individual operations such as query_dataset, list_datasets and get_dashboard_info are reached by dispatching through call_tool rather than being declared separately.

Gemini Enterprise builds its Actions list directly from tools/list, so the Actions tab shows those four entries. Clients that support runtime tool discovery can locate an operation with search_tools and then invoke it with call_tool. Clients that require every action to be declared at registration time cannot currently surface the individual Preset operations.

Reference: Set up a Custom MCP Server data store


Method 2:

Authentication via API Token

Note: When authenticating via JWT or Bearer token, the AI client operates with the same API permissions as the authenticated user account. This means the assistant may be able to perform actions beyond the explicitly listed MCP tools — including any API endpoint your account has access to.

Step 1: Generate API Credentials in Preset Manager

  1. Log in to your Preset workspace
  2. Navigate to Settings -> API Keys (or your team's API key management page)
  3. Click Create API Key (or equivalent)
  4. You will receive two values:
Value Description
API Token Name A UUID identifier for the token
API Token Secret A secret value — save this securely; it is only shown once

Step 2: Exchange Credentials for a JWT

Use the Preset Auth API to exchange your API token name and secret for a JWT access token.

Example curl request:

curl --location 'https://api.app.preset.io/v1/auth/' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --data '{
    "name": "YOUR_API_TOKEN_NAME",
    "secret": "YOUR_API_TOKEN_SECRET"
  }'

Example response:

{
  "payload": {
    "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
}

Extract the access_token value from the response — this is your JWT.

Step 3: Use the JWT with MCP

Once you have a JWT, include it in the Authorization header when making requests to the MCP server:

curl -X POST 'https://<workspace-slug>.<region>.app.preset.io/mcp' \
  --header 'Authorization: Bearer YOUR_JWT_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}'
  • Claude Desktop JSON config with JWT

    For Claude Desktop with JSON config, you can use mcp-remote with the bearer token:

    {
      "mcpServers": {
        "preset-workspace": {
          "command": "npx",
          "args": [
            "-y",
            "mcp-remote@latest",
            "https://<workspace-slug>.<region>.app.preset.io/mcp",
            "--header",
            "Authorization: Bearer YOUR_JWT_TOKEN"
          ]
        }
      }
    }
    

Troubleshooting

Connection Issues

  • Ensure you're using https:// in the URL (not http://)
  • Verify your Preset workspace is accessible
  • Check that you have the required subscription plan for your AI client

Authentication Issues

  • OAuth: Clear your browser cookies and try re-authenticating
  • JWT: Verify your API token and secret are correct. Tokens expire — re-generate if needed
  • Gemini Enterprise: Newly generated credentials take about a minute to become active — wait and retry before changing settings. Confirm the Scopes field includes offline_access, and that the redirect URI https://vertexaisearch.cloud.google.com/oauth-redirect was added with ADD URI before the client was generated

Server Not Appearing in AI Client

  • Claude Desktop: Completely quit and restart the application after config changes
  • Claude Web / ChatGPT: Refresh the page and check your connectors list
  • Gemini Enterprise: Use Reload custom actions on the data store's Actions tab. Four operations (call_tool, search_tools, get_instance_info, health_check) is the expected result — see Tool discovery in Gemini Enterprise
  • Verify the MCP URL format is correct: https://<workspace-slug>.<region>.app.preset.io/mcp

Common Errors

Error Cause Fix
401 Unauthorized Token is invalid or expired Re-generate a JWT or re-authenticate via OAuth
403 Forbidden Insufficient permissions or MCP not enabled Check workspace access and MCP feature status
Connection Refused Wrong URL or inactive workspace Verify workspace URL and that workspace is active

Security Notes

  • The MCP connection allows the AI assistant to access your Preset data based on your user permissions and role
  • Store API credentials securely — never share your API Token Secret
  • JWT tokens should be treated as sensitive credentials
  • OAuth client secrets for Gemini Enterprise are shown only once. If a secret is exposed, use Rotate to issue a new one or Revoke to delete the client — note that already-issued tokens may remain valid for up to 24 hours