The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
docs - mcp and AI updates (#71601)
Jeff Bruemmer424541b42500
diff --git a/docs/README.md b/docs/README.mdindex c8a93a6fe23..aaef69235e4 100644--- a/docs/README.md+++ b/docs/README.md@@ -150,8 +150,9 @@ Metabase's reference documentation.- [AI overview](./ai/start.md)- [Metabot](./ai/metabot.md)-- [Setting up Metabot](./ai/settings.md)-- [SQL generation](./ai/sql-generation.md)+- [AI settings](./ai/settings.md)+- [Agent API](./ai/agent-api.md)+- [MCP server](./ai/mcp.md)### Exploration and organizationdiff --git a/docs/ai/agent-api.md b/docs/ai/agent-api.mdindex 796648a2b55..7d2c730473e 100644--- a/docs/ai/agent-api.md+++ b/docs/ai/agent-api.md@@ -20,17 +20,23 @@ There are a few advantages to using the agent API over the Metabase API.- Agent endpoints are explicitly supported for building agentic BI applications.- The agent API is versioned, so your apps can rely on consistent responses.-- Supports JWT auth so requests can be scoped to a user's permissions.+- Requests are scoped to the authenticated user's permissions.- Doesn't require you to work with MBQL, which is Metabase's querying language.## Supported featuresThe Agent API supports:-- Discovering tables and metrics+- Searching for tables and metrics- Inspecting their fields- Constructing and executing queries+If you want to connect an MCP-compatible AI client (like Claude Desktop) without writing custom code, see the [MCP server](./mcp.md), which builds on this API.++## Row limits and pagination++Queries return a maximum of 200 rows per request. To page through larger result sets, use `POST /api/agent/v1/query`, which returns a `continuation_token` when more rows are available. Pass the token back to get the next page.+## Agent API endpoints and referenceCheck out the API endpoints: [/api/agent](../api.html#tag/apiagent).@@ -39,9 +45,44 @@ You can also point your AI to the [Agent API reference](https://github.com/metab## Authentication-The Agent API uses stateless JWT authentication. JWT must be configured in Metabase admin settings (**Admin** > **Settings** > **Authentication** > **JWT**).+The Agent API supports three authentication methods.++### API key++The simplest option. Create an [API key](../people-and-groups/api-keys.md) in **Admin** > **Settings** > **Authentication** > **API keys**, then pass it in each request:++```+X-API-Key: YOUR_API_KEY+```++The key's permissions are determined by the [group](../people-and-groups/managing.md#groups) assigned to that key. Unlike session or JWT authentication, API key requests aren't scoped to an individual user. Anyone using a client app that authenticates with an API key will have the same permissions as that key.++### Session token++Log in with a Metabase username and password to get a session token, then pass it in subsequent requests.-Pass a signed JWT directly in each request:+**1. Get a session token:**++```+POST /api/session+Content-Type: application/json++{"username": "[email protected]", "password": "your-password"}+```++The response body contains an `id` field -- that's your session token.++**2. Pass the token in each request:**++```+X-Metabase-Session: SESSION_TOKEN+```++### JWT++{% include plans-blockquote.html feature="JWT-based authentication" %}++If you've configured [JWT-based authentication](../people-and-groups/authenticating-with-jwt.md) (**Admin** > **Settings** > **Authentication** > **JWT**), you can pass a signed JWT directly:```Authorization: Bearer <jwt>@@ -66,17 +107,13 @@ Example JWT payload:}```-### Session-based authentication--Exchange a JWT at `POST /auth/sso/to_session` to get a session token, then pass it via:--```-X-Metabase-Session: <session-token>-```+You can also exchange a JWT for a session token via `POST /auth/sso/to_session` (note: this endpoint is under `/auth`, not `/api`), then use the `X-Metabase-Session` header as described above.## Further reading+- [MCP server](./mcp.md)- [Agent API complete reference](https://github.com/metabase/metabase/blob/master/src/metabase/agent_api/reference.md)- [Metabase Agent API demo](https://github.com/metabase/metabase-agent-api-demo)- [Metabase API docs](../api.html)+- [API keys](../people-and-groups/api-keys.md)- [JWT authentication](../people-and-groups/authenticating-with-jwt.md)diff --git a/docs/ai/images/ai-connection-settings.png b/docs/ai/images/ai-connection-settings.pngnew file mode 100644index 00000000000..9a4871daf83Binary files /dev/null and b/docs/ai/images/ai-connection-settings.png differdiff --git a/docs/ai/images/metric-in-mcp.png b/docs/ai/images/metric-in-mcp.pngnew file mode 100644index 00000000000..b62dc468478Binary files /dev/null and b/docs/ai/images/metric-in-mcp.png differdiff --git a/docs/ai/images/sql-generation-admin.png b/docs/ai/images/sql-generation-admin.pngdeleted file mode 100644index 8c1015d26e5..00000000000Binary files a/docs/ai/images/sql-generation-admin.png and /dev/null differdiff --git a/docs/ai/images/sql-generation.png b/docs/ai/images/sql-generation.pngdeleted file mode 100644index 06e8d30b56c..00000000000Binary files a/docs/ai/images/sql-generation.png and /dev/null differdiff --git a/docs/ai/mcp.md b/docs/ai/mcp.mdnew file mode 100644index 00000000000..5b11a023f07--- /dev/null+++ b/docs/ai/mcp.md@@ -0,0 +1,58 @@+---+title: MCP server+summary: Connect MCP-compatible AI clients to Metabase to search, explore, and query your data through the semantic layer.+---++# MCP server++++Metabase includes an [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server (using Streamable HTTP transport) that lets AI clients connect directly to your Metabase, all scoped to the connecting person's permissions.++Before connecting, make sure AI features are enabled in your Metabase. See [AI settings](./settings.md).++## Connect an MCP client++Point your MCP client at Metabase's MCP endpoint at `/api/mcp`:++```+https://{your-metabase.example.com}/api/mcp+```++In Claude Code, for example, you can run `/mcp add metabase https://{your-metabase.example.com}/api/mcp --transport streamable-http` and Claude will handle the OAuth flow for you.++For Claude Desktop, you can create a [custom connector](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp) by just giving it that URL to your Metabase's mcp endpoint.++## Authentication++MCP clients authenticate with Metabase using OAuth 2.0. Metabase runs its own embedded OAuth server, so you don't need to set up an external OAuth provider.++Your MCP client should try to connect to your Metabase. You'll see a Metabase-branded consent page asking you to approve the connection to your Metabase.++A first-time connection will go something like this:++1. The client discovers Metabase's OAuth endpoints.+2. The client registers itself with Metabase.+3. You're redirected to Metabase to log in (if you aren't already) and approve the connection.+4. The client receives an access token scoped to the permissions you have in Metabase.++Results returned by the MCP server are sent to your MCP client, which may forward them to an AI provider depending on how the client is configured. See [Privacy](./settings.md#privacy).++## Available tools++Some clients (like Claude Desktop) will ask you to approve each tool the first time it's used. The MCP server builds on Metabase's [Agent API](./agent-api.md), and exposes the following tools. If you're building a custom integration and need full control, use the [Agent API](./agent-api.md) directly instead.++- **search**: Find tables and metrics using keyword or natural language search.+- **get_table**: Get details about a table, including its fields, related tables, and metrics.+- **get_table_field_values**: Get sample values and statistics for a field in a table.+- **get_metric**: Get details about a metric, including its queryable dimensions.+- **get_metric_field_values**: Get sample values and statistics for a field in a metric.+- **construct_query**: Construct a query against a table or metric. Returns an opaque query string that can be executed with `execute_query`.+- **execute_query**: Execute a previously constructed query and return the results with column metadata, row count, and execution time.+- **query**: Query a table or metric and return results.++## Further reading++- [Agent API](./agent-api.md)+- [Metabase API docs](../api.html)+- [Model Context Protocol specification](https://modelcontextprotocol.io/)diff --git a/docs/ai/metabot-slack.md b/docs/ai/metabot-slack.mdindex fddf1e8ffb6..96a9f31eee7 100644--- a/docs/ai/metabot-slack.md+++ b/docs/ai/metabot-slack.md@@ -17,7 +17,8 @@ From Slack you can ask Metabot to:- **Answer questions**: Create ad-hoc queries from natural language to answer your questions on the spot. You can click the link to save the question in Metabase.- **Show charts and tables**: Render static visualizations or tabular results in Slack. You can copy table results or download them as TSV.- **Work with CSVs**: [Upload a CSV](../databases/uploads.md) to Metabase, then ask follow-up questions about the data.-- **Manage notifications**: Create [subscriptions](../dashboards/subscriptions.md) and [alerts](../questions/alerts.md) from within a channel. Metabot can find an answer and subscribe you to it in one go (though Metabot won't create new questions or dashboards).+- **Create alerts**: Set up [alerts](../questions/alerts.md) on saved questions that get delivered to the current Slack channel. Metabot can find an answer and set up an alert for it in one go (though the question must already be saved).+- **Create dashboard subscriptions**: Set up recurring [subscriptions](../dashboards/subscriptions.md) that deliver a dashboard's contents to the current Slack channel.## Set up Metabot in Slack@@ -49,7 +50,18 @@ To chat with Metabot, people will need to link their Slack account to their Meta### Clearing context-Metabot remembers the context of a thread. To clear context and start a fresh conversation, either begin a new direct message or @mention Metabot in a new thread in a channel.+Metabot remembers the context of a thread. To clear context and start a fresh conversation, either begin a new direct message or @mention Metabot in a new thread in a channel.++## Alerts and subscriptions++From Slack, Metabot can create [alerts](../questions/alerts.md) and [dashboard subscriptions](../dashboards/subscriptions.md) that deliver to the current Slack channel.++Some caveats:++- For goal-based alerts, the goal line must already be configured and saved on the question. Metabot can't add goal lines.+- Metabot can't modify or delete existing alerts or subscriptions.+- Alerts and subscriptions are delivered to the Slack channel where the conversation takes place. You can't redirect them to a different channel or to email.+- Alerts can only be set on questions not metrics or ad-hoc queries.## Notes on privacydiff --git a/docs/ai/metabot.md b/docs/ai/metabot.mdindex b787e03a6db..890a86a093e 100644--- a/docs/ai/metabot.md+++ b/docs/ai/metabot.md@@ -71,7 +71,7 @@ You can also ask Metabot to tell you about specific tables in your database.When you ask Metabot to create a chart from natural language, it first looks for existing questions that might answer your request. If it finds a relevant question, it'll point you to that instead of creating something new. Otherwise, Metabot will use the [query builder](../questions/query-builder/editor.md) to create a new chart for you.-Keep in mind that Metabot is still learning the query builder. Metabot can only handle basic query builder operations, and it lacks access to the library of [custom expressions](../questions/query-builder/expressions-list.md). Metabot is also limited to single-level aggregation and grouping, so if you need more complex analysis, you can take over and refine the query yourself, or switch to the SQL editor.+Metabot is not magic, and it's [still learning Metabase and the query builder](#current-limitations).## Metabot in the native editor@@ -123,6 +123,18 @@ Open it from **+ New → AI exploration**, then ask a question or pick one of thWhen answering questions in AI exploration, Metabot searches a limited set of content instead of your entire Metabase. Admins can set a **Collection for natural language querying** to scope AI exploration to a specific collection and its subcollections. You can still refer to content outside that scope by explicitly @-mentioning it in your prompt. See [Metabot AI settings](../ai/settings.md) for more details.+## Current limitations++Metabot is getting smarter all the time, but there are some things it can't do yet:++- **Custom expressions.** Metabot can't use [custom expressions](../questions/query-builder/expressions-list.md) in query builder questions.+- **Multi-level aggregation.** Metabot is limited to a single level of aggregation and grouping.+- **SQL variables.** Metabot can't generate SQL queries that include [SQL parameters](../questions/native-editor/sql-parameters.md) (like filters or field filters).+- **Goal lines.** Metabot can't add [goal lines](../questions/visualizations/line-bar-and-area-charts.md#goal-lines) to charts.+- **Chart formatting.** Metabot can't change visualization settings like colors, axis labels, or number formatting.+- **Managing alerts.** [Metabot in Slack](./metabot-slack.md) can create alerts and dashboard subscriptions, but can't modify or delete existing ones.+- **Search.** Metabot can only search for tables, metrics, questions, models, and dashboards. It can't discover segments, measures, documents, collections, actions, or indexed entities on its own — but it can use segments and measures in ad-hoc queries (for example, filtering by a segment).+## Metabot in SlackSlack Metabot directly or @mention it in a channel to ask questions about your data. See [Metabot in Slack](./metabot-slack.md).diff --git a/docs/ai/settings.md b/docs/ai/settings.mdindex d96b3a492c8..256ed4587a5 100644--- a/docs/ai/settings.md+++ b/docs/ai/settings.md@@ -1,26 +1,31 @@----title: Metabot AI settings-summary: Configure Metabot settings, including which collections Metabot can access, and learn tips for improving Metabot's performance through data modeling and metadata.+title: AI settings+summary: Connect an AI provider and configure AI settings, including Metabot, collections, and tips for improving performance.+redirect_from:+ - /docs/latest/ai/sql-generation----# Metabot AI settings+# AI settings-> Metabot is only available as an add-on on Metabase Cloud.+> AI features are available with your own AI provider API key, or as an add-on on [Metabase Cloud](https://www.metabase.com/features/metabot-ai)._Admin > AI_-This page covers admin settings for Metabase's AI assistant, [Metabot](./metabot.md).+This page covers admin settings for AI features in Metabase, including [Metabot](./metabot.md).-+On **Metabase Cloud** you can either:-Before using Metabot in your Metabase, you'll need to add the Metabot add-on to your instance in Metabase Store.+- [Purchase the Metabot add-on](#add-metabot-from-the-metabase-store) from the Metabase Store, or+- [Bring your own API key](#bring-your-own-api-key) from a supported AI provider.++On **self-hosted Metabases**: you can [bring your own API key](#bring-your-own-api-key) from a supported AI provider.## Add Metabot from the Metabase Store-For now, Metabot is only available for Metabase Cloud. Before you can set up Metabot in your Metabase, you'll need to add Metabot to your subscription from the Metabase Store.+If you're on [Metabase Cloud](https://www.metabase.com/cloud/), you can add Metabot from the Metabase Store:1. Go to [store.metabase.com](https://store.metabase.com).-2. Log in with your **Metabase Store account** (distinct from the account you use to log into your Metabase).+2. Log in with your **Metabase Store account** (distinct from the account you use to log in to your Metabase).3. In the **Instances** tab, find the instance you'd like to add Metabot to, and click "Add Metabot AI".4. Pick the plan based on the number of requests you expect you'll need.@@ -28,45 +33,73 @@ For now, Metabot is only available for Metabase Cloud. Before you can set up Met5. Read through the [terms of service](https://www.metabase.com/license/hosting) and click **Add Metabot AI**.-Once you've added Metabot AI in the Metabase store, you can log into your Metabase and configure it in _Admin > AI_.+Once you've added Metabot AI in the Metabase store, you can log in to your Metabase and configure it in _Admin > AI_.++## Bring your own API key++_Admin > AI > Connection settings_++++To enable AI features with your own API key:++1. Go to **Admin > AI > Connection settings**.+2. Select your **Provider**.+3. Enter your **API key**.+4. Click **Connect**.+5. Select a **Model** from the dropdown. Available models are fetched from the provider using your API key.++When your connection is active, you'll see a **CONNECTED** badge. With your key connected, you get access to [Metabot](./metabot.md), [inline SQL generation](./metabot.md#inline-sql-editing), the [MCP server](./mcp.md), and the [Agent API](./agent-api.md).++### Supported providers++Currently, Metabase only supports models from Anthropic.-## Metabot options+## Configure Metabot-You can set options for Metabot, both for your internal Metabase, and (separately) for embedded Metabase contexts. That way you can, say, use Metabot in your Metabase, while not giving access to Metabot in your embedded Metabase.+_Admin > AI > Metabot_-- [Enable Metabot](#enable-metabot)-- [Verified content](#verified-content)-- [Collection Metabot can use](#collection-metabot-can-use)+-## Enable Metabot+You can configure Metabot for your internal Metabase separately from [embedded](../embedding/introduction.md) Metabase contexts. That way you can, for example, use Metabot in your Metabase while not granting access to Metabot in your embedded Metabase.-Toggle [Metabot](./metabot.md) on or off for your Metabase or embedded contexts. Both Metabot and Embedded Metabot are enabled by default.+### Enable Metabot-### Internal Metabot+Toggle [Metabot](./metabot.md) on or off for your Metabase. Metabot is enabled by default.-When enabled, Metabot is available to help people create questions, analyze data, and answer questions about your data. When disabled, the Metabot icon and keyboard shortcuts are hidden.+When enabled, Metabot is available to help people create questions, analyze data, and answer questions about your data. When disabled, the Metabot icon and keyboard shortcuts are hidden. Currently, Metabot is available to everyone who uses your Metabase. There's no way to scope Metabot usage per person.++Toggling off Metabot only turns off in-app Metabot features. People can still use the [MCP server](./mcp.md) and [Agent API](./agent-api.md). To turn off the MCP server and Agent API, you'll need to disconnect from the provider in **Admin > AI > Connection settings**.### Embedded Metabot-The toggle will turn embedded Metabot on or off. The toggle affects both full-app embeds and modular embeds.+_Admin > AI > Embedded Metabot_++The toggle turns embedded Metabot on or off. The toggle affects both full-app embeds and modular embeds.- [Full-app embedding](../embedding/full-app-embedding.md): The Metabot icon and keyboard shortcuts are only available when Metabot is enabled. Turning off Embedded Metabot will hide these icons and disable the keyboard shortcuts.-- [Modular embedding](../embedding/modular-embedding.md) The toggle doesn't add Metabot anywhere; you have to explicitly include a chat component (like the SDK's [`MetabotQuestion`](../embedding/sdk/ai-chat.md)) in your application. If, however, you've added a component, and you turn off the Embedded Metabot toggle, your chat component will stop working, so you should also remove or hide the component in your application.+- [Modular embedding](../embedding/modular-embedding.md): The toggle doesn't add Metabot anywhere; you have to explicitly include a chat component (like the SDK's [`MetabotQuestion`](../embedding/sdk/ai-chat.md)) in your application. If, however, you've added a component, and you turn off the Embedded Metabot toggle, your chat component will stop working, so you should also remove or hide the component in your application.-## Verified content+### Verified contentAdmins on Pro and Enterprise plans can tell Metabot to only work with [models](../data-modeling/models.md) and [metrics](../data-modeling/metrics.md) that have been [verified](../exploration-and-organization/content-verification.md).Restricting Metabot to verified models and metrics (and only models and metrics) helps Metabot produce more reliable answers, since you know someone has at least vetted the data Metabot can use.-## Collection Metabot can use+### Collection for natural language queryingSelect a collection (including its subcollections) to limit which collections Metabot searches during [AI exploration](../ai/metabot.md#ai-exploration).-This setting only affects conversations started from **+ New → AI exploration**.+This setting only affects conversations started from **+ New > AI exploration**.People can still @-mention items outside of this collection when prompting in AI exploration. Metabot can also see the person's current context (for example, Metabot will know about the dashboard they're currently viewing, even if the dashboard is outside the selected collection).+### Prompt suggestions++When people open a new Metabot chat, Metabase shows a few suggested prompts.++Click **Regenerate suggested prompts** to generate a fresh set of prompts. You can also run individual prompts to test Metabot's answers, or delete prompts that aren't useful.+## Tips for making the most of MetabotThe best thing you can do to improve Metabot's performance is to prep your data like you would for onboarding a new (human) hire to your data. In practice, this means you should:@@ -74,7 +107,6 @@ The best thing you can do to improve Metabot's performance is to prep your data- [Add descriptions for your data and content](#add-descriptions-for-your-data-and-content)- [Make sure the semantic types for each field are correct](#make-sure-the-semantic-types-for-each-field-are-correct)- [Define domain-specific terms in the glossary](#define-domain-specific-terms-in-the-glossary)-- [Curate prompt suggestions](#curate-prompt-suggestions)### Add descriptions for your data and content@@ -85,7 +117,7 @@ Admins can also curate [table metadata](../data-modeling/metadata-editing.md) byFor example, here's a decent description for an ID field that provides additional context for the data:```txt-This is a unique ID for the product. It is also called the “Invoice number” or “Confirmation number” in customer facing emails and screens.+This is a unique ID for the product. It is also called the "Invoice number" or "Confirmation number" in customer facing emails and screens.```You can even ask Metabot to write descriptions for you. But Metabot will only have access to the data in the database. It can't know things like "this ID is called the 'Invoice number' in the web app", which is the kind of contextual information worth documenting.@@ -98,43 +130,39 @@ Metabase will try to set semantic types automatically, but you should confirm th### Define domain-specific terms in the glossary-Add your organization's terminology, acronyms, and business-specific terms to the [glossary](../exploration-and-organization/data-model-reference.md#glossary). When Metabot receives a prompt, it can look up terms in the glossary to better understand your request.+Add your organization's terminology, acronyms, and business-specific terms to the [glossary](../exploration-and-organization/data-model-reference.md#glossary). When you submit a prompt, Metabot can look up terms in the glossary to better understand your request.For example, if you define "MRR" as "Monthly Recurring Revenue" in your glossary, Metabot will know what you mean when you ask "What's our MRR for Q4?" This is especially helpful for industry-specific jargon, internal product names, or abbreviations unique to your organization.-### Curate prompt suggestions--When you select a collection for Metabot to "learn", Metabot will suggest a series of prompts based on the content it finds in that collection. These prompts just give people a feel for the kinds of things people can ask Metabot to do.--Admins can run these generated prompts to test the answers, or trash the individual prompts if they're not useful or misleading. You can also regenerate all the prompts with a click.-## Metabot permissions are Metabase permissions-Metabot inherits the permissions of the current user, so you don't need to set permissions specifically for Metabot. Whenever someone uses Metabot, Metabot can only see what that person has permissions to see and do.+Metabot inherits the permissions of the person it's chatting with, so you don't need to set permissions specifically for Metabot. Whenever someone uses Metabot, Metabot can only see what that person has permissions to see and do.In other words, to restrict what data Metabot can see for each person, simply apply [data](../permissions/data.md) and [collection](../permissions/collections.md) permissions to their groups as you would normally, and those permissions will apply to their use of Metabot as well.## Viewing Metabot usage-You can see how many Metabot requests people have made this month by going to **Admin > Settings > License**.+If you're on Metabase Cloud with the Metabot add-on, you can see how many Metabot requests people have made this month by going to **Admin > Settings > License**.-If you aren't logged into the [Metabase Store](../cloud/accounts-and-billing.md).(, you'll need to log in to the store before you can view the usage. Once logged in to the store, go back to your Metabase and view the license page.+If you aren't logged into the [Metabase Store](../cloud/accounts-and-billing.md), you'll need to log in to the store before you can view the usage. Once logged in to the store, go back to your Metabase and view the license page.The **Metabot AI requests used, this month (updated daily)** field shows how many requests your Metabase has used this month. Each message sent to Metabot counts as a request.-## Metabot can't be enabled per person+If you're using your own API key, you can track usage and costs through your AI provider's dashboard.++## Choosing the AI model-Currently, Metabot is available to everyone who uses your Metabase.+If you're using your own API key, you can choose which AI model Metabase uses in [Connection settings](#bring-your-own-api-key).-## Metabot uses a variety of generative AI models to answer your questions+On Metabase Cloud, Metabase's AI service selects models automatically. We use internal benchmarks to determine which AI models work best for different tasks, and we're constantly iterating to improve performance.-Under the hood, Metabase powers Metabot with a variety of generative models. For now, you can't change which generative AI models Metabot uses, as Metabase's AI service handles their selection.+## Privacy-To get the best results, we (the Metabase team) use internal benchmarks to determine which AI models Metabot should use for different tasks. And we are constantly iterating on performance, so Metabot will continue to improve over time.+On Metabase Cloud with the Metabot add-on, your questions and conversations remain private to your Metabase -- we don't send your data to external services. We do collect some metadata to gauge and improve usage.-## Unless you submit feedback, we don't collect or store the prompts you send to Metabot+If you're using your own API key, your prompts and data are sent to your selected AI provider. Review your provider's data handling and privacy policies. When using the [MCP server](./mcp.md), query results are sent to the connected MCP client.-We've intentionally limited what Metabot can do. Metabot lacks access to API keys, and it can't create assets, write data, or send your data outside of your Metabase. Your questions and conversations remain private to your Metabase (unless you [submit feedback](./metabot.md#giving-feedback-on-metabot-responses)). We do collect some metadata to gauge and improve usage.+In both cases, Metabot can't create assets or write data. If you [submit feedback](./metabot.md#giving-feedback-on-metabot-responses), the form you send may contain sensitive data from your conversation.### What Metabot can see@@ -144,4 +172,4 @@ Metabot has access to your Metabase metadata and some data values to help answer- **Sample field values**: When you ask questions like "Filter everyone from Wisconsin," Metabot might check the values in the state field to understand how the data is stored (like "WI" vs "Wisconsin"). See [syncs](../databases/sync-scan.md).- **Timeseries data**: For chart analysis, Metabot might see the timeseries data used to draw certain visualizations, depending on the chart type.-When you [submit feedback](./metabot.md#giving-feedback-on-metabot-responses), however, the form you send may contain sensitive data from your conversation.+This data may be included when you [submit feedback](./metabot.md#giving-feedback-on-metabot-responses).diff --git a/docs/ai/sql-generation.md b/docs/ai/sql-generation.mddeleted file mode 100644index 332eb52eb37..00000000000--- a/docs/ai/sql-generation.md+++ /dev/null@@ -1,55 +0,0 @@-----title: SQL generation on self-hosted Metabases-summary: Bring your own API key to generate SQL from natural language in your self-hosted Metabase.------# SQL generation on self-hosted Metabases--> One-shot SQL generation with your own API key is only available on self-hosted Metabases. For Metabase Cloud, check out [Metabot](./metabot.md).--Bring your own API key to generate SQL from natural language in the [native editor](../questions/native-editor/writing-sql.md).--## Setting up one-shot SQL generation--To enable SQL generation on a self-hosted Metabase:--1. Go to **Admin settings > AI**.-2. Enter your **Anthropic API key**.-3. Select the AI model you'd like to use for SQL generation. (Opus models typically give the best results.)----You'll need an API key from [Anthropic](https://www.anthropic.com/learn/build-with-claude). Once you've entered the key, anyone in your Metabase can use SQL generation in the native editor.--Currently, only Anthropic is supported.--## Generate SQL from natural language----To generate SQL from a natural language prompt:--1. Open the [native editor](../questions/native-editor/writing-sql.md).--2. Press **Cmd+Shift+I** (Mac) or **Ctrl+Shift+I** (Windows).--3. Enter one or more tables.--4. Type a prompt describing the query you want to write.--5. Click **Generate** to create the SQL.--6. Review the generated SQL before running it.--You can also edit existing SQL. Place your cursor in the query, trigger the prompt, and describe the change you want to make (like "add a filter for orders from this year"). Metabase will suggest edits that you can accept or reject. You must select at least one table for both new queries and edits.----Each prompt is independent — the AI doesn't retain context from previous generations.--Like with all generative AI, always double-check the output.--## Further reading--- [The native/SQL editor](../questions/native-editor/writing-sql.md)-- [Metabot](./metabot.md)diff --git a/docs/ai/start.md b/docs/ai/start.mdindex e238435b966..9e6101bf05c 100644--- a/docs/ai/start.md+++ b/docs/ai/start.md@@ -4,24 +4,24 @@ title: "AI in Metabase"# AI in Metabase-> Metabot is only available as an add-on for Metabase Cloud.+> AI features are available as an add-on on [Metabase Cloud](https://www.metabase.com/features/metabot-ai), or on self-hosted Metabase with your own AI provider API key.## [Metabot](./metabot.md)Metabot is an AI assistant that helps you explore and analyze your data.-## [Setting up Metabot](./settings.md)+## [AI settings](./settings.md)-Admins can configure Metabot to focus on specific collections and manage example prompts.--## [SQL generation](./sql-generation.md)--Use your own API key to generate SQL from natural language on self-hosted Metabases.+Connect an AI provider and configure AI features like Metabot.## [Agent API](./agent-api.md)A REST API for building headless, agentic BI applications on top of Metabase's semantic layer.+## [MCP server](./mcp.md)++Connect MCP-compatible AI clients to your Metabase.+## [Metabot in Slack](./metabot-slack.md)Chat with Metabot directly in Slack — ask questions, get charts, and manage subscriptions without leaving Slack.