ms2data/malloy-publisher!build
Publisher is the open-source semantic model server for the Malloy data language. It lets you define semantic models once — and use them everywhere.
Malloy is an open-source language for modeling data. It allows you to define rich semantic data models — specifying the meaning, relationships, and context behind your data.
Malloy models encode trusted business logic (e.g., revenue, active users, churn), and let you query data in terms of your business — not raw SQL. These models are version-controlled, composable, and portable across environments.
You can develop Malloy models using the VS Code extension, which provides an ergonomic environment for writing models, running queries, and building dashboards.
Publisher serves Malloy models through clean APIs — enabling consistent, interpretable, and AI-ready data access for tools, applications, and agents.
Publisher is designed around a familiar, proven workflow:
This mirrors the modeler → analyst flow popularized by tools like DBT and Looker — now reimagined for the AI era, and built on fully open infrastructure.
You can't trust answers if the meaning behind the data isn't clear.
Whether you're building dashboards, deploying AI agents, or enabling ad hoc analysis, every experience relies on a shared understanding of terms like "MRR," "LTV," or "active user." Without that foundation, insights are inconsistent — or dangerously wrong.
Publisher solves this by turning semantic models into reusable data APIs. By combining Malloy's expressive modeling language with an open-source server and no-code data analysis UI, Publisher makes the semantic layer accessible, governable, and extensible — for everyone.
Every Publisher experience starts with a semantic model — written in Malloy and served via the Publisher server. You can create your own model using the Malloy VS Code extension, or use one of the sample models from the malloy-samples repository, which is included in this repo as a submodule.
To bring your semantic models to life, you can run the Publisher server locally and browse your models using the Publisher App in your browser. The app provides a powerful, no-code interface for exploring and querying your models.
For instructions on how to set up, build, and configure the Publisher server, see:
The Publisher's default server configuraiton serves the malloy-samples. Once the server is running, you can access the app at:
Once your model is served, it becomes the foundation for a wide variety of data experiences — no-code analysis, notebooks, AI agents, and more. The sections below showcase how those experiences work in practice:
Once a model is published, analysts can open it in Explorer, a visual query builder built into the Publisher app. Explorer allows analysts to:
🎥 Demo Video: Watch Explorer in action →
📖 Docs: Explorer Documentation →
Use Malloy notebooks (.malloynb files) to create shareable, code-first dashboards directly from your semantic models. These dashboards are versioned alongside your models and can include text, charts, and reusable views — all rendered via Publisher.
🎥 Demo Video: Notebook walkthrough →
📖 Docs: Malloy Notebooks →
Publisher exposes your semantic models via the Model Context Protocol (MCP), making it possible for AI agents to:
This enables tools like Claude, Cursor, or custom agents to generate accurate, interpretable queries using your definitions — not guesses.
🎥 Demo Video: MCP + AI Agent walkthrough →
📖 Docs: AI Agents & MCP Guide →
Using the Publisher SDK, you can build rich data applications — without rebuilding your query engine or rewriting business logic. The Publisher App itself is built from this SDK, and you can remix it to:
🎥 Demo Video: Building an app with the SDK →
📖 Docs: Embedded Data Apps Guide →
Publisher will soon support a SQL-compatible interface (e.g., Postgres wire protocol), allowing you to connect legacy BI tools like:
These tools will be able to query your semantic models directly — gaining consistency and reducing duplicated logic, all without changing how your team works.
📖 Docs (early draft): Traditional BI Dashboards →
Publisher consists of three main components: the Publisher Server (APIs & backend, now including MCP support), the Publisher SDK (UI components), and the Publisher App (a reference data app implementation).
The image below illustrates the composition of the Publisher's components and the tools & applications it can support.
1. Publisher Server (packages/server/)
Core Backend: This is the heart of Publisher. It's a server application responsible for loading and managing Malloy Packages, which encapsulate your semantic models.
Malloy Integration: It utilizes the Malloy runtime to parse .malloy files, understand the rich semantic models defined within them (including relationships, calculations, and business context), and compile Malloy queries into SQL for execution against target databases (BigQuery, ***, Trino, DuckDB, Postgres, MySQL).
API Layers: The Publisher server exposes two primary API interfaces:
api-doc.yaml.2025-03-26 specification revision. This includes providing resource metadata and detailed error messages with suggestions.Malloy Package Format: The Publisher Server loads semantic models, notebooks, and transformations based on the Malloy Package format. This format is designed to integrate seamlessly with standard developer practices.
.malloy files defining data models, queries, and transformations..malloynb files (Malloy Notebooks) for ad hoc analysis, exploration, and dashboard-like presentation.publisher.json manifest file.publisher.json): Contains metadata about the package. Currently, it supports name, version, and description fields. This schema will be expanded significantly as Publisher evolves to better support dependency management, versioning, and integration with package/container registries, further strengthening the governance model.2. Publisher SDK (packages/sdk/)
3. Publisher App (packages/app/)
If you just want to run the Publisher without modify the code, you can do so directly from bunx or npx:
shnpx @malloy-publisher/server --port 4000 --server_root /path/to/malloy_packages
To run the server pointed to the Malloy samples:
shgit clone [***] npx @malloy-publisher/server --port 4000 --server_root .
Alternatively, you can start a container locally or self-host it with Docker.
Once Docker is installed, in a new folder with your data, create a file called publisher.config.json with these contents:
json{ "frozenConfig": false, "projects": { "malloy-samples": "/publisher/malloy-samples" } }
That file will tell the publisher where to look for the Malloy Samples, which you can clone into your new folder:
shgit clone [***]
and run the following command that will link the newly cloned samples with a Docker container:
shdocker run -p 4000:4000 \ -v ./publisher.config.json:/publisher/publisher.config.json \ -v ./malloy-samples:/publisher/malloy-samples \ publisher
Then, open http://localhost:4000 in your browser to continue setup.
You can add more projects of your own by attaching additional volumes and referencing them in the config file.
Follow these steps to build the Publisher components and run the server locally. This project uses bun as the JavaScript runtime and package manager.
1. Initialize and Update Git Submodules:
The Publisher repository uses Git submodules to include sample Malloy models (currently a fork of malloy-samples). These samples are used for testing and demonstrating Publisher's capabilities.
First, initialize the registered submodules:
bashgit submodule init
Then, update the submodules to fetch their content:
bashgit submodule update
2. Install Dependencies:
Install all necessary project dependencies (including those for the server, SDK, and app) using bun:
bashbun install
3. Build the Project:
Compile the TypeScript code for all packages (server, SDK, app) into JavaScript:
bashbun run build:server-deploy
4. Start the Publisher Server:
Run the compiled server code. By default, this will start the REST API server on port 4000 and the MCP server on port 4040. The server will load the Malloy packages found in the submodules.
bashbun run start
Once started, you can typically access the Publisher App (if running) at http://localhost:4000 and the MCP endpoint at http://localhost:4040/mcp.
See packages/app/README.md for information on how to do development on the server.
5. (Optional) Configure GCP Credentials for BigQuery Samples:
Some of the included malloy-samples run queries against Google BigQuery public datasets. To run these specific samples, you need to authenticate with Google Cloud:
Update your Application Default Credentials (ADC) by logging in with gcloud:
bashgcloud auth login --update-adc
Set your default GCP project (replace {my_project_id} with your actual project ID, though for public datasets, any valid project should generally work):
bashgcloud config set project {my_project_id} --installation
The Publisher server (specifically the Malloy runtime) will automatically use these credentials when connecting to BigQuery.
Publisher uses configuration files on the local filesystem to manage server settings and project-specific details like database connections.
Server Configuration (publisher.config.json):
SERVER_ROOT directory (the directory from which the publisher-server command is run or where the server package is located).packages/server/publisher.config.json for the basic structure.Project Configuration (publisher.connections.json):
malloy-samples/publisher.connections.json for an example.Environment Management:
This two-tiered configuration structure (server-level listing projects, project-level defining connections) allows for standard environment separation (e.g., dev, staging, prod), a common practice in cloud development.
You can create separate project directories for each environment. Each project directory would contain its own publisher.connections.json with the appropriate credentials for that environment.
Crucially, these environment-specific project directories can reference the same underlying Malloy packages (containing the models and notebooks) using symbolic links.
Example File Structure:
SERVER_ROOT/ ├── publisher.config.json # Lists 'staging' and 'prod' projects │ ├── packages/ # Contains the actual Malloy packages │ ├── package1/ │ │ └── model.malloy │ ├── package2/ │ └── ... │ ├── staging/ # Staging environment project │ ├── publisher.connections.json # Staging DB credentials │ ├── package1 -> ../packages/package1 # Symbolic link │ └── package2 -> ../packages/package2 # Symbolic link │ └── prod/ # Production environment project ├── publisher.connections.json # Production DB credentials ├── package1 -> ../packages/package1 # Symbolic link └── package2 -> ../packages/package2 # Symbolic link
Benefit: This allows you to build a single Docker image containing the Publisher server and all Malloy packages. You can then deploy this same image to different environments (staging, production). By configuring your staging and productio jobs to point to the appropriate project (staging or prod), you ensure the correct connection credentials are used for each environment without rebuilding the image or modifying the core package code.
To update to a new NPM release of @malloydata/*:
bun run upgrade-malloy 0.0.XXX #XXX is the new version number bun install # This updates node_modules
NOTE: Note that the Publisher repository currently points to a fork of the malloy-samples repo. The fork contains minor changes to turn each Malloy sample directory into a package. Once the package format solidifies, we intend to merge the changes into the main malloy-samples repo.
We are actively developing Publisher and plan to introduce several exciting features:
.malloy or .malloynb files automatically trigger recompilation of models and hot-reloading of the Publisher App/SDK, enabling faster iteration and testing.探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
在 Linux 系统配置镜像服务
在 Docker Desktop 配置镜像
Docker Compose 项目配置
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
MacOS OrbStack 容器配置
在宝塔面板一键配置镜像
Synology 群晖 NAS 配置
飞牛 fnOS 系统配置镜像
极空间 NAS 系统配置服务
爱快 iKuai 路由系统配置
绿联 NAS 系统配置镜像
QNAP 威联通 NAS 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
来自真实用户的反馈,见证轩辕镜像的优质服务