> ## Documentation Index
> Fetch the complete documentation index at: https://dreamlit.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Dreamlit MCP for Windsurf

> Connect Windsurf Cascade to Dreamlit MCP as a remote HTTP MCP server.

export const clientName_1 = "Windsurf"

export const clientSetupName_1 = "Windsurf"

export const clientName_0 = "Windsurf"

export const agentName_0 = "Cascade"

export const clientSetupName_0 = "Windsurf"

export const clientSessionName_0 = "Windsurf"

Cascade is built for long-horizon agent work that touches many files at once. Dreamlit's Model Context Protocol (MCP) server lets that same multi-step reach extend into your notification workflows, so a refactor that adds a new trigger column and an updated workflow can ship in one Cascade flow.

You can ask Windsurf Cascade things like:

* *List my published workflows in Dreamlit.*
* *Build a Black Friday campaign: add a discount code to my app and create the email workflow that ships it to active users.*
* *Create a recurring email that sends me a weekly usage digest every Monday at 9 AM America/New\_York. Include new signups, active users, and failed payments from the previous week.*
* *Send me a test of the welcome email draft so I can review it in my inbox before publishing.*
* *Publish the "trial ending" reminder workflow. Check for any warnings or errors before publishing.*

The key advantage is the **closed loop**: Cascade can use context from your app, codebase, and data model to understand what you want, work back and forth with Dreamlit to fix issues, and only return a preview URL once the workflow matches your intent and is ready to review.

## Why use Dreamlit MCP with Windsurf?

Cascade's strength is multi-step agent work that spans your codebase. Dreamlit MCP lets that span extend into the notification side, so a Cascade flow can touch app code and the workflow that depends on it in one autonomous run.

* **Multi-file agent reach**: Cascade can update app code and Dreamlit workflows in one coordinated flow without context-switching.
* **Long-horizon authoring**: design a campaign, ship the trigger logic, draft the email workflow, run a test, all in a single Cascade session.
* **Codebase context**: Cascade reads the project as a whole and picks the right table or trigger event when drafting the workflow.
* **Test and ship**: send a test through `send_workflow_test` before publishing, all from Cascade.

## Server URL

```txt theme={null}
https://mcp.dreamlit.ai/mcp
```

Dreamlit hosts this remote MCP server over Streamable HTTP. Windsurf can connect to remote HTTP MCP servers from Cascade settings.

## Quick install

<Steps>
  <Step title="Open Windsurf MCP settings">
    Open **Settings** -> **Tools** -> **Windsurf Settings** -> **Add Server**. If you prefer raw config, click **View Raw Config**.
  </Step>

  <Step title="Add Dreamlit">
    Add Dreamlit to `mcp_config.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "dreamlit": {
          "serverUrl": "https://mcp.dreamlit.ai/mcp"
        }
      }
    }
    ```
  </Step>

  <Step title="Authorize Dreamlit">
    Save the config, refresh MCP servers in Windsurf, then complete the Dreamlit OAuth flow when prompted.
  </Step>

  <Step title="Refresh Cascade tools">
    Press the MCP refresh button after authorization. If Dreamlit tools do not appear, start a new Cascade chat or restart Windsurf.
  </Step>

  <Step title="Start prompting">
    Ask Cascade:

    ```txt theme={null}
    Use Dreamlit MCP to check status, list workflows, and draft a weekly usage digest.
    ```
  </Step>
</Steps>

<Accordion title="Using an API key instead of OAuth?">
  Use a Dreamlit personal access token when {clientName_1} cannot complete OAuth or when you want one project-scoped credential.

  <Steps>
    <Step title="Create a token">
      Open Dreamlit, go to **Project Settings** -> **Project Details** -> **MCP Access**, then click **Create token**.
    </Step>

    <Step title="Choose scopes">
      Select the smallest set of permissions {clientName_1} needs.
    </Step>

    <Step title="Copy the token now">
      Dreamlit only shows the token once. Store it securely.
    </Step>

    <Step title="Pass the token as a Bearer token">
      Configure {clientSetupName_1} to send:

      ```txt theme={null}
      Authorization: Bearer dlpt_your_token_here
      ```
    </Step>
  </Steps>

  <Tabs>
    <Tab title="JSON config">
      ```json theme={null}
      {
        "mcpServers": {
          "dreamlit": {
            "url": "https://mcp.dreamlit.ai/mcp",
            "headers": {
              "Authorization": "Bearer dlpt_your_token_here"
            }
          }
        }
      }
      ```
    </Tab>

    <Tab title="VS Code">
      ```json theme={null}
      {
        "servers": {
          "dreamlit": {
            "type": "http",
            "url": "https://mcp.dreamlit.ai/mcp",
            "headers": {
              "Authorization": "Bearer dlpt_your_token_here"
            }
          }
        }
      }
      ```
    </Tab>

    <Tab title="Codex">
      Store the token in an environment variable:

      ```bash theme={null}
      export DREAMLIT_MCP_TOKEN="dlpt_your_token_here"
      ```

      Add the server:

      ```bash theme={null}
      codex mcp add dreamlit --url https://mcp.dreamlit.ai/mcp \
        --bearer-token-env-var DREAMLIT_MCP_TOKEN
      ```
    </Tab>

    <Tab title="Connector UI">
      If {clientSetupName_1} asks for an authentication method, choose **API key**, **Bearer token**, or **custom header**. Use `Authorization` as the header name and `Bearer dlpt_your_token_here` as the value.
    </Tab>
  </Tabs>
</Accordion>

## What is MCP?

MCP is an open standard that lets {clientName_0} connect to external tools and data sources through one shared protocol. Instead of needing a custom Dreamlit integration, {clientName_0} connects to Dreamlit's MCP server and discovers the tools Dreamlit exposes.

For Dreamlit, MCP means {agentName_0} can work with notification workflows using product-level actions:

* Find the right workspace, project, or workflow
* Understand Dreamlit concepts and project setup state
* Create or update workflow drafts from plain-English prompts
* Return preview links so you can inspect the result in Dreamlit
* Prepare publishing and ask for explicit confirmation before anything goes live

Learn more in the official [Model Context Protocol documentation](https://modelcontextprotocol.io/docs/getting-started/intro).

## What can Dreamlit MCP do?

Dreamlit MCP is focused on workflow authoring and safe workflow operations. It is not a low-level database API.

| Capability | What it means |
| - | - |
| Inspect setup | Check the approved workspace, project setup, Dreamlit page links, table and column summaries, and prompting guidance. |
| List projects and workflows | Find the project or workflow {agentName_0} should work on. |
| List brand styles | Find saved Brand Style ids and style summaries with pagination before asking Dreamlit to use a specific style. |
| Inspect workflows | Return normalized workflow structure and a Dreamlit preview URL before editing. |
| Create drafts | Ask Dreamlit to create a workflow draft from an outcome-oriented prompt. |
| Update drafts | Continue editing an existing workflow through the same draft history you see in the web app. |
| Test draft messages | Send a draft email or Slack message to yourself or a chosen recipient for review before publishing. |
| Query analytics | Read notification analytics, recipient engagement, and workflow run rows with filters and pagination. |
| Prepare publish | Validate a workflow and return a publish confirmation payload with a preview URL. |
| Confirm publish | Publish only after the user explicitly approves the prepared publish request. |
| Unpublish | Disable a live workflow when {clientName_0} has publish permission. |
| Hand off to the browser | Send you to Dreamlit when setup, unsupported edits, or manual review need the web app. |

## Prerequisites

Before connecting {clientSetupName_0}:

* Create a Dreamlit account at [app.dreamlit.ai](https://app.dreamlit.ai).
* Finish workspace and project setup in Dreamlit.
* Connect a [Supabase](/docs/configuration/data-sources/supabase) or [Postgres](/docs/configuration/data-sources/postgres) database.
* Configure any channels the workflows will need, such as [email domains](/docs/configuration/email/custom-domain), [Brand Styles](/docs/configuration/email/brand-styles), or [Slack](/docs/configuration/slack).
* Confirm {clientName_0} supports remote MCP over Streamable HTTP, or can send MCP requests through an HTTP bridge.

<Note>
  Dreamlit MCP works against existing Dreamlit workspaces and projects. If {clientName_0} says setup is required, open the Dreamlit link it returns and finish setup in the web app before reconnecting.
</Note>

## How does authorization work?

OAuth is the best option when {clientName_0} supports remote server authentication. {clientName_0} connects to Dreamlit, Dreamlit opens a browser authorization screen, and you approve access to one Dreamlit workspace.

<Steps>
  <Step title="Add Dreamlit MCP">
    Use the server URL:

    ```txt theme={null}
    https://mcp.dreamlit.ai/mcp
    ```
  </Step>

  <Step title="Approve Dreamlit access">
    {clientName_0} should open a Dreamlit authorization page. Sign in, choose the workspace, review the requested scopes, and click **Allow access**.
  </Step>

  <Step title="Check status">
    Ask {agentName_0}:

    > Check Dreamlit MCP status and list my projects.
  </Step>
</Steps>

<Tip>
  If {clientName_0} only receives read access, reconnect Dreamlit and approve workflow drafting, publishing, or analytics when prompted. Dreamlit defaults empty OAuth scope requests to the supported v1 scopes.
</Tip>

## Permissions

Dreamlit MCP uses workflow and analytics scopes.

| Scope | Allows | Typical use |
| - | - | - |
| `workflows:read` | `get_status`, `list_projects`, `list_workflows`, `list_brand_styles`, `get_workflow_and_preview_url` | Inspect setup, find workflows, Brand Styles, drafts, and published state. |
| `workflows:write` | `create_or_update_workflow`, `rename_workflow`, `send_workflow_test` | Create, edit, or rename workflow drafts, and send draft message tests. |
| `workflows:publish` | `prepare_publish`, `confirm_publish`, `unpublish_workflow` | Validate, publish, schedule broadcasts, or unpublish workflows. |
| `analytics:read` | `get_analytics` | Query notification analytics, recipient engagement, and workflow runs. |

OAuth grants are scoped to a workspace. Personal access tokens are scoped to one project.

## Tools

{clientName_0} discovers these tools from the server.

| Tool | Required scope | Use it for |
| - | - | - |
| `get_status` | `workflows:read` | Learn how Dreamlit MCP works, inspect workspace/project setup, get Dreamlit page links, and retrieve prompting guidance. |
| `list_projects` | `workflows:read` | Find projects in the approved workspace. Project-scoped tokens only return their own project. |
| `list_workflows` | `workflows:read` | Find workflows in a project, optionally filtered by trigger type. |
| `list_brand_styles` | `workflows:read` | Find saved Brand Style ids and style summaries with pagination before asking Dreamlit to use a specific style. |
| `get_workflow_and_preview_url` | `workflows:read` | Inspect draft and published workflow structure before editing or publishing. |
| `get_analytics` | `analytics:read` | Query bounded analytics data with filters, sorting, and pagination. |
| `create_or_update_workflow` | `workflows:write` | Create or update a draft from a natural-language prompt. Pass `name` to name a new workflow, or `startNewChat` to start a fresh chat. |
| `rename_workflow` | `workflows:write` | Rename an existing workflow. Doesn't change the draft or what's live. |
| `send_workflow_test` | `workflows:write` | Send the current draft email or Slack message to yourself or a chosen recipient for review. Doesn't publish or edit the workflow. |
| `prepare_publish` | `workflows:publish` | Validate the workflow and return the exact payload needed for confirmation. |
| `confirm_publish` | `workflows:publish` | Publish only after the user approves the prepared publish request. |
| `unpublish_workflow` | `workflows:publish` | Disable a live workflow. |

Dreamlit also exposes the `dreamlit://mcp/guide` resource. If {clientName_0} supports MCP resources, it can read the guide for prompting guidance, trigger types, unsubscribe guidance, and the recommended Dreamlit MCP flow.

## Recommended workflow

Ask {agentName_0} to work in this order:

<Steps>
  <Step title="Check status">
    Start with `get_status`. This gives {agentName_0} Dreamlit concepts, setup state, project context, and links back to relevant Dreamlit pages.
  </Step>

  <Step title="Find the target">
    Use `list_projects` and `list_workflows` if the project or workflow is unclear.
  </Step>

  <Step title="Choose a Brand Style">
    Use `list_brand_styles` when you want a specific saved Brand Style applied.
  </Step>

  <Step title="Inspect before editing">
    Use `get_workflow_and_preview_url` before changing an existing workflow.
  </Step>

  <Step title="Create or update the draft">
    Use `create_or_update_workflow` with an outcome-oriented prompt. When editing, describe the steps to change by what they do, like "the email with subject Welcome back", not by step ID.

    Each call continues the workflow's current Dreamlit chat. For an unrelated change, or if Dreamlit keeps misreading the request, pass `startNewChat` to start fresh. The new chat still sees the current draft.
  </Step>

  <Step title="Review in Dreamlit">
    Open the returned workflow URL to inspect the draft, preview output, and make manual adjustments if needed.
  </Step>

  <Step title="Test important messages">
    For email or Slack messages that need to look right before going live, ask {agentName_0} to send a test through `send_workflow_test`. Confirm the test before it sends, then review the real message in your inbox or Slack channel.
  </Step>

  <Step title="Publish deliberately">
    Use `prepare_publish` first. Only call `confirm_publish` after you explicitly approve the prepared publish request.
  </Step>
</Steps>

## How do I test a draft email or Slack message before publishing?

Use `send_workflow_test` to send the current draft message to yourself (or a chosen recipient) so you can review it in the real channel before going live. Tests don't publish, schedule, or change the workflow draft.

* Email tests default to the authenticated user's email address. Pass `testRecipientEmail` to send to a different inbox.
* Slack tests post to the channel configured for the draft message.
* Dreamlit returns a `confirmation_required` response describing the message and recipient. {agentName_0} only sends after calling `send_workflow_test` again with `confirmSend: true`.
* If a workflow has more than one testable message, Dreamlit returns a `clarification_required` response listing each message by label so you can choose one.
* Test sends count toward the same draft rate limit as workflow authoring.

Example prompt:

```txt theme={null}
Send me a test of the welcome email draft so I can review it
in my inbox before publishing.
```

## Prompting Dreamlit through MCP

Dreamlit works best when you describe the notification outcome, not the internal workflow graph.

Good prompts include:

* The event or schedule that should start the workflow
* The audience or recipient
* The message goal
* Data needed for targeting or personalization, including email activity such as recent opens or clicks, who opened a specific broadcast, or emails that failed
* Timing, timezone, and business rules
* Whether unsubscribe should be enabled
* Tone or brand notes when they matter

Examples:

```txt theme={null}
Check Dreamlit status, then create a workflow for the main project:
when a new order row is inserted, send the customer an order confirmation
with the order number, total, and delivery estimate.
```

```txt theme={null}
List my workflows, inspect the welcome email workflow, and update it so
users who have not created a project after 3 days get a follow-up email.
Keep unsubscribe off because this is account onboarding.
```

```txt theme={null}
Create a repeating workflow that sends admins a weekly usage digest every
Monday at 9 AM America/New_York. Include new signups, active users, and
failed payments from the previous week.
```

```txt theme={null}
Prepare publish for the trial reminder workflow. Show me the preview URL
and warnings before confirming anything.
```

## Safety and control

Dreamlit MCP is designed so {agentName_0} can help with workflows without making surprise production changes.

* Draft changes stay draft-only until you publish.
* Test sends require explicit confirmation and don't publish, schedule, or edit the draft.
* Publishing is always a separate confirmation step with a Dreamlit preview link.
* If an action needs setup or manual review, Dreamlit sends you back to the web app.
* Query steps are read-only against your application data.
* Access is limited by the permissions you approve. Personal access tokens are project-scoped and can be revoked anytime.

## Troubleshooting

### Dreamlit authorization is required

Reconnect the MCP server and complete the browser authorization flow. If you are using a personal access token, confirm the token is still active and that {clientSetupName_0} is sending it as an `Authorization: Bearer ...` header.

### Dreamlit tools do not appear after authorization

Start a new chat or session in {clientSessionName_0}. If the tools still do not appear, restart {clientSetupName_0} or restart the Dreamlit MCP server entry. {clientName_0} can cache the MCP server and tool list for an open session.

### Additional Dreamlit permission is required

The current OAuth grant or personal access token does not include the required scope. Reconnect with the requested access, or create a token with the missing scope.

### Dreamlit says to choose a project

Your approved workspace has multiple projects and {agentName_0} did not specify one. Ask {agentName_0} to call `list_projects`, then retry with the right project.

### Dreamlit says setup is required

Open the returned Dreamlit setup URL, finish workspace and project setup, then reconnect {clientSetupName_0}.

### A workflow edit returns a browser handoff

Some changes still need the Dreamlit web app. Open the returned URL, review the draft, and continue from there.

### Publishing fails after a preview

The workflow may have changed since the publish preview. Ask {agentName_0} to run `prepare_publish` again, review the new preview and warnings, then confirm only if it still looks right.

### Tools are visible but calls time out

Workflow authoring can take longer than read-only calls because Dreamlit is planning and applying a real workflow draft. Retry once. If it keeps failing, open the returned Dreamlit URL if one is present, or contact [support](/docs/resources/getting-support).

## Testing with MCP Inspector

You can use the [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) to verify the server connection.

<Steps>
  <Step title="Start the Inspector">
    ```bash theme={null}
    npx @modelcontextprotocol/inspector
    ```
  </Step>

  <Step title="Choose Streamable HTTP">
    Select **Streamable HTTP** as the transport.
  </Step>

  <Step title="Enter the server URL">
    ```txt theme={null}
    https://mcp.dreamlit.ai/mcp
    ```
  </Step>

  <Step title="Authenticate">
    Use OAuth if the Inspector supports it, or add a Bearer header:

    ```txt theme={null}
    Authorization: Bearer dlpt_your_token_here
    ```
  </Step>

  <Step title="Confirm the connection">
    Use **List tools** and call `get_status` to confirm the connection.
  </Step>
</Steps>

## Next steps

<CardGroup cols={3}>
  <Card title="Quickstart" icon="rocket" href="/docs/getting-started/quickstart">
    Connect your database and create your first workflow.
  </Card>

  <Card title="Workflow basics" icon="diagram-project" href="/docs/workflow/basics">
    Learn how Dreamlit workflows are structured.
  </Card>

  <Card title="Get support" icon="life-ring" href="/docs/resources/getting-support">
    Reach the team if MCP setup blocks you.
  </Card>
</CardGroup>

***

Last validated: 2026-05-07


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.