# Connect an MCP client to a credential

import { Steps } from "@astrojs/starlight/components"

**Inbound Platform MCP** exposes Mindflow service credentials to an external **MCP client** (for example an IDE or agent
runtime). Each **service** credential gets an **MCP connection** panel with the **MCP server URL** and a **Bearer token**
for `Authorization`. This path is separate from calling an external MCP server from a flow—see
[MCP Client](../mcp-client/).

## When to use

- An external MCP client should call Mindflow integrations through a credential you already configured.
- You need the Platform MCP base URL and a bearer token scoped to one service credential.
- Prefer [MCP Client](../mcp-client/) when a **flow** must call tools on an **external** MCP server (outbound).
- Prefer [Connect your coding agent](../../build-with-a-coding-agent/connect-your-coding-agent/) when a coding agent
  such as Claude Code, Codex, Cursor, or Mistral Vibe should plan, build, and run automations. It uses the same server
  URL, but the agent signs in as you instead of using a credential's token.

Before you begin, open an **environment** where the credential already exists. The MCP control appears only when the
credential is tied to a **service** (not a generic Connection credential used for custom URLs).

## Guide

### Open MCP connection on the credential

<ol>
<li>

**Open the environment.** In Studio, go to **Environments**, then open the environment that holds the credential.

</li>
<li>

**Find the credential.** On **Credentials**, locate the service credential (for example **VirusTotal**).

</li>
<li>

**Open MCP connection.** In the row actions, click **Open MCP connection** (MCP icon).

<div class="docs-screenshot-compact">

![Credentials table row with Open MCP connection control](./assets/credentials-mcp-connection-button.png)

</div>

</li>
</ol>
### Copy URL and authorize the client

<ol>
<li>

**Copy MCP server URL.** In the **MCP connection** dialog, copy **MCP server URL**. Point your MCP client at that
endpoint.

<div class="docs-screenshot-compact">

![MCP connection dialog with MCP server URL and masked Bearer token](./assets/mcp-connection-modal-masked-token.png)

</div>

</li>
<li>

**Set Bearer authorization.** Use **Bearer token** as the `Authorization` header value (`Bearer <token>`). Copy the
token from the dialog when your client needs it; keep it secret.

</li>
<li>

**Connect from the client.** Follow your MCP client’s setup (server URL plus bearer auth). The client then reaches the
integrations allowed for that credential.

</li>
</ol>
The dialog shows a masked token by default. Reveal it only when you need to copy a new value, and treat it like any other
API secret.

## Example

A builder runs a local MCP-enabled assistant against the **Docs** environment **VirusTotal** credential so the
assistant can query file reports without re-entering the vendor API key in the client.

1. **Confirm the credential.** Ensure **VirusTotal** (or your service) is saved under **Credentials**.
2. **Open MCP connection.** Copy **MCP server URL** and the **Bearer token** into the client configuration.
3. **Verify from the client.** List or call a tool the service exposes; fix URL or token if the client returns 401.

## Keep in mind

- MCP connection is available for **service** credentials only. Connection credentials with a custom URL for outbound
  MCP do not show the control.
- Rotate or revoke access through credential and environment access controls; a new token fetch may be required after
  changes.
- Inbound MCP is **Platform MCP**: Mindflow hosts the server endpoint. Outbound flow steps use the [MCP Client](../mcp-client/)
  integration instead.

## Related

- [Credentials](../../../../getting-started/credentials/)
