# Connect your coding agent to Mindflow

import { Steps, TabItem, Tabs } from "@astrojs/starlight/components"

Connect a coding agent to your organization's Mindflow **MCP server** so it can plan, build, and run automations for
you. You copy the server URL from Studio, add it to the agent, and sign in through your browser. On sign-in, you choose
which environments and flows the agent may use. There is nothing to install.

## When to use

- You want Claude Code, Codex, Cursor, Grok Build, or Mistral Vibe to plan, build, and run Mindflow automations.
- You are an Org Admin rolling Mindflow out to the coding agents your team uses.
- Prefer [AI··Build](../../design-your-flow/ai-build-faster-flow-creation/) when you already have a flow open in Studio
  and only need the designer chat to add steps.
- Prefer [MCP Client](../../use-ai-in-flows/mcp-client/) when a **flow** must call an external MCP server.
- Prefer [Expose a credential over MCP](../../use-ai-in-flows/expose-a-credential-over-mcp/) when an external client
  should call **one integration** through a credential's **MCP connection** panel.

Before you begin, you need a Mindflow account (see [Sign in](../../../../getting-started/sign-in/)). Your organization
must allow the coding agent you use to connect to MCP servers. The **MCP** tab appears in Studio only when MCP access is
available for your organization.

## Guide

### Connect from Studio

Each Mindflow organization has its own MCP server URL. On the **MCP** tab, expand **Connect a coding agent** to copy the
address, use a row for each supported app, and open **MCP Server documentation** for sign-in commands, JSON snippets,
and rollout guidance.

1. **Open MCP.** Choose **My profile** → **MCP**, or **Organization** → **MCP** if you are an Org Admin.
2. **Expand Connect a coding agent** when you need the server address or an app row.
3. **Copy the server address** when an app asks you to paste a URL.
4. **Use the row for your app.** Choose **Install** or **Connect** to open that product with Mindflow prefilled where
   supported, or **Copy command** / **Copy config** for terminal and file-based setup.
5. **Sign in.** Complete OAuth in your browser, then choose access on **Allow MCP access**. Use the tabs below or **Open
   MCP Server documentation** in Studio when you need a sign-in command, `mcp.json`, or the example request.

### Add the server to your agent

Register the server under the name `mindflow` in your agent. Replace `<url>` with your MCP server URL, or use the
**Connect a coding agent** rows in Studio instead of typing commands by hand. Sign-in opens your browser; the next
section covers what you choose there.

<ol>
<li>

**Add the server.** In a terminal, run:

```bash
claude mcp add --transport http mindflow <url>
```

On Claude Team and Enterprise, an Owner can add the URL as a claude.ai connector instead.

</li>
<li>

**Sign in.** Run the command below, or run `/mcp` in a Claude Code session:

```bash
claude mcp login mindflow
```

</li>
</ol>
<ol>
<li>

**Add the server.** In a terminal, run:

```bash
codex mcp add mindflow --url <url>
```

</li>
<li>

**Sign in.** Run:

```bash
codex mcp login mindflow
```

</li>
</ol>
<ol>
<li>

**Add the server to your MCP configuration.** Add this entry to `~/.cursor/mcp.json`. To use it in one project only,
add it to `.cursor/mcp.json` in that project instead.

```json title="~/.cursor/mcp.json"
{
  "mcpServers": {
    "mindflow": {
      "url": "<url>"
    }
  }
}
```

</li>
<li>

**Sign in when the agent asks.** Start a chat and follow the agent's sign-in prompt for the `mindflow` server.

</li>
</ol>
**Add the server and sign in.** In a terminal, run the command below. Vibe opens your browser to sign in.

```bash
vibe mcp add mindflow --url <url>
```

To sign in again later, run `/mcp login mindflow` in a Vibe session.

### Sign in and choose what the agent can use

Sign-in happens in your browser. You sign in to Mindflow, then approve which environments and flows this agent may use
on **Allow MCP access**. The agent can never go beyond what you approve there, or beyond your own Mindflow permissions.
No token goes into chat or into a configuration file.

1. **Check the client.** **Allow MCP access** shows a client name. Anyone can claim that name—confirm it matches the
   app you just opened.
2. **Choose environments.** Under **Environments**, pick **All environments I can access** and set **Maximum role**,
   pick **Custom** to set a role per environment, or pick **No access**.
3. **Choose flows.** Under **Flows**, make the same choice with **All flows I can access**, **Custom**, or **No access**.
4. **Leave organization administration off.** Org Admins see **Allow organization administration**. Turn it on only
   when the agent needs organization-admin actions.
5. **Save.** Choose **Save and return to client**, then go back to the agent.

### Ask for an automation

Once you are signed in, ask in plain language. The agent reads the Mindflow guide from the server and starts with
[THINK](../think-discover-and-design/). For example:

```text
Build a Mindflow automation that triages new IP alerts with VirusTotal and asks in Slack before opening a ticket.
```

Agents that support skills from MCP servers, such as Claude Code, list a `mindflow` skill. The agent may ask you once to
approve it, and again after a Mindflow update changes it. Other agents read the same guide through a `mindflow_guide`
tool. Either way, the guide always matches your organization's Mindflow version. There is no `/mindflow` command: ask
in your own words.

### Roll out to your team

Org Admins expand **Connect a coding agent** under **Organization** → **MCP**, copy the server URL, and use the rows
for each supported app. Share the MCP server URL through each agent's managed MCP settings so people do not add it by
hand.

On Claude Team and Enterprise, an Owner may need to turn on skills from MCP servers before Claude Code lists the
`mindflow` skill. The Owner can also pre-approve that skill with this Claude Code permission rule:

```text
Skill(mcp__mindflow__*)
```

## Example

A SOC analyst wants Claude Code to build a webhook automation that checks an IP in VirusTotal and posts to Slack when
the IP is malicious. They work in the **Docs** environment only.

1. **Copy the command.** On **My profile** → **MCP**, they expand **Connect a coding agent** and choose **Copy command**
   on the **Claude Code** row.
2. **Add and sign in.** They run the add command, then run `claude mcp login mindflow` (see the **Claude Code** tab
   above). The browser opens **Allow MCP access**.
3. **Limit access.** Under **Environments**, they pick **Custom** and give a role to **Docs** only. They keep **All
   flows I can access**, then choose **Save and return to client**.
4. **Ask.** In Claude Code, they ask for a Mindflow automation that receives an IP on a webhook, looks it up in
   VirusTotal, and posts to Slack when it is malicious. Claude Code asks once to approve the `mindflow` skill, then
   starts [THINK](../think-discover-and-design/).

## Keep in mind

- Before a run, a delete, or a change of the version a deployment runs, Mindflow asks you to confirm in the agent's own
  dialog when the agent can show one (Claude Code can). Otherwise, the agent's usual approval prompt applies.
- To cut an agent off, revoke its grant under **MCP grants** on the same **MCP** tab.
- If the agent reports that Mindflow sign-in failed or expired, sign in again from the agent's MCP settings (Claude
  Code: `/mcp`). Do not paste a token into chat or into a configuration file.
- Signing in as yourself is separate from the bearer token on a credential's **MCP connection** panel. That token gives
  a client one integration's tools, not the Mindflow guide.

## Related

[THINK: discover and design](../think-discover-and-design/) · [AI··Build](../../design-your-flow/ai-build-faster-flow-creation/) ·
[MCP Client](../../use-ai-in-flows/mcp-client/) ·
[Expose a credential over MCP](../../use-ai-in-flows/expose-a-credential-over-mcp/) ·
[MCP tools reference](/api/mcp-tools/)
