Connecting External Consumers¶
Dashboards, SQL tools, services written in other languages and AI agents sometimes need data from a Metaxy metadata store. This page explains how these external consumers can read feature definitions and feature metadata.
Reading Feature Definitions¶
A consumer often needs to know which features exist, which ID columns and fields they have, and which feature version is current. Metaxy keeps this information in the metadata store.
Read the metaxy_system__feature_versions table, which metaxy push writes. For each feature_key, the row with the latest recorded_at holds the current definition.
Reading Feature Metadata¶
It's often desired to read the current rows of a feature. Use one of the methods below to fetch feature metadata correctly, according to Metaxy's storage layout.
From Python¶
If the consumer can run Python, use MetadataStore.read. It returns only the latest rows of the current feature version (see Reading Metadata).
From CLI¶
For a quick check from a shell, use the mx metadata commands. For example, mx metadata status --format json prints the number of rows and the number of missing, stale and orphaned samples of each feature.
From Database Views¶
Dashboards and SQL tools often can only run SQL queries against the database. Give them a database view. Create the view from the frame that MetadataStore.read returns since it also carries the right SQL query:
Example
with store.open("w"):
store.conn.create_view(
"my__feature__current",
store.read(MyFeature, allow_fallback=False).to_native(),
overwrite=True,
)
Note
This example only works with Ibis-backed metadata stores.
MCP Server¶
An AI agent often has to find out which features exist before it can query their metadata. Give it the MCP server. Its tools list the features and their specifications, list the configured metadata stores and query the metadata of a feature.