MCPInstall

metabase-database-metadata

Understands the Metabase Database Metadata Format — a YAML-based on-disk representation of databases, tables, and fields synced from a Metabase instance. Use when the user needs to read, edit, or understand metadata files produced by @metabase/database-metadata, or when reasoning about a project's schema (columns, types, FK relationships) through the .metadata/databases folder.

Installs
564
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/metabase/agent-skills --skill metabase-database-metadata
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads metabase-database-metadata automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Metabase Database Metadata Format

Metabase represents database metadata — synced databases, their tables, and their fields — as a tree of YAML files. Files are diff-friendly: numeric IDs are omitted entirely, and foreign keys use natural-key tuples like ["Sample Database", "PUBLIC", "ORDERS"] instead of database identifiers.

The format is defined by a specification bundled alongside this file as spec.md (upstream source: metabase/database-metadata). The same project ships a CLI (@metabase/database-metadata on npm) that converts the raw JSON exported from a Metabase instance into the YAML tree described by the spec.

Canonical layout

All metadata for a project lives under a top-level .metadata/ directory:

  • .metadata/databases/ — the YAML tree. This is the canonical source for the agent. Read these files to understand the schema, columns, types, and FK relationships.
  • .metadata/table_metadata.json — the raw JSON exported from the Metabase instance. Potentially multi-megabyte (or multi-gigabyte) JSON with flat databases / tables / fields arrays. Never open, grep, or pass it to tools. It exists only as input to the extractor.

The .metadata/ directory should be gitignored. On large warehouses the extracted metadata can reach gigabytes — committing it would make the repo painful or unusable.

First-time setup

Do not run any of the steps below proactively at session start. Only run them when the user explicitly asks to fetch metadata, set up the workflow, or requests something that plainly requires knowledge of the database schema (e.g. "write a query against ORDERS", "describe what tables exist").

When setup is triggered:

1. Ensure .metadata/ is gitignored

Read the repo's .gitignore and confirm .metadata/ is listed. If it isn't, ask the user before modifying .gitignore — e.g.:

.metadata/ is not in .gitignore. Committing it would bloat the repo (metadata can be gigabytes). Shall I add it?

Only edit .gitignore after the user confirms.

2. Export the metadata from Metabase

Fetch table_metadata.json by calling POST /api/ee/serialization/metadata/export on the Metabase instance and writing the response to .metadata/table_metadata.json. The endpoint accepts three boolean query parameters that opt sections in or out — they all default to false, so requests must explicitly set the sections they want:

  • with-databases — include the databases array.
  • with-tables — include the tables array.
  • with-fields — include the fields array.

A typical full export sets all three to true. The user supplies the base URL and an API key (e.g. via METABASE_URL and METABASE_API_KEY env vars):

mkdir -p .metadata
curl -sf -X POST "$METABASE_URL/api/ee/serialization/metadata/export?with-databases=true&with-tables=true&with-fields=true" \
  -H "X-API-Key: $METABASE_API_KEY" \
  -o .metadata/table_metadata.json

If the user has not provided credentials, ask for them before running the call.

3. Extract

Once .metadata/table_metadata.json is in place:

rm -rf .metadata/databases
npx @metabase/database-metadata extract-table-metadata .metadata/table_metadata.json .metadata/databases

Then read the YAML tree under .metadata/databases/ to answer the user's question.

Session start behaviour

At the start of a session, do not run any fetch commands. Just observe what's on disk:

  • If .metadata/table_metadata.json and .metadata/databases/ both exist, assume the tree is sufficiently up to date and use it directly. Do not refetch.
  • If the tree is missing or only partial, do nothing until the user asks for something that needs it — then fall into the first-time-setup flow above.

If something in the tree looks stale or inconsistent while you're using it, mention it to the user and let them decide whether to refetch. Never refresh silently.

Refreshing (user-initiated only)

If the user explicitly asks to refresh metadata, re-run the export call to overwrite .metadata/table_metadata.json, then re-run the extract step. Always remove .metadata/databases before re-extracting so stale files are not left behind.

Entities

Three entity types, two file types:

EntityFileDescription
Database.metadata/databases/{db}/{db}.yamlA connected data source (Postgres, MySQL, BigQuery, etc.). Identified by name.
Table.metadata/databases/{db}/schemas/{schema}/tables/{table}.yaml (or .../tables/{table}.yaml for schemaless DBs)A physical table or view. Contains a fields array with all its columns nested inline.
Field(nested inside a Table YAML, no separate file)A column. Includes base_type, database_type, and optionally effective_type, semantic_type, coercion_strategy, parent_id, fk_target_field_id.

Foreign keys

Foreign keys use natural-key tuples, not numeric IDs:

  • Database FK: the database name (string) — e.g. "Sample Database"
  • Table FK: [database, schema_or_null, table] — e.g. ["Sample Database", "PUBLIC", "ORDERS"]
  • Field FK: [database, schema_or_null, table, field, ...nested_field_names] — e.g. ["Sample Database", "PUBLIC", "EVENTS", "DATA", "user", "name"] for a JSON-unfolded column DATA.user.name

Field-level FKs show up as parent_id (nested field parent) and fk_target_field_id (referenced PK for FK columns).

Type attributes on fields

  • database_type — the raw native type string from the driver (BIGINT, VARCHAR, JSONB, etc.). Database-specific.
  • base_type — the Metabase type matching the native type (type/BigInteger, type/Text, type/Structured, etc.).
  • effective_type — the type Metabase treats the column as at query time. Only emitted when it differs from base_type (i.e. coercion is configured).
  • coercion_strategy — the rule producing effective_type from base_type (e.g. Coercion/ISO8601->DateTime, Coercion/UNIXMilliSeconds->DateTime).
  • semantic_type — business-domain label (type/PK, type/FK, type/Email, type/Category, type/Latitude, etc.). Drives UI and some analytical behavior.

See the bundled spec for the full type hierarchy and available coercion strategies.

Reading the spec

This skill ships with a local snapshot of the spec as spec.md, alongside SKILL.md.

Read it on demand, not eagerly. Open spec.md only when you actually need detail beyond what SKILL.md summarizes — e.g. the full base-type / semantic-type hierarchy, the complete list of coercion strategies, or the exact folder-path rules. Do not open it at session start, and do not open it for tasks unrelated to the metadata tree.

If the bundled copy looks out of date with the upstream package, the skill's own README.md documents how to refresh it with extract-spec.

FAQ

What does the metabase-database-metadata skill do?

Understands the Metabase Database Metadata Format — a YAML-based on-disk representation of databases, tables, and fields synced from a Metabase instance. Use when the user needs to read, edit, or understand metadata files produced by @metabase/database-metadata, or when reasoning about a project's schema (columns, types, FK relationships) through the .metadata/databases folder.

How do I install metabase-database-metadata?

Run npx skills add https://github.com/metabase/agent-skills --skill metabase-database-metadata in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/metabase-database-metadata/ (personal) or .claude/skills/metabase-database-metadata/ (project).

Which AI agents can use metabase-database-metadata?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is metabase-database-metadata safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains metabase-database-metadata?

It is published by metabase in metabase/agent-skills. It has 564 recorded installs.

More from metabase/agent-skills

View all →

rde

metabase/agent-skills

Expert data engineering with Metabase at the center of any company's stack: explore and profile raw warehouse tables, build clean tables as Metabase transforms pinned by transform tests, build the semantic layer (models, metrics, measures, segments, metadata), design dashboards, answer questions with checked numbers, reconcile against a reference, change delivered definitions safely. Use for data work, not one mb command (metabase-cli): "make sense of my data", "model this raw schema", "set up analytics for X", "build a data model", "define MRR / active customers officially", "build a semantic layer", "go from raw tables to a dashboard", "does this number match finance", "our numbers look wrong", "two cards disagree", "test this transform", "why does this transform get case X wrong", "make Metabot answer questions about X", "explain this table", "change this definition", "build a data app", "donor retention", "event attendance", "quarterly board report", "be my data engineer / anal

Data & Databases949 installs

rde-data-apps

metabase/agent-skills

Build or change a Metabase data app on an rde machine: settles what the metabase-data-apps skill needs from the local setup (the remote-sync repository, the Metabase URL, the API key rde stores, how the app reaches Metabase), makes sure everything the app reads is Library content already synced into that repository, confirms every sync step with the user, and hands the build to it. Use only when an app is asked for explicitly: "build me an app for X", "create a data app", "make an internal tool / portal in Metabase", "add a page / a form / a filter to my data app". A dashboard, a question, or a metric is not an app; those stay with the rde skill.

Backend & APIs877 installs

metabase-cli

metabase/agent-skills

Drive a Metabase instance from the terminal via the mb CLI: auth profiles, databases and schemas, schema sync and field-values rescan, tables, fields, cards (questions, models, metrics) run as JSON/CSV/XLSX, dashboards and dashcards, collections and their tree, snippets, segments, measures, transforms and transform-jobs, settings, search, git-sync. Use for any Metabase operation from the terminal: "log into metabase", "what profiles do I have", "list cards", "run card 42 as CSV", "create a transform", "list dashboards", "move a dashcard", "list collections", "what's in collection 4", "show the collection tree", "list snippets", "create a segment", "archive a measure", "search metabase for X", "import the latest changes", "add a directory to git sync", "set a setting", "what schemas are in this database", "trigger a sync", "rescan field values", or any mb . Whole data jobs go to rde.

Data & Databases784 installs

metabase-representation-format

metabase/agent-skills

Understands the Metabase Representation Format — a YAML-based serialization format for Metabase content (collections, cards, dashboards, documents, segments, measures, snippets, transforms, actions, and data apps). Use when the user needs to create, edit, understand, or validate Metabase representation YAML files, or when working with Metabase serialization/deserialization (serdes). Covers entity schemas, MBQL and native queries, visualization settings, parameters, and folder structure.

AI & Agents535 installs

metabase-semantic-checker

metabase/agent-skills

Open the skill to read its SKILL.md instructions.

AI & Agents432 installs

Open the skill to read its SKILL.md instructions.

AI & Agents370 installs

Popular data & databases skills

View category →

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

OfficialData & Databases462.2K installs

prisma-client-api

prisma/skills

Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".

OfficialData & Databases393.5K installs

Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.

OfficialData & Databases392.3K installs

prisma-cli

prisma/skills

Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.

OfficialData & Databases390.8K installs

prisma-postgres

prisma/skills

Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.

OfficialData & Databases384.4K installs

Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.

OfficialData & Databases378.9K installs