# Agentic Treasury

Automate money movement with AI-powered agents.
Available in: US, GB
Install Stripe’s [Model Context Protocol](https://docs.stripe.com/mcp.md) server so your AI agent can automate tasks across your financial account. After you connect Stripe’s MCP server, you can retrieve your Stripe balance or analyze your financial data directly in chatbots such as Claude or ChatGPT.

## Connect to Stripe’s MCP server 

#### Cursor

[Install in Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=stripe&config=eyJ1cmwiOiJodHRwczovL21jcC5zdHJpcGUuY29tIn0%3D)

To open Cursor and automatically add the Stripe MCP server, click **Install**. Alternatively, add the following to your `~/.cursor/mcp.json` file. To learn more, see the Cursor [documentation](https://docs.cursor.com/context/model-context-protocol).

```json
{
  "mcpServers": {
    "stripe": {
      "url": "https://mcp.stripe.com"
    }
  }
}
```

#### Claude Code

To add MCP to Claude code, run the following command. To learn more, see the Claude Code [documentation](https://docs.anthropic.com/en/docs/claude-code/mcp#configure-mcp-servers).

```bash
claude mcp add --transport http stripe https://mcp.stripe.com/
```

After adding the server to Claude, you must authenticate with Stripe.

```bash
claude /mcp
```

#### ChatGPT

You can enable MCP servers on ChatGPT if you have a Pro, Plus, Business, Enterprise or Education account. Follow the [OpenAI documentation](https://platform.openai.com/docs/guides/developer-mode) for instructions. Use the following parameters when setting up your custom connector:

- The server url is `https://mcp.stripe.com`.
- Use “OAuth” as the connection mechanism.

Stripe’s MCP server also works with OpenAI’s response API, when building [autonomous agents](https://docs.stripe.com/treasury/agents.md#agents).

#### Other

### VS Code

[Install in VS Code](https://vscode.dev/redirect/mcp/install?name=stripe&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmcp.stripe.com%22%7D)

To open VS Code and automatically add the Stripe MCP server, click **Install**. Alternatively, add the following to your workspace `.vscode/mcp.json` file. To learn more, see the VS Code [documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers).

```json
{
  "servers": {
    "stripe": {
      "type": "http",
      "url": "https://mcp.stripe.com"
    }
  }
}
```

### Custom

MCP is an open protocol that many clients support. Your client documentation can explain how to connect. If possible, use the server URL `https://mcp.stripe.com` and OAuth as the connection mechanism. If your MCP client doesn’t support OAuth, you can pass a [restricted API key](https://docs.stripe.com/keys.md#create-restricted-api-key) in the `Authorization` header as a bearer token. For example, a client might accept the following header property:

```json
{
  "stripe": {
    "url": "https://mcp.stripe.com",
    "headers": {
      "Authorization": "Bearer <<YOUR_SECRET_KEY>>"
    }
  }
}
```

After installing, you can manage MCP client sessions in your Dashboard settings.

### Manage MCP client sessions

The Stripe MCP server uses OAuth to connect MCP clients according to the [MCP spec](https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization#2-1-1-oauth-grant-types). OAuth is more secure than using your secret key because it allows more granular permissions and user based authorization. When you add the Stripe MCP to a client, the MCP client opens an OAuth consent form which allows you to authorize the client to access your Stripe data.

#### Manage your own sessions

To view authorized OAuth client sessions, go to your [user settings](https://dashboard.stripe.com/settings/user) in the Stripe Dashboard. If you’ve authorized an MCP client, it appears under **OAuth sessions**. To revoke OAuth access for a specific MCP client session:

1. Scroll to the OAuth sessions section in your [user settings](https://dashboard.stripe.com/settings/user).
2. Find the client sessions in the list, and click the overflow menu (⋯).
3. Select **Revoke access**.

#### Manage sessions as an admin

If you’re an administrator, you can view and revoke the MCP OAuth sessions of other users in your organization or account. This requires a role with permission to manage team members and OAuth sessions (for example, the **Administrator** role). To manage another user’s sessions:

1. Go to the [Team and security](https://dashboard.stripe.com/settings/team) settings page and select the team member you want to manage.
2. On the team member details page, find the **OAuth sessions** table.
3. To revoke a single session, click the overflow menu on its row and select **Revoke access**. To revoke every session in the table, select **Revoke all**.

Session management is scoped to the account or organization you’re currently viewing and to the current environment, live mode or a sandbox. Revoking a session only removes access for the accounts in your current scope. If the same session also has access to accounts outside your scope, it stays active for those accounts. When you view an organization, the table includes an **Accounts** column because a session can be tied to more than one account in the organization.

### Manage MCP access

Administrators can [enable MCP access](https://dashboard.stripe.com/settings/mcp) in the Dashboard. Access is managed separately between sandbox and live mode environments.

### Building autonomous agents

If you’re building agentic software, you can pass a Stripe API key as a bearer token to the MCP remote server. We strongly recommend using [restricted API keys](https://docs.stripe.com/keys/restricted-api-keys.md) to limit your agent’s access to exactly the functionality it requires. For example, you can use this authorization method with [OpenAI’s Responses API](https://platform.openai.com/docs/guides/tools-remote-mcp#authentication).

Don’t embed restricted or secret API keys in code. Instead, provide API keys to your agent through a secrets vault or environment variable. To learn how to manage keys safely, see [best practices for managing secret API keys](https://docs.stripe.com/keys-best-practices.md).

```bash
curl https://mcp.stripe.com/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <<YOUR_SECRET_KEY>>" \
  -d '{
      "jsonrpc": "2.0",
      "method": "tools/call",
      "params": {
        "name": "create_customer",
        "arguments": {"name": "Jenny Rosen", "email": "jenny.rosen@example.com" }
      },
      "id": 1
  }'
```

## Request access to preview features 

You can extend the Stripe MCP server with more Treasury tools that let your AI agent move money, pay bills, and create and manage cards.

### Interested in agentic finance with Treasury?

Enter your email to request access.

```bash
curl https://docs.stripe.com/preview/register \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Referer: https://docs.stripe.com/treasury/agents" \
  -d '{"email": "EMAIL", "preview": "agentic_treasury_preview"}'
```
