Skip to content

Commit 9f3acd4

Browse files
committed
Sync to upstream v0.62.2
2 parents df64505 + fd77eb3 commit 9f3acd4

236 files changed

Lines changed: 8123 additions & 2181 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clj-kondo/config/modules/config.edn

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,8 @@
14351435

14361436
oauth-server
14371437
{:team "UX West"
1438-
:api #{metabase.oauth-server.api
1438+
:api #{metabase.oauth-server.api ;; Special case OAuth standard endpoints under `/`
1439+
metabase.oauth-server.api.admin ;; The usual Metabase internal API endpoints under `/api`
14391440
metabase.oauth-server.core
14401441
metabase.oauth-server.init}
14411442
:uses #{api
@@ -3078,7 +3079,8 @@
30783079
:api #{metabase-enterprise.erd.api}
30793080
:uses #{api
30803081
models
3081-
util}
3082+
util
3083+
warehouse-schema}
30823084
:model-imports #{:model/Database
30833085
:model/Field
30843086
:model/Table}}

.github/workflows/release-embedding-sdk.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,13 +387,11 @@ jobs:
387387
- name: Publish to NPM
388388
working-directory: sdk
389389
run: |
390-
npm publish --tag 62-beta
390+
npm publish --tag 62-stable
391391
392+
# When a newer release branch goes gold, remove this entire job from this branch.
392393
tag-latest:
393394
name: Tag npm release as latest
394-
# ⚠️ This should only run on the most recent release branch (e.g. `release-x.61.x`),
395-
# and only once it becomes stable (gold). Delete this line when gold — do not delete during the pre-gold window.
396-
if: false
397395
needs: [publish-npm, determine-sdk-version]
398396
uses: ./.github/workflows/embedding-sdk-tag-latest.yml
399397
with:

.typedoc/typedoc-plugin-frontmatter.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ export function load(app) {
2828
.map(([key, value]) => `${key}: ${value}`)
2929
.join("\n");
3030

31-
page.contents = `---\n${yamlItems}\n---\n\n${page.contents}`;
31+
// Generate a redirect_from for the parallel `embedding/api/<Name>` path.
32+
// Snippets in `sdk/api/snippets/*.md` link with relative `./api/X.md`; when
33+
// included into a doc outside `sdk/` (e.g. `embedding/parameters.md`),
34+
// that resolves to `embedding/api/X` instead of `embedding/sdk/api/X`.
35+
// The redirect makes those URLs resolve via 301 instead of 404'ing.
36+
const pageName = page.url.replace(/\.html$/, "");
37+
const redirectBlock =
38+
pageName && pageName !== "index"
39+
? `\nredirect_from:\n - /docs/latest/embedding/api/${pageName}`
40+
: "";
41+
42+
page.contents = `---\n${yamlItems}${redirectBlock}\n---\n\n${page.contents}`;
3243
});
3344
}

docs/ai/images/mcp-chart.png

85.9 KB
Loading

docs/ai/mcp.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ summary: Connect MCP-compatible AI clients to Metabase to search, explore, and q
99

1010
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.
1111

12-
# Enable MCP server
12+
## Enable MCP server
1313

1414
_Admin > AI > MCP_
1515

@@ -23,7 +23,7 @@ Under **Supported MCP clients**, switch on any clients you want to allow:
2323

2424
- **Claude** (Claude Desktop and Claude on the web)
2525
- **Cursor and VS Code**
26-
- **ChatGPT**
26+
- **ChatGPT**, including **Codex**
2727

2828
Toggling on a client automatically adds that client's sandbox domains to Metabase's CORS allowlist, which is what lets browser-based MCP clients make cross-origin requests to your Metabase.
2929

@@ -39,23 +39,25 @@ https://mcp.internal.example.com https://*.staging.example.com
3939

4040
The field accepts wildcards (`*`) for subdomains. Changes take effect in about a minute. Might be a good time to get up and pour yourself a glass of water.
4141

42-
## Connect an MCP client
42+
## Connect a client to your Metabase MCP server
4343

44-
If your admin has turned on [your Metabase's MCP server](#enable-mcp-server), all you need to do is point your MCP client at Metabase's MCP endpoint, `/api/mcp`. For example:
44+
If your admin has turned on [your Metabase's MCP server](#enable-mcp-server), all you need to do is point your MCP client at Metabase's MCP endpoint, `/api/metabase-mcp`. For example:
4545

4646
```
47-
https://{your-metabase.example.com}/api/mcp
47+
https://{your-metabase.example.com}/api/metabase-mcp
4848
```
4949

50-
In the terminal, for example, you can run the following command.
50+
You can find your instance's MCP URL in **Admin > AI > MCP**.
51+
52+
For Claude Code, for example, you can run the following command.
5153

5254
```
53-
claude mcp add --transport http metabase https://{your-metabase-url}/api/mcp
55+
claude mcp add --transport http metabase https://{your-metabase-url}/api/metabase-mcp
5456
```
5557

56-
Replacing {your-metabase-url} with your Metabase address. Once added, Claude Code will handle the OAuth flow for you:
58+
replacing {your-metabase-url} with your Metabase address.
5759

58-
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.
60+
Once you add the MCP server, your client will direct you to authentication page for your Metabase instance.
5961

6062
## Authentication
6163

@@ -92,35 +94,51 @@ For example, if you ask your AI client to use your Metabase's MCP server "what's
9294

9395
You don't need to have an [AI provider](settings.md#choose-ai-provider) configured in Metabase to use your Metabase's MCP server. If you _do_ have an AI provider configured in Metabase to power Metabot, that provider will _not_ be used for MCP server requests. MCP calls by your local client have no effect on token usage for your Metabase's AI connection.
9496

97+
## Using the MCP server
98+
99+
100+
The MCP server will return results as either text or an inline chart, depending on the question you asked.
101+
102+
If you want the MCP server to return an inline chart, ask it to "show" or "visualize" the data:
103+
104+
![Show me the stuff](./images/mcp-chart.png)
105+
106+
Currently, the Metabase MCP server supports bar and line charts. You can drill-through through the charts, change time granularity, or explore them in Metabase.
107+
108+
If your client is connected to other MCP servers, you can asks questions that combine data from multiple sources. For example, you can ask a question about your customers that combines data from Metabase, your CRM, and your support ticket platform (Though maybe you should put all that data into your Metabase).
109+
110+
See [Available tools](#available-tools) for the list of functionality supported by the MCP server.
111+
95112
## Available tools
96113

97114
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.
98115

99-
### Discovery and reading
116+
#### Find and read content
100117

101118
- **search**: Find tables, metrics, cards, dashboards, and collections using keyword or natural language search.
102119
- **read_resource**: Read one or more Metabase entities by `metabase://` URI. Covers database / schema / table / collection / card / dashboard / metric / transform navigation in a single tool. Up to 5 URIs per call.
103120

104-
### Query construction and execution
121+
#### Query and visualize data
105122

106123
- **construct_query**: Construct a query against a table or metric. Returns an opaque query handle that can be passed to `execute_query`.
107124
- **query**: Query a table or metric and return results.
108125
- **execute_query**: Execute a previously constructed query and return the results with column metadata, row count, and execution time.
109126
- **execute_sql**: Execute a raw SQL query against a database. Requires native-query permission on the target database. An admin can disable this tool instance-wide via the `mcp-execute-sql-enabled` setting.
127+
- **visualize_query**: render a chart inline in your AI client (bar or line chart only).
110128

111-
### Writing
129+
#### Create content
112130

113131
- **create_question**: Save a query as a named question (card).
114132
- **update_question**: Update a saved question. Setting `collection_id` moves the card to another collection.
115133
- **create_dashboard**: Create a new dashboard, optionally populated with saved questions.
116134
- **update_dashboard**: Update a dashboard's metadata (name, description, collection, archived).
117135
- **create_collection**: Create a new collection, optionally nested under a parent collection.
118136

119-
## Use the MCP server with file-based development
137+
## Use the MCP server with agent-driven development
120138

121139
You can use the MCP server to help you create Metabase content as serialized YAML files that you can import into your Metabase. Point your agent at the MCP server to give it access to your Metabase's database metadata (table names, fields, and sample values) so it can write questions and dashboards that point at real columns.
122140

123-
See [File-based development](./file-based-development.md).
141+
See [Agent-driven development](./file-based-development.md).
124142

125143
## Further reading
126144

0 commit comments

Comments
 (0)