# Analyze your data with AI

Connect Stripe to an AI agent for business and data analysis.

Give your AI agent access to [Stripe data with a plugin](https://docs.stripe.com/agents/plugin.md) that configures the Stripe Model Context Protocol (MCP) server. Your agent can analyze business performance, build custom reports, retrieve financial reports, create board and investor slide decks, and more.

## Before you begin

Make sure you have:

- A Stripe account and permission to view the data you want to analyze.
- An AI agent that supports Stripe plugins or MCP, such as Claude, ChatGPT, or Cursor.

## Give your AI agent access to Stripe

Install the [Stripe agent plugin](https://docs.stripe.com/agents/plugin.md) for supported agents, such as Claude Code, Codex, or Cursor. The plugin also installs Stripe skills. Follow the setup instructions to sign in to Stripe and approve access.

For a client without a Stripe agent plugin, follow the [manual Stripe MCP setup instructions](https://docs.stripe.com/mcp.md#manual). You can also type “Connect Stripe data” to get a prompt to install the plugin.

> #### Protect your API keys
> 
> Don’t paste a Stripe secret key into a chat, or save it in an unprotected file. If your AI agent doesn’t offer a sign-in window, ask a developer or administrator to connect it with an [agent API key](https://docs.stripe.com/keys.md#agent-keys) instead.

## Enable the access you need

When you sign in to Stripe, grant your agent the following read permissions for the account you want to analyze. You can only grant permissions you already have in the Dashboard:

- **Data** > **Metrics**: `Read`
- **Data** > **Queries**: `Read`
- **Data** > **Reports**: `Read`

These permissions let your agent analyze your data without changing anything in your account.

> #### Queries API pricing
> 
> Queries API is free through January 31, 2027. Usage-based pricing begins February 1, 2027.

## Ask your first question

Ask your agent a question, such as:

- Reconcile each payout from the past three months to its underlying payments, refunds, disputes, fees, and transfers. Show any amounts that don’t tie out and the transactions contributing to each difference.
- Analyze disputes and refunds from the past week. Show trends by payment method and dispute reason, and highlight the segments with the largest increases.
- How have our new promotions affected revenue this quarter?

Your agent selects the appropriate Stripe tool automatically. It might ask you to approve the tool before it runs.

## Troubleshooting 

### The sign-in or connection fails

Confirm that you’re signing in to the correct Stripe account and that you have permission to view its data. If you use a managed company device or network, ask your IT team to allow access to `mcp.stripe.com`.

## Query Dashboard metrics programmatically

The [Metrics API](https://docs.stripe.com/data/metrics.md) gives you synchronous, programmatic access to Stripe-defined metrics such as monthly recurring revenue (MRR), annual recurring revenue (ARR), and usage revenue. Use it to build your own dashboards, query metrics from an AI agent, or integrate Stripe data into your internal tools.

## See also

- [Build on Stripe with AI](https://docs.stripe.com/agents.md)
- [Stripe skills](https://docs.stripe.com/skills.md)
