CC
2.9K stars 399 forks Quality 70 Trend 28NOASSERTION

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server.

Overview

Carbon combines ERP, MRP, MES and QMS. Plan materials, run the shop floor, manage quality and track actual costs in one system. Start 30-day trial · Self-host · Docs · API · MCP · Discord · Roadmap One record from quote to cash. Link quotes, orders, jobs and invoices. Generate configurations from rules. Control BOMs, routings and revisions. Trace every unit to its source. Follow lot and serial genealogy in both directions. Manufacturing teams often run planning, production, quality and accounting in separate systems. That creates predictable problems: - BOMs and revisions are re-keyed between engineering and production - Material shortages surface after work has started - Job costs and quality records are reconstructed after the fact - Integrations depend on vendor-specific tools and consultants Carbon puts ERP, MRP, MES and QMS in . Engineering, planning, production, quality and accounting update the same data, without synchronization jobs between separate product databases.

README

Contents

Why Carbon

Manufacturing teams often run planning, production, quality and accounting in separate systems. That creates predictable problems:

  • BOMs and revisions are re-keyed between engineering and production
  • Material shortages surface after work has started
  • Job costs and quality records are reconstructed after the fact
  • Integrations depend on vendor-specific tools and consultants

Carbon puts ERP, MRP, MES and QMS in one Postgres database you can inspect, own and extend. Engineering, planning, production, quality and accounting update the same data, without synchronization jobs between separate product databases.

Carbon is an open-source alternative to NetSuite, Epicor, SAP Business One, Plex, Odoo and ERPNext. It supports complex assembly, contract manufacturing, configure-to-order and high-mix, low-volume production. See all comparisons.

Features

ERP — Inventory & Costing Quotes, orders, purchasing, inventory, invoicing and actual job costs
MRP — Planning Demand, supply planning, versioned BOMs and routings, finite-capacity scheduling
MES — Execution Digital travelers, operator terminals, 3D instructions, barcode and labor capture
QMS — Quality Inspections, FAI, nonconformance, CAPA, calibration and risk management
Traceability Forward and backward lot and serial genealogy
Engineering Multi-level BOMs, revisions, change orders, supersession and product configuration
Accounting General ledger, journals, multi-entity, multi-currency and accounting integrations
Workflows Rule-based automation with triggers, actions and run history
Maintenance & Assets Scheduled maintenance, fixed assets and kanban replenishment
API, Webhooks & MCP Typed REST operations, event-driven webhooks and a permission-aware MCP server
Custom Fields Extend records without changing the core schema
Integrations Onshape, SolidWorks, Paperless Parts, Linear, Jira, Slack, Ramp, Stripe and Zebra

See the full roadmap for what’s next.

Technical highlights

  • Generated types shared by the database, application and API
  • Postgres row-level security and tenant-scoped records
  • Role- and attribute-based access for employees, customers and suppliers
  • Realtime database subscriptions
  • Shared identity and permissions across the application, API and MCP server
  • Explicit dependency graphs for manufacturing operations
  • Rust geometry services for STEP conversion and assembly motion planning

Get Carbon

Carbon Cloud Managed application, database, updates and backups. Start a 30-day trial without a sales call.
Self-hosted Run Carbon in your VPC, on-prem or air-gapped. See the self-hosting guide.
Develop locally Run the application and supporting services from source. Follow Local Development.

API & MCP

The Carbon API exposes the same manufacturing operations used by the application. Each operation validates its input, updates dependent records and enforces the authenticated identity’s permissions. Operations are available through two interfaces with the same arguments:

  • HTTP: POST https://app.carbon.ms/api/v1/{module}/{operation}, with a published OpenAPI spec for generating a typed client in any language
  • MCP: as tools for hosted or local AI agents, scoped to the permissions of the API key or signed-in user

Create a key under Settings → API Keys, then:

curl -X POST https://app.carbon.ms/api/v1/sales/getSalesOrders \
  -H "Authorization: Bearer $CARBON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "args": { "limit": 10 } }'

Self-hosted deployments serve the same API at /api/v1. The Data API provides direct access to permitted tables and views when an operation is not available in the service layer.

API keys and MCP are included with Business and Enterprise plans. Using them in a self-hosted deployment requires a commercial license.

Architecture

ERP and MES are React Router apps over a single Postgres database. Permissions (row-level security), computed totals and change events live in the database itself; background work runs through Inngest, which calls back into the ERP to execute jobs. The architecture guide follows one click all the way down.

Building E2E Systems

Carbon is intended to be the core of a bespoke end-to-end manufacturing system. We provide an apps/starter and allow you to build a custom sales and shop-floor engine with Carbon at the center.

Tech Stack

Layer Technology
Apps React Router 7 on Vite, TypeScript
UI Tailwind 4, Radix, React Aria, TanStack Table and Query
Forms Zod with @carbon/form
Database Postgres with row-level security, PostgREST and Kysely
API oRPC with OpenAPI, MCP server
AI AI SDK (Anthropic, OpenAI)
Jobs & events Inngest
Cache Redis
3D & CAD three.js / react-three-fiber; Rust with OpenCASCADE and FCL
Documents React PDF, React Email, TipTap
i18n Lingui
Tooling pnpm, Turborepo, Biome, Vitest
Docs Next.js + Fumadocs
Hosting AWS via SST, or self-hosted with Docker

Monorepo

A pnpm + Turborepo monorepo:

carbon
├── apps         # ERP, MES and the Rust assembler
├── packages     # shared TypeScript packages
├── crates       # Rust crates behind the assembler (CAD conversion, collision, motion planning)
└── docs         # docs.carbon.ms, with content and glossary as @carbon/content

/apps

App Description
erp ERP: sales, purchasing, inventory, planning, quality, accounting
mes MES: the shop floor app, run on tablets next to the machines
assembler Rust geometry service: STEP → GLB and assembly motion planning
academy Training
starter Example app built on the API

/packages

Package Description
@carbon/database Schema, migrations, generated types and database clients
@carbon/auth Authentication, RBAC, sessions, API keys and OAuth
@carbon/api API contract: the generated operation manifest behind the Carbon API and MCP
@carbon/react Shared UI components (Radix, React Aria, Tailwind)
@carbon/form ValidatedForm and field components for zod + FormData
@carbon/jobs Inngest background jobs: events, integrations, notifications, workflows
@carbon/planning MRP and scheduling engines
@carbon/documents PDFs, email templates, ZPL labels, QR and barcodes
@carbon/printing Printer routing, label queue and ProxyBox delivery
@carbon/viewer 3D models and animated assembly instructions (react-three-fiber)
@carbon/files File handling: images, HEIC, CAD formats
@carbon/tiptap Rich-text editor extensions and components
@carbon/onboarding Implementation Hub: guided company setup
@carbon/notifications Notification event taxonomy shared by apps and jobs
@carbon/workflows-core Community-licensed contracts for workflow triggers
@carbon/locale Lingui i18n runtime for ERP and MES
@carbon/lib Server utilities: event system, Inngest client, SMTP, Slack
@carbon/kv Redis client and rate limiting
@carbon/env Validated environment variables, secrets kept server-side
@carbon/logger Isomorphic logger built on LogTape
@carbon/utils Pure shared utilities (dates, precision, BOM, formatting)
@carbon/stripe Stripe billing (Carbon Cloud only)
@carbon/ee Enterprise features and integrations (commercial license)
@carbon/checks Conformance checks that keep the codebase consistent
@carbon/dev The crbn dev CLI: worktrees, Docker stacks, dev URLs
@carbon/harness Harness for AI coding agents working on this repo
@carbon/config Shared Vitest, TypeScript and Tailwind configuration

Local Development

Prerequisites: Docker, Node.js 24.22.1+ (see .nvmrc) and pnpm (via Corepack). On Windows, use WSL or Git Bash.

git clone https://github.com/crbnos/carbon.git && cd carbon
corepack enable && pnpm install
cp .env.example .env
pnpm dev

pnpm dev boots the whole backend in Docker (Postgres, PostgREST, auth, storage, realtime, Inngest, Redis and a mail catcher), applies migrations, generates types and starts the apps:

Sign in as [email protected]: the dev stack seeds that user and skips the magic link. To fill a company with a full demo story (items, BOMs, orders, jobs, inspections, journals), seed one of the industry datasets (satellite, robotics, precision, motor):

pnpm db:seed:dev -- --email [email protected] --dataset satellite

No external accounts are needed to run locally. Email, Google/Microsoft sign-in, Stripe, PostHog and AI providers are all optional and configured in .env; see environment variables.

Claude Code cloud sessions and other agents

Set SESSION_SECRET in the cloud environment’s secret settings before booting the stack (generate a value with openssl rand -hex 32).

scripts/cloud-dev.sh boots the stack in a Claude Code cloud container: run it from the repo root, or from a SessionStart hook in your own Claude Code settings. It selects Node 24, starts crbn up --no-portless in the background and points agent-browser at the preinstalled Chrome. The ERP answers on http://localhost:3000 a few minutes later. Its dev server listens about 40 s in, and from then on a request waits for the database instead of failing. Run by hand rather than from a hook, the script prints a file to source for the session’s PATH and settings.

To take the image pull (about 50 s on a fresh container) out of that wait, put this in the environment’s Setup script (cloud environment menu, Edit). It installs dependencies, starts Docker and pulls the images the default stack boots, then stops; the environment keeps the result for new sessions, and the guard makes it harmless on a branch without the script:

cd carbon && [ -f scripts/cloud-dev.sh ] && bash scripts/cloud-dev.sh --prepare || true

Add --database to also keep a migrated and seeded database and Vite’s dependency cache. It boots the whole stack once, through the login page and the app shell, which takes about 75 s with the images present, then stops everything with the Docker volumes and apps/erp/node_modules/.vite kept. A new session applies only the migrations its branch added, skips the RLS sync and the seed (about 30 s), and skips Vite’s dependency pre-bundling (about 15 s). The default shared stack keeps a separate database for this checkout in the shared Postgres container; crbn down preserves that database and the shared services:

cd carbon && [ -f scripts/cloud-dev.sh ] && bash scripts/cloud-dev.sh --prepare --database || true

Seconds from boot start to the login page being served on a 4-core container, with the Docker daemon down and a cold page cache (as after a restore):

Kept by the environment Login page App shell
Nothing (a fresh container) 152 168
The images 74 88
The images and the database 44 58
The images, the database and Vite’s cache 29 41

The script sets CARBON_DEV_CLOUD=1, and only that switch turns on the container-only boot steps, so these cloud-specific behaviors do not apply to a developer’s own pnpm dev:

  • crbn up starts dockerd itself when it is installed but not running (root on Linux).
  • The ERP dev server starts before the database is migrated and holds requests until it is, and Vite warms up the login page and app shell at start.
  • The boot passes --no-regen: a fresh volume applies every migration, so the type and swagger regeneration would run in every new container (about 30 s) to rewrite committed generated files. The Database types workflow verifies that committed database types match the migrations.
  • BOT_PROTECTION=none, so [email protected] can sign in from a script or a browser automation without the Cloudflare Turnstile widget.
  • A browser for checking the UI: Chrome is in the container (/usr/bin/google-chrome, which adds --no-sandbox for root) and the script installs agent-browser, the CLI the /auth, /test and /smoke-test skills drive it with (pinned by AGENT_BROWSER_VERSION; about 4 s, in the background at boot, or in --prepare), and sets AGENT_BROWSER_EXECUTABLE_PATH. From a cold browser, opening the login page, signing in as the bypass user and reaching the dashboard takes about 15 s; the next page about 8 s the first time.

Worktrees and the crbn CLI

pnpm dev is shorthand for crbn up --no-portless. Run source ./setup.sh once to put crbn on your PATH and you get a separate, isolated stack per git worktree, so several branches can run side by side, each on its own HTTPS .dev URLs via portless:

crbn checkout -b feat/my-thing   # new branch + worktree off HEAD
crbn up                          # boot this worktree's stack at erp..dev
crbn checkout 760                # check out PR #760 into its own worktree
crbn status | down | reset       # ports and health, stop, wipe and reboot

The full command reference is in the local development guide.

Commands

Command Description
pnpm dev Boot the stack and apps on localhost
pnpm db:migrate:new Create a database migration
pnpm db:migrate Apply pending migrations
pnpm generate:types Regenerate database types after a migration
pnpm db:seed:dev -- --dataset Seed a demo company
pnpm lint / pnpm test Biome lint / unit tests
pnpm exec turbo run typecheck --filter= Typecheck one package
pnpm --filter Run a command in one workspace

This project uses Biome for formatting and linting; install the VS Code extension for format-on-save.

Security

Found a vulnerability? Please email [email protected] instead of opening a public issue. We respond within 3 business days and credit reporters once a fix ships. The full policy is in SECURITY.md.

Security is enforced by the database, not left to application code:

  • Tenant isolation in Postgres. Every table is scoped to a company and guarded by row-level security, so a query can only see its own company’s rows.
  • Granular permissions. Role-based access per module and action for employees, customers and suppliers, applied the same way in the app, the API and MCP.
  • Scoped API keys. Keys carry explicit permissions, are stored only as hashes and are rate limited per key.
  • Sign-in. Passkeys, SSO, and enforced two-factor authentication on the Business plan.
  • Audit log. A record of who changed what and when, on the Business plan.
  • Your perimeter. Deploy in your VPC, on-prem or air-gapped to keep CUI inside infrastructure you control while supporting ITAR and CMMC requirements.

Contributing

We welcome contributions of all sizes. Read CONTRIBUTING.md to get started, and say hi in Discord. Good first issues are labelled good first issue.

Star history

License

Carbon is open core. Everything in this repository is licensed under AGPLv3, except the Enterprise files (packages/ee and any file whose name contains .ee.), which are under the Carbon Commercial License. See Licensing for what that means in practice.

View the full README on GitHub

Install

This server does not publish a one-line install command.

Open the repository installation guide New to MCP? Start with the mcpskill.org guide →