Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mdcms.ai/llms.txt

Use this file to discover all available pages before exploring further.

MDCMS is an open-source, headless CMS for teams managing structured Markdown and MDX content. Unlike file-based CMS tools that commit content directly to git, MDCMS treats a PostgreSQL database as the source of truth. Content files are synced between the database and your local filesystem via CLI commands (mdcms push / mdcms pull), keeping your repository clean and your content workflow independent of your deployment pipeline.

Why MDCMS

Schema-First

Content types defined in TypeScript with Zod. The schema drives form generation, validation, and API behavior automatically.

Visual Studio

Embeddable React component with a TipTap-based MDX editor, frontmatter editing, and full version history.

CLI-Powered Sync

mdcms push and mdcms pull sync between your local filesystem and the CMS. Designed for CI/CD pipelines.

Multi-Environment

Isolated content per environment with schema overlays. Clone and promote content between environments.

Localization

Built-in i18n with translation groups and per-type localization control.

Extensible

Module system for custom server actions, CLI commands, and Studio UI extensions.

Get Started

I want to use MDCMS

Install the packages, define your schema, and start managing content in your project.

I want to self-host MDCMS

Stand up your own MDCMS server with Docker Compose — database, storage, and API in one command.

I want to integrate the API

Explore the REST API, authentication, and the TypeScript SDK for querying content.

I want to contribute

Clone the monorepo, run the dev environment, and start contributing to MDCMS.

Quick Start

Install the CLI and SDK in your project:
npm install @mdcms/cli @mdcms/sdk
Define your content types in mdcms.config.ts at the root of your project:
mdcms.config.ts
import { defineConfig, defineType, reference } from "@mdcms/cli";
import { z } from "zod";

const Author = defineType("Author", {
  directory: "content/authors",
  fields: {
    name: z.string().min(1),
  },
});

const BlogPost = defineType("BlogPost", {
  directory: "content/blog",
  localized: true,
  fields: {
    title: z.string().min(1).max(200),
    slug: z.string().regex(/^[a-z0-9-]+$/),
    author: reference("Author"),
    publishedAt: z.coerce.date(),
    tags: z.array(z.string()).default([]),
  },
});

export default defineConfig({
  project: "marketing-site",
  serverUrl: "http://localhost:4000",
  contentDirectories: ["content"],
  types: [Author, BlogPost],
});
Then sync your schema and start editing:
# Sync schema to the server
mdcms schema sync

# Pull existing content to your filesystem
mdcms pull

# Push local content changes to the server
mdcms push