Skip to content

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. Self-host or use Carbon Cloud.

Add MCP docs to Carbon

Gaurav Bhatt70bb5e729aa3
diff --git a/.gitignore b/.gitignore
index 0dd484b7e9..7983d3990b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -63,4 +63,4 @@ packages/database/supabase/seed.sql
docs/superpowers
llm/tasks
apps/*/portless.json
-packages/database/supabase/snippets/**
\ No newline at end of file
+packages/database/supabase/snippets/**.superpowers/
diff --git a/apps/erp/app/routes/mcp+/_index.tsx b/apps/erp/app/routes/mcp+/_index.tsx
new file mode 100644
index 0000000000..eaac7620f6
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/_index.tsx
@@ -0,0 +1,33 @@
+import type { LoaderFunctionArgs, MetaFunction } from "react-router";
+import { useLoaderData } from "react-router";
+import McpStyle from "~/styles/mcp.css?url";
+import { MCP_BLOCKED_TOOL_NAMES } from "../api+/mcp+/lib/mcp-blocked-tools";
+import toolMetadata from "../api+/mcp+/lib/tool-metadata.json";
+import { buildMcpCatalog, type RawToolMeta } from "./catalog.server";
+import { McpPage } from "./components/McpPage";
+
+export const meta: MetaFunction = () => [
+ { title: "Carbon MCP server — Developer docs" },
+ {
+ name: "description",
+ content: "Connect any MCP-compatible AI assistant to Carbon."
+ }
+];
+
+export function links() {
+ return [{ rel: "stylesheet", href: McpStyle }];
+}
+
+// PUBLIC: deliberately no requireAuthSession / requirePermissions here.
+export async function loader(_args: LoaderFunctionArgs) {
+ const catalog = buildMcpCatalog(
+ toolMetadata as RawToolMeta,
+ MCP_BLOCKED_TOOL_NAMES
+ );
+ return { catalog };
+}
+
+export default function McpRoute() {
+ const { catalog } = useLoaderData<typeof loader>();
+ return <McpPage catalog={catalog} />;
+}
diff --git a/apps/erp/app/routes/mcp+/catalog.server.ts b/apps/erp/app/routes/mcp+/catalog.server.ts
new file mode 100644
index 0000000000..db79c114de
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/catalog.server.ts
@@ -0,0 +1,90 @@
+export type Classification = "READ" | "WRITE" | "DESTRUCTIVE";
+
+export interface CatalogTool {
+ name: string;
+ module: string;
+ classification: Classification;
+ description: string;
+ paramCount: number;
+}
+
+export interface CatalogModule {
+ key: string;
+ label: string;
+ description: string;
+ count: number;
+}
+
+export interface McpCatalog {
+ total: number;
+ moduleCount: number;
+ modules: CatalogModule[];
+ tools: CatalogTool[];
+}
+
+const MODULE_META: Record<string, { label: string; description: string }> = {
+ sales: { label: "Sales", description: "Quotes, orders, customers" },
+ items: {
+ label: "Items",
+ description: "SKUs, inventory items, configurations"
+ },
+ production: {
+ label: "Production",
+ description: "Jobs, operations, scheduling"
+ },
+ purchasing: { label: "Purchasing", description: "POs, suppliers, receipts" },
+ resources: { label: "Resources", description: "Machines, tools, labor" },
+ settings: { label: "Settings", description: "Company config, tax, terms" },
+ quality: { label: "Quality", description: "Inspections, testing, standards" },
+ accounting: { label: "Accounting", description: "GL, journals, periods" },
+ inventory: {
+ label: "Inventory",
+ description: "On-hand, movements, transfers"
+ },
+ people: { label: "People", description: "Employees, shifts, attendance" },
+ shared: { label: "Shared", description: "Common cross-module operations" },
+ invoicing: { label: "Invoicing", description: "Invoices, AR, payments" },
+ users: { label: "Users", description: "User & permission management" },
+ documents: { label: "Documents", description: "PDFs, attachments" },
+ account: { label: "Account", description: "Profile & attributes" }
+};
+
+export interface RawToolMeta {
+ tools: Array<{
+ name: string;
+ module: string;
+ classification: string;
+ description: string;
+ paramCount: number;
+ }>;
+}
+
+export function buildMcpCatalog(
+ meta: RawToolMeta,
+ blocked: readonly string[]
+): McpCatalog {
+ const blockedSet = new Set(blocked);
+ const tools: CatalogTool[] = meta.tools
+ .filter((t) => !blockedSet.has(t.name))
+ .map((t) => ({
+ name: t.name,
+ module: t.module,
+ classification: t.classification as Classification,
+ description: t.description,
+ paramCount: t.paramCount
+ }));
+
+ const counts = new Map<string, number>();
+ for (const t of tools) counts.set(t.module, (counts.get(t.module) ?? 0) + 1);
+
+ const modules: CatalogModule[] = [...counts.entries()]
+ .map(([key, count]) => ({
+ key,
+ label: MODULE_META[key]?.label ?? key,
+ description: MODULE_META[key]?.description ?? "",
+ count
+ }))
+ .sort((a, b) => b.count - a.count);
+
+ return { total: tools.length, moduleCount: modules.length, modules, tools };
+}
diff --git a/apps/erp/app/routes/mcp+/components/Authentication.tsx b/apps/erp/app/routes/mcp+/components/Authentication.tsx
new file mode 100644
index 0000000000..77bdba047c
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/Authentication.tsx
@@ -0,0 +1,36 @@
+import { SpecList, SpecRow } from "./SpecRow";
+
+export function Authentication() {
+ return (
+ <>
+ <p className="text-muted-foreground max-w-[64ch] mb-6 text-[0.95rem] [text-wrap:pretty]">
+ Connect with OAuth — no secrets to copy. Carbon's MCP server speaks
+ OAuth 2.1, so your client registers itself and you authorize in the
+ browser. A scoped API key is there if you'd rather (CI, headless).
+ </p>
+ <SpecList>
+ <SpecRow label="OAuth 2.1">
+ PKCE + dynamic client registration. Your client self-registers; you
+ sign in, pick your company, and click Authorize — nothing to copy or
+ paste.
+ </SpecRow>
+ <SpecRow label="Permissions">
+ The connection inherits exactly your Carbon access (scope{" "}
+ <span className="font-[var(--mono)]">mcp:tools</span>). Cross-company
+ access is impossible.
+ </SpecRow>
+ <SpecRow label="API keys">
+ Prefer a key for CI or headless use? Create a scoped key in Settings →
+ API Keys and send it as{" "}
+ <span className="font-[var(--mono)]">
+ Authorization: Bearer crbn_…
+ </span>
+ .
+ </SpecRow>
+ </SpecList>
+ <p className="text-muted-foreground text-[0.9rem] mt-3 max-w-[64ch] [text-wrap:pretty]">
+ Access tokens last an hour and refresh automatically.
+ </p>
+ </>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/CopyButton.tsx b/apps/erp/app/routes/mcp+/components/CopyButton.tsx
new file mode 100644
index 0000000000..644f3b3300
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/CopyButton.tsx
@@ -0,0 +1,29 @@
+import { cn } from "@carbon/react";
+import { useState } from "react";
+import { LuCheck, LuCopy } from "react-icons/lu";
+
+export function CopyButton({
+ text,
+ className,
+ label = "Copy"
+}: {
+ text: string;
+ className?: string;
+ label?: string;
+}) {
+ const [done, setDone] = useState(false);
+ return (
+ <button
+ type="button"
+ aria-label={label}
+ className={cn(className, done && "done")}
+ onClick={() => {
+ navigator.clipboard?.writeText(text);
+ setDone(true);
+ setTimeout(() => setDone(false), 1400);
+ }}
+ >
+ {done ? <LuCheck size={14} /> : <LuCopy size={14} />}
+ </button>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/Cta.tsx b/apps/erp/app/routes/mcp+/components/Cta.tsx
new file mode 100644
index 0000000000..252ff7b503
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/Cta.tsx
@@ -0,0 +1,38 @@
+import { useInViewClass } from "../hooks/useInViewClass";
+import { McpButton } from "./McpButton";
+import { goToQuickstart } from "./quickstart-nav";
+
+export function Cta() {
+ const ref = useInViewClass<HTMLElement>();
+ return (
+ <section ref={ref} className="reveal relative py-[54px] scroll-mt-20">
+ <div className="bg-muted bg-[url(/cta.webp)] bg-cover bg-center border border-border rounded-[14px] px-[24px] py-[50px] text-center">
+ <h2 className="font-semibold tracking-[-0.035em] leading-[1.05] m-0 mb-[8px] text-foreground [text-wrap:balance] text-[clamp(1.8rem,2.8vw,2.4rem)]">
+ Build something with Carbon
+ </h2>
+ <p className="text-muted-foreground m-0 mb-[20px]">
+ Bring your manufacturing system into every AI assistant.
+ </p>
+ <div className="flex gap-[10px] flex-wrap justify-center">
+ <McpButton
+ variant="accent"
+ href="#quickstart"
+ onClick={(e) => {
+ e.preventDefault();
+ goToQuickstart("Claude Code");
+ }}
+ >
+ Connect to Claude
+ </McpButton>
+ <McpButton
+ href="https://www.carbon.ms/sales"
+ target="_blank"
+ rel="noopener"
+ >
+ Talk to sales
+ </McpButton>
+ </div>
+ </div>
+ </section>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/Faq.tsx b/apps/erp/app/routes/mcp+/components/Faq.tsx
new file mode 100644
index 0000000000..2764e9987c
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/Faq.tsx
@@ -0,0 +1,45 @@
+import { cn } from "@carbon/react";
+import { useState } from "react";
+import { FAQ } from "./mcp-content";
+
+function FaqItem({ q, a }: { q: string; a: string }) {
+ const [open, setOpen] = useState(false);
+ return (
+ <div className="bg-card border border-border rounded-[10px] px-[15px] py-[13px] mb-[8px] cursor-pointer transition-[border-color] duration-200 hover:border-[var(--acc)]">
+ <button
+ type="button"
+ className="w-full bg-transparent border-none cursor-pointer font-[inherit] text-foreground text-left flex justify-between items-center font-semibold text-[0.9rem]"
+ aria-expanded={open}
+ onClick={() => setOpen((o) => !o)}
+ >
+ {q}{" "}
+ <span
+ className={cn(
+ "text-[var(--acc)] transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
+ open && "rotate-45"
+ )}
+ >
+ +
+ </span>
+ </button>
+ <div
+ className={cn(
+ "text-muted-foreground text-[0.84rem] overflow-hidden transition-[max-height,margin] duration-300 ease-in-out",
+ open ? "max-h-[150px] mt-[9px]" : "max-h-0"
+ )}
+ >
+ {a}
+ </div>
+ </div>
+ );
+}
+
+export function Faq() {
+ return (
+ <div className="flex flex-col">
+ {FAQ.map((f) => (
+ <FaqItem key={f.q} q={f.q} a={f.a} />
+ ))}
+ </div>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/FilterSelect.tsx b/apps/erp/app/routes/mcp+/components/FilterSelect.tsx
new file mode 100644
index 0000000000..b45d072606
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/FilterSelect.tsx
@@ -0,0 +1,131 @@
+import { cn } from "@carbon/react";
+import { useEffect, useRef, useState } from "react";
+import { createPortal } from "react-dom";
+import { LuChevronDown } from "react-icons/lu";
+
+export interface FilterOption {
+ value: string;
+ label: string;
+}
+
+// The menu renders in a portal so it isn't clipped by the ToolBrowser card's
+// `overflow-hidden` (used to round the row corners). Closes on outside-click,
+// scroll, or resize.
+export function FilterSelect({
+ value,
+ options,
+ placeholder,
+ onChange
+}: {
+ value: string;
+ options: FilterOption[];
+ placeholder: string;
+ onChange: (v: string) => void;
+}) {
+ const [open, setOpen] = useState(false);
+ const [rect, setRect] = useState<DOMRect | null>(null);
+ const triggerRef = useRef<HTMLButtonElement>(null);
+ const menuRef = useRef<HTMLDivElement>(null);
+
+ useEffect(() => {
+ if (!open) return;
+ const onDoc = (e: MouseEvent) => {
+ const t = e.target as Node;
+ if (triggerRef.current?.contains(t) || menuRef.current?.contains(t))
+ return;
+ setOpen(false);
+ };
+ const dismiss = () => setOpen(false);
+ document.addEventListener("mousedown", onDoc);
+ window.addEventListener("scroll", dismiss, true);
+ window.addEventListener("resize", dismiss);
+ return () => {
+ document.removeEventListener("mousedown", onDoc);
+ window.removeEventListener("scroll", dismiss, true);
+ window.removeEventListener("resize", dismiss);
+ };
+ }, [open]);
+
+ const toggle = () => {
+ if (!open) setRect(triggerRef.current?.getBoundingClientRect() ?? null);
+ setOpen((o) => !o);
+ };
+ const select = (v: string) => {
+ onChange(v);
+ setOpen(false);
+ };
+ const current = options.find((o) => o.value === value);
+
+ const optionClass = (selected: boolean) =>
+ cn(
+ "block w-full text-left px-[10px] py-[7px] border-none bg-transparent rounded-md text-[0.8rem] text-foreground cursor-pointer font-[inherit] whitespace-nowrap transition-[background,color] duration-[120ms] hover:bg-muted",
+ selected && "text-[var(--acc)] bg-[var(--acc-tint-strong)] font-semibold"
+ );
+
+ return (
+ <>
+ <button
+ ref={triggerRef}
+ type="button"
+ className={cn(
+ "inline-flex items-center gap-2 h-[38px] px-[11px] border bg-card rounded-lg text-[0.8rem] font-semibold text-foreground cursor-pointer whitespace-nowrap transition-[border-color,box-shadow] duration-150",
+ open
+ ? "border-[var(--acc)] shadow-[0_0_0_3px_var(--acc-ring)]"
+ : "border-border hover:border-muted-foreground"
+ )}
+ aria-haspopup="listbox"
+ aria-expanded={open}
+ onClick={toggle}
+ >
+ <span className={cn(!current && "text-muted-foreground font-medium")}>
+ {current ? current.label : placeholder}
+ </span>
+ <LuChevronDown
+ size={14}
+ className={cn(
+ "text-muted-foreground shrink-0 transition-transform duration-200",
+ open && "rotate-180"
+ )}
+ />
+ </button>
+ {open &&
+ rect &&
+ createPortal(
+ <div
+ ref={menuRef}
+ role="listbox"
+ style={{
+ position: "fixed",
+ top: rect.bottom + 6,
+ left: rect.left,
+ minWidth: rect.width
+ }}
+ className="max-h-[280px] overflow-auto bg-card border border-border rounded-[10px] shadow-[0_1px_2px_rgba(0,0,0,0.05),0_14px_30px_-12px_rgba(0,0,0,0.22)] p-[5px] z-[1000] flex flex-col gap-px"
+ >
+ <button
+ type="button"
+ role="option"
+ aria-selected={!value}
+ className={optionClass(!value)}
+ onClick={() => select("")}
+ >
+ {placeholder}
+ </button>
+ {options.map((o) => (
+ <button
+ type="button"
+ key={o.value}
+ role="option"
+ aria-selected={o.value === value}
+ className={optionClass(o.value === value)}
+ onClick={() => select(o.value)}
+ >
+ {o.label}
+ </button>
+ ))}
+ </div>,
+ document.body
+ )}
+ </>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/FlowDiagram.tsx b/apps/erp/app/routes/mcp+/components/FlowDiagram.tsx
new file mode 100644
index 0000000000..ccf41bacb5
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/FlowDiagram.tsx
@@ -0,0 +1,92 @@
+import { Fragment } from "react";
+import type { Classification } from "../catalog.server";
+import { Tag } from "./Tag";
+
+export interface FlowStep {
+ name: string;
+ text: string;
+ tag?: Classification;
+ num?: string;
+}
+
+export function FlowDiagram({
+ label,
+ caption,
+ steps,
+ vertical = false
+}: {
+ label: string;
+ caption: string;
+ steps: FlowStep[];
+ vertical?: boolean;
+}) {
+ if (vertical) {
+ return (
+ <div className="bg-card border border-border rounded-[12px] p-[18px]">
+ <div className="text-[var(--acc)] font-[var(--mono)] text-[0.68rem] tracking-[0.14em] font-medium">
+ {label}
+ </div>
+ <div className="text-muted-foreground text-[0.85rem] mt-1 mb-[15px]">
+ {caption}
+ </div>
+ <div className="flex flex-col stagger">
+ {steps.map((s, i) => (
+ <div
+ className="grid gap-[14px] py-3 [grid-template-columns:30px_1fr] [&:not(:last-child)]:border-b [&:not(:last-child)]:border-border"
+ key={`${s.name}-${i}`}
+ >
+ <span className="text-[var(--acc)] font-[var(--mono)] text-[0.7rem]">
+ {s.num ?? String(i + 1).padStart(2, "0")}
+ </span>
+ <div>
+ <span className="font-[var(--mono)] font-medium text-foreground text-[0.85rem] flex items-center gap-2 flex-wrap">
+ {s.name}
+ {s.tag && <Tag kind={s.tag} />}
+ </span>
+ <p className="mt-[5px] text-[0.82rem] text-muted-foreground m-0">
+ {s.text}
+ </p>
+ </div>
+ </div>
+ ))}
+ </div>
+ </div>
+ );
+ }
+ return (
+ <div className="bg-card border border-border rounded-[12px] p-[18px]">
+ <div className="text-[var(--acc)] font-[var(--mono)] text-[0.68rem] tracking-[0.14em] font-medium">
+ {label}
+ </div>
+ <div className="text-muted-foreground text-[0.85rem] mt-1 mb-[15px]">
+ {caption}
+ </div>
+ <div className="flex items-stretch flex-wrap stagger">
+ {steps.map((s, i) => (
+ <Fragment key={`${s.name}-${i}`}>
+ {i > 0 && (
+ <div className="flex items-center text-[var(--acc)] px-[10px] text-[17px]">
+ →
+ </div>
+ )}
+ <div className="flex-1 min-w-[172px] bg-muted border border-border rounded-[10px] p-[13px]">
+ {s.tag ? (
+ <Tag kind={s.tag} />
+ ) : (
+ <span className="font-[var(--mono)] text-[0.68rem] text-muted-foreground">
+ {s.num ?? String(i + 1).padStart(2, "0")}
+ </span>
+ )}
+ <div className="font-[var(--mono)] font-medium text-foreground mt-[3px] text-[0.85rem]">
+ {s.name}
+ </div>
+ <p className="mt-[7px] text-[0.8rem] text-muted-foreground m-0">
+ {s.text}
+ </p>
+ </div>
+ </Fragment>
+ ))}
+ </div>
+ </div>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/Footer.tsx b/apps/erp/app/routes/mcp+/components/Footer.tsx
new file mode 100644
index 0000000000..abbc090a4b
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/Footer.tsx
@@ -0,0 +1,10 @@
+export function Footer() {
+ return (
+ <footer className="border-t border-border mt-10 py-[26px]">
+ <div className="container flex justify-between font-[var(--mono)] text-[0.7rem] tracking-[0.1em] uppercase text-muted-foreground">
+ <span>Carbon Manufacturing Systems</span>
+ <span>Developer Docs — MCP</span>
+ </div>
+ </footer>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/ImagePlaceholder.tsx b/apps/erp/app/routes/mcp+/components/ImagePlaceholder.tsx
new file mode 100644
index 0000000000..73da675024
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/ImagePlaceholder.tsx
@@ -0,0 +1,38 @@
+import { useState } from "react";
+
+export function ImagePlaceholder({
+ src,
+ alt,
+ ratio = "16 / 9"
+}: {
+ src?: string;
+ alt: string;
+ ratio?: string;
+}) {
+ const [failed, setFailed] = useState(false);
+
+ // Show the real screenshot once it exists; fall back to the labelled
+ // placeholder while a src is missing or 404s (so it's never a broken image).
+ if (src && !failed) {
+ return (
+ <img
+ className="w-full rounded-[9px] block outline outline-1 outline-black/10 -outline-offset-1"
+ src={src}
+ alt={alt}
+ onError={() => setFailed(true)}
+ />
+ );
+ }
+ return (
+ <div
+ className="w-full rounded-[9px] flex items-center justify-center bg-muted border border-dashed border-border text-muted-foreground"
+ style={{ aspectRatio: ratio }}
+ role="img"
+ aria-label={alt}
+ >
+ <span className="font-[var(--mono)] text-[0.72rem] tracking-[0.04em] px-[14px] py-[10px] text-center">
+ {alt}
+ </span>
+ </div>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/Lede.tsx b/apps/erp/app/routes/mcp+/components/Lede.tsx
new file mode 100644
index 0000000000..507c581074
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/Lede.tsx
@@ -0,0 +1,54 @@
+import { CopyButton } from "./CopyButton";
+import { McpButton } from "./McpButton";
+import { ENDPOINT } from "./mcp-content";
+import { goToQuickstart } from "./quickstart-nav";
+
+export function Lede({ total }: { total: number }) {
+ return (
+ <div className="pb-[10px] mb-12">
+ <h1 className="font-bold tracking-[-0.045em] text-[clamp(2.7rem,5.2vw,4.1rem)] leading-[0.98] m-0 mb-4 [text-wrap:balance]">
+ Carbon MCP server
+ </h1>
+ <p className="text-muted-foreground max-w-[58ch] m-0 mb-[18px] text-[1.0625rem] [text-wrap:pretty]">
+ Connect Claude, ChatGPT, Cursor, or any MCP client to Carbon. It gets{" "}
+ <b>{total.toLocaleString()} tools</b> across 15 modules — sales orders,
+ production jobs, inventory, purchasing, quality — and you drive them in
+ plain language.
+ </p>
+ <div className="inline-flex items-center gap-[11px] bg-card border border-border rounded-[11px] py-[7px] pr-[7px] pl-[13px] mb-4 shadow-[0_1px_2px_rgba(0,0,0,0.04),0_6px_18px_-10px_rgba(0,0,0,0.12)]">
+ <span className="font-[var(--mono)] text-[0.65rem] font-bold text-[var(--acc)] border border-[var(--acc)] py-[3px] px-[7px] rounded-[5px]">
+ POST
+ </span>
+ <span className="font-[var(--mono)] text-[0.875rem] font-variant-numeric-tabular">
+ {ENDPOINT}
+ </span>
+ <CopyButton
+ className="bg-muted border border-border rounded-[6px] w-7 h-7 inline-flex items-center justify-center p-0 cursor-pointer transition-[transform,background] duration-[150ms] [transition-timing-function:cubic-bezier(0.2,0,0,1)] hover:bg-card active:scale-[0.96]"
+ text={ENDPOINT}
+ label="Copy endpoint"
+ />
+ </div>
+ <div className="flex gap-[10px] flex-wrap">
+ <McpButton
+ variant="accent"
+ href="#quickstart"
+ onClick={(e) => {
+ e.preventDefault();
+ goToQuickstart();
+ }}
+ >
+ Get started
+ </McpButton>
+ <McpButton
+ href="#quickstart"
+ onClick={(e) => {
+ e.preventDefault();
+ goToQuickstart("Claude Code");
+ }}
+ >
+ Connect to Claude
+ </McpButton>
+ </div>
+ </div>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/McpButton.tsx b/apps/erp/app/routes/mcp+/components/McpButton.tsx
new file mode 100644
index 0000000000..67d6cf0df6
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/McpButton.tsx
@@ -0,0 +1,27 @@
+import { cn } from "@carbon/react";
+import { cva, type VariantProps } from "class-variance-authority";
+import type { ComponentProps } from "react";
+
+const button = cva(
+ "inline-flex items-center gap-[7px] rounded-lg font-semibold cursor-pointer transition-[transform,border-color,box-shadow] duration-[160ms] ease-[cubic-bezier(0.2,0,0,1)] shadow-[0_1px_2px_rgba(0,0,0,0.05)] hover:-translate-y-px hover:shadow-[0_5px_14px_-5px_rgba(0,0,0,0.14)] active:scale-[0.96]",
+ {
+ variants: {
+ variant: {
+ secondary: "bg-card text-foreground border border-border",
+ accent: "bg-[var(--acc)] text-white border border-[var(--acc)]",
+ primary: "bg-foreground text-background border border-foreground"
+ },
+ size: { md: "h-10 px-4 text-[0.85rem]", sm: "h-8 px-3 text-[0.8rem]" }
+ },
+ defaultVariants: { variant: "secondary", size: "md" }
+ }
+);
+
+export function McpButton({
+ variant,
+ size,
+ className,
+ ...props
+}: ComponentProps<"a"> & VariantProps<typeof button>) {
+ return <a className={cn(button({ variant, size }), className)} {...props} />;
+}
diff --git a/apps/erp/app/routes/mcp+/components/McpPage.tsx b/apps/erp/app/routes/mcp+/components/McpPage.tsx
new file mode 100644
index 0000000000..14ac44a3f4
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/McpPage.tsx
@@ -0,0 +1,77 @@
+import type { McpCatalog } from "../catalog.server";
+import { Authentication } from "./Authentication";
+import { Cta } from "./Cta";
+import { Faq } from "./Faq";
+import { Footer } from "./Footer";
+import { Lede } from "./Lede";
+import { Nav } from "./Nav";
+import { OnThisPageNav } from "./OnThisPageNav";
+import { Quickstart } from "./Quickstart";
+import { Safety } from "./Safety";
+import { Section } from "./Section";
+import { ToolDiscovery } from "./ToolDiscovery";
+import { Tools } from "./Tools";
+import { WaveScrollRail } from "./WaveScrollRail";
+import { WhatIsMcp } from "./WhatIsMcp";
+import { WhatYouCanAsk } from "./WhatYouCanAsk";
+
+export function McpPage({ catalog }: { catalog: McpCatalog }) {
+ return (
+ <div className="MCP bg-[var(--canvas)] text-foreground antialiased min-h-screen">
+ <Nav />
+ <WaveScrollRail />
+ <div className="container">
+ <div className="grid grid-cols-1 min-[880px]:grid-cols-[200px_minmax(0,720px)] gap-12 pt-[52px] pb-10">
+ <OnThisPageNav />
+ <main>
+ <Lede total={catalog.total} />
+ <Section
+ id="whatis"
+ fig="FIG.01"
+ label="OVERVIEW"
+ title="What is MCP?"
+ >
+ <WhatIsMcp />
+ </Section>
+ <WhatYouCanAsk />
+ <Section
+ id="quickstart"
+ fig="FIG.03"
+ label="QUICKSTART"
+ title="Quickstart"
+ >
+ <Quickstart />
+ </Section>
+ <Section
+ id="discovery"
+ fig="FIG.04"
+ label="ARCHITECTURE"
+ title="How tool discovery works"
+ >
+ <ToolDiscovery total={catalog.total} />
+ </Section>
+ <Section id="tools" fig="FIG.05" label="REFERENCE" title="Tools">
+ <Tools catalog={catalog} />
+ </Section>
+ <Section
+ id="auth"
+ fig="FIG.06"
+ label="SECURITY"
+ title="Authentication"
+ >
+ <Authentication />
+ </Section>
+ <Section id="safety" fig="FIG.07" label="SAFETY" title="Safety">
+ <Safety />
+ </Section>
+ <Section id="faq" fig="FIG.08" label="FAQ" title="FAQ">
+ <Faq />
+ </Section>
+ <Cta />
+ </main>
+ </div>
+ </div>
+ <Footer />
+ </div>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/ModuleCards.tsx b/apps/erp/app/routes/mcp+/components/ModuleCards.tsx
new file mode 100644
index 0000000000..a63e2d7c52
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/ModuleCards.tsx
@@ -0,0 +1,83 @@
+import { cn } from "@carbon/react";
+import type { IconType } from "react-icons";
+import { LuLayoutGrid } from "react-icons/lu";
+import type { CatalogModule } from "../catalog.server";
+import { FALLBACK_MODULE_ICON, MODULE_ICONS } from "./module-icons";
+
+function Card({
+ icon: Icon,
+ label,
+ count,
+ active,
+ onClick
+}: {
+ icon: IconType;
+ label: string;
+ count: number;
+ active: boolean;
+ onClick: () => void;
+}) {
+ return (
+ <button
+ type="button"
+ onClick={onClick}
+ aria-pressed={active}
+ className={cn(
+ "flex items-center gap-[9px] text-left p-[10px] rounded-lg border cursor-pointer transition-[border-color,background,transform] duration-150 active:scale-[0.97]",
+ active
+ ? "border-[var(--acc)] bg-[var(--acc-tint)]"
+ : "border-border bg-card hover:border-muted-foreground"
+ )}
+ >
+ <Icon
+ size={16}
+ className={cn(
+ "shrink-0",
+ active ? "text-[var(--acc)]" : "text-muted-foreground"
+ )}
+ />
+ <span className="min-w-0">
+ <span className="block font-medium text-[0.8rem] text-foreground truncate">
+ {label}
+ </span>
+ <span className="block font-[var(--mono)] text-[0.62rem] text-muted-foreground tabular-nums">
+ {count.toLocaleString()}
+ </span>
+ </span>
+ </button>
+ );
+}
+
+export function ModuleCards({
+ modules,
+ total,
+ value,
+ onChange
+}: {
+ modules: CatalogModule[];
+ total: number;
+ value: string;
+ onChange: (v: string) => void;
+}) {
+ return (
+ <div className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-[8px] mb-[18px]">
+ <Card
+ icon={LuLayoutGrid}
+ label="All modules"
+ count={total}
+ active={value === ""}
+ onClick={() => onChange("")}
+ />
+ {modules.map((m) => (
+ <Card
+ key={m.key}
+ icon={MODULE_ICONS[m.key] ?? FALLBACK_MODULE_ICON}
+ label={m.label}
+ count={m.count}
+ active={value === m.key}
+ onClick={() => onChange(value === m.key ? "" : m.key)}
+ />
+ ))}
+ </div>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/Nav.tsx b/apps/erp/app/routes/mcp+/components/Nav.tsx
new file mode 100644
index 0000000000..3fc367a95b
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/Nav.tsx
@@ -0,0 +1,32 @@
+import { McpButton } from "./McpButton";
+import { ThemeToggle } from "./ThemeToggle";
+
+export function Nav() {
+ return (
+ <header className="sticky top-0 z-[999] h-[60px] flex items-center bg-[var(--canvas-blur)] backdrop-blur-[12px] saturate-[160%] border-b border-border">
+ <div className="container flex items-center gap-[26px] w-full">
+ <a
+ className="flex items-center gap-[9px] font-semibold text-base tracking-[-0.02em]"
+ href="/"
+ >
+ <img
+ className="h-[23px] w-auto block dark:hidden"
+ src="/carbon-word-light.svg"
+ alt="Carbon"
+ />
+ <img
+ className="h-[23px] w-auto hidden dark:block"
+ src="/carbon-word-dark.svg"
+ alt="Carbon"
+ />
+ </a>
+ <div className="ml-auto flex items-center gap-[10px]">
+ <ThemeToggle />
+ <McpButton variant="primary" size="sm" href="/x/settings/api-keys">
+ Get an API key
+ </McpButton>
+ </div>
+ </div>
+ </header>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/OnThisPageNav.tsx b/apps/erp/app/routes/mcp+/components/OnThisPageNav.tsx
new file mode 100644
index 0000000000..f2b56eb1ca
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/OnThisPageNav.tsx
@@ -0,0 +1,41 @@
+import { cn } from "@carbon/react";
+import type React from "react";
+import { useScrollSpy } from "../hooks/useScrollSpy";
+import { TOC } from "./mcp-content";
+
+const TOC_IDS = TOC.map((t) => t.id);
+
+export function OnThisPageNav() {
+ const active = useScrollSpy(TOC_IDS);
+ const go = (e: React.MouseEvent<HTMLAnchorElement>, id: string) => {
+ e.preventDefault();
+ const el = document.getElementById(id);
+ if (el) {
+ el.scrollIntoView({ behavior: "smooth", block: "start" });
+ history.replaceState(null, "", `#${id}`);
+ }
+ };
+ return (
+ <aside className="hidden min-[880px]:block sticky top-[84px] self-start text-[0.85rem]">
+ <div className="font-[var(--mono)] text-[0.7rem] uppercase tracking-[0.14em] text-muted-foreground mb-[13px]">
+ On this page
+ </div>
+ <div className="toc-track">
+ {TOC.map((t, i) => (
+ <a
+ key={t.id}
+ href={`#${t.id}`}
+ onClick={(e) => go(e, t.id)}
+ className={cn(
+ "block py-[6px] text-muted-foreground hover:text-foreground transition-colors duration-[150ms]",
+ i === active && "active text-foreground font-semibold",
+ i < active && "passed"
+ )}
+ >
+ {t.label}
+ </a>
+ ))}
+ </div>
+ </aside>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/Quickstart.tsx b/apps/erp/app/routes/mcp+/components/Quickstart.tsx
new file mode 100644
index 0000000000..9a8ab6c583
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/Quickstart.tsx
@@ -0,0 +1,20 @@
+import { SetupPipeline } from "./SetupPipeline";
+
+export function Quickstart() {
+ return (
+ <>
+ <p className="text-muted-foreground max-w-[64ch] mb-[26px] text-[0.95rem] [text-wrap:pretty]">
+ Pick your client, follow the three steps, and you&apos;re talking to
+ your ERP. About a minute.
+ </p>
+ <SetupPipeline />
+ <p className="text-muted-foreground mt-[18px] text-[0.8rem] [text-wrap:pretty]">
+ Connector clients authorize in the browser — nothing to paste. CLI and
+ config clients use a scoped key from Settings → API Keys (
+ <span className="font-[var(--mono)]">Authorization: Bearer crbn_…</span>
+ ). stdio-only clients bridge through the{" "}
+ <span className="font-[var(--mono)]">mcp-remote</span> shim.
+ </p>
+ </>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/Safety.tsx b/apps/erp/app/routes/mcp+/components/Safety.tsx
new file mode 100644
index 0000000000..a043a1785d
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/Safety.tsx
@@ -0,0 +1,28 @@
+import { SpecList, SpecRow } from "./SpecRow";
+import { Tag } from "./Tag";
+
+export function Safety() {
+ return (
+ <>
+ <p className="text-muted-foreground max-w-[64ch] mb-6 text-[0.95rem] [text-wrap:pretty]">
+ Every tool is classified so you always know what's safe and what mutates
+ data.
+ </p>
+ <SpecList>
+ <SpecRow label={<Tag kind="READ" />}>
+ Always safe — no data changes.
+ </SpecRow>
+ <SpecRow label={<Tag kind="WRITE" />}>
+ Creates or updates records.
+ </SpecRow>
+ <SpecRow label={<Tag kind="DESTRUCTIVE" />}>
+ Deletes data — keep human confirmation on.
+ </SpecRow>
+ </SpecList>
+ <p className="text-muted-foreground text-[0.9rem] mt-3 max-w-[64ch] [text-wrap:pretty]">
+ A key only ever sees what its user could see in Carbon. Cross-company
+ access is impossible.
+ </p>
+ </>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/Section.tsx b/apps/erp/app/routes/mcp+/components/Section.tsx
new file mode 100644
index 0000000000..4c03b6595a
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/Section.tsx
@@ -0,0 +1,35 @@
+import type { ReactNode } from "react";
+import { useInViewClass } from "../hooks/useInViewClass";
+
+export function Section({
+ id,
+ fig,
+ label,
+ title,
+ children
+}: {
+ id: string;
+ fig: string;
+ label: string;
+ title?: string;
+ children: ReactNode;
+}) {
+ const ref = useInViewClass<HTMLElement>();
+ return (
+ <section
+ ref={ref}
+ id={id}
+ className="reveal hr-wipe relative py-[54px] scroll-mt-20"
+ >
+ <div className="font-[var(--mono)] text-[0.68rem] tracking-[0.18em] uppercase text-muted-foreground mb-4">
+ <span className="text-[var(--acc)] font-medium">{fig}</span> · {label}
+ </div>
+ {title && (
+ <h2 className="font-semibold tracking-[-0.03em] text-[clamp(1.5rem,2.2vw,1.9rem)] leading-[1.12] mb-[9px] text-balance">
+ {title}
+ </h2>
+ )}
+ {children}
+ </section>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/SetupPipeline.tsx b/apps/erp/app/routes/mcp+/components/SetupPipeline.tsx
new file mode 100644
index 0000000000..287e12bb26
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/SetupPipeline.tsx
@@ -0,0 +1,180 @@
+import { cn } from "@carbon/react";
+import { useEffect, useState } from "react";
+import { LuArrowDown, LuPlug, LuTerminal } from "react-icons/lu";
+import { CopyButton } from "./CopyButton";
+import { ImagePlaceholder } from "./ImagePlaceholder";
+import { CLIENTS, type Client, ENDPOINT } from "./mcp-content";
+import { SELECT_CLIENT_EVENT } from "./quickstart-nav";
+
+const FLOW_META = {
+ connector: { Icon: LuPlug, label: "OAuth · no key" },
+ command: { Icon: LuTerminal, label: "API key" }
+} as const;
+
+interface PipeStep {
+ num: string;
+ crumb: string;
+ title: string;
+ caption: string;
+ alt: string;
+ code?: string;
+ img: string;
+}
+
+// Builds the three-step walkthrough for the selected client. Steps 1 and 3 are
+// shared within a flow; step 2 carries the client-specific command/config.
+function stepsFor(c: Client): PipeStep[] {
+ const verify: PipeStep = {
+ num: "03",
+ crumb: c.name,
+ title: "Verify",
+ caption:
+ "Ask it to search Carbon. If it lists tools, you’re connected to your ERP.",
+ alt: `${c.name} — “Search Carbon for sales-order tools” returning a list of tools`,
+ img: "/mcp/verify.png"
+ };
+
+ if (c.flow === "connector") {
+ return [
+ {
+ num: "01",
+ crumb: c.where,
+ title: "Add a custom connector",
+ caption: `Open ${c.where}, choose Add custom connector, then paste the endpoint.`,
+ code: ENDPOINT,
+ alt: `${c.name} — the “Add custom connector” dialog with the Carbon MCP URL`,
+ img: "/mcp/add-claude-ai"
+ },
+ {
+ num: "02",
+ crumb: "app.carbon.ms/oauth/authorize",
+ title: "Authorize",
+ caption:
+ "Sign in, choose your company, and click Authorize. The connection inherits your Carbon permissions — no key to paste.",
+ alt: "Carbon — the “Authorize Application” screen: choose your company, then Authorize",
+ img: "/mcp/authorize-connector.png"
+ },
+ verify
+ ];
+ }
+
+ return [
+ {
+ num: "01",
+ crumb: "Carbon · Settings → API Keys",
+ title: "Create an API key",
+ caption:
+ "Settings → API Keys → New. The modal hands you a ready-to-paste snippet — you only see the key once.",
+ alt: "Carbon — Settings → API Keys → the new-key modal with the snippet",
+ img: "/mcp/api-key.png"
+ },
+ {
+ num: "02",
+ crumb: c.target,
+ title: c.action,
+ caption: "Paste it in, swapping in the key the modal gave you:",
+ code: c.code,
+ alt: `${c.name} — the Carbon MCP server configured with your key`,
+ img: "/mcp/command.png"
+ },
+ verify
+ ];
+}
+
+export function SetupPipeline() {
+ const [name, setName] = useState("Claude Code");
+ const client = CLIENTS.find((c) => c.name === name) ?? CLIENTS[0];
+ const steps = stepsFor(client);
+
+ // The hero "Connect to Claude" CTA preselects a client via this event.
+ useEffect(() => {
+ const onSelect = (e: Event) => {
+ const wanted = (e as CustomEvent<string>).detail;
+ if (CLIENTS.some((c) => c.name === wanted)) setName(wanted);
+ };
+ window.addEventListener(SELECT_CLIENT_EVENT, onSelect);
+ return () => window.removeEventListener(SELECT_CLIENT_EVENT, onSelect);
+ }, []);
+
+ return (
+ <div>
+ <div className="grid grid-cols-1 sm:grid-cols-3 gap-[10px] mb-[24px]">
+ {CLIENTS.map((c) => {
+ const { Icon, label } = FLOW_META[c.flow];
+ const isActive = c.name === client.name;
+ return (
+ <button
+ key={c.name}
+ type="button"
+ onClick={() => setName(c.name)}
+ aria-pressed={isActive}
+ className={cn(
+ "flex flex-col items-start gap-[6px] text-left p-[13px] rounded-xl border cursor-pointer transition-[border-color,background,transform] duration-150 active:scale-[0.97]",
+ isActive
+ ? "border-[var(--acc)] bg-[var(--acc-tint)] shadow-[0_1px_2px_rgba(0,0,0,0.05)]"
+ : "border-border bg-card hover:border-muted-foreground"
+ )}
+ >
+ <Icon
+ size={17}
+ className={cn(
+ isActive ? "text-[var(--acc)]" : "text-muted-foreground"
+ )}
+ />
+ <span className="font-semibold text-[0.85rem] text-foreground">
+ {c.name}
+ </span>
+ <span className="font-[var(--mono)] text-[0.6rem] tracking-[0.04em] uppercase text-muted-foreground">
+ {label}
+ </span>
+ </button>
+ );
+ })}
+ </div>
+
+ <div className="stagger" key={client.flow}>
+ {steps.map((s, i) => (
+ <div key={s.num}>
+ <div className="bg-card border border-border rounded-xl p-4 shadow-[0_1px_2px_rgba(0,0,0,0.04),0_10px_26px_-20px_rgba(0,0,0,0.18)]">
+ <div className="flex items-center gap-[10px] mb-[10px]">
+ <span className="font-[var(--mono)] text-[0.72rem] text-[var(--acc)] font-medium">
+ {s.num}
+ </span>
+ <span className="font-[var(--mono)] text-[0.64rem] tracking-[0.04em] text-muted-foreground bg-muted border border-border rounded-md px-[7px] py-[2px]">
+ {s.crumb}
+ </span>
+ </div>
+ <div className="font-semibold text-[0.98rem] tracking-[-0.01em] mb-[3px]">
+ {s.title}
+ </div>
+ <p className="text-muted-foreground text-[0.85rem] mb-[13px] max-w-[60ch] [text-wrap:pretty]">
+ {s.caption}
+ </p>
+ {s.code && (
+ <div className="relative mb-[13px]">
+ <CopyButton
+ text={s.code}
+ className="absolute top-[8px] right-[8px] w-[28px] h-[28px] inline-flex items-center justify-center bg-zinc-800 text-zinc-500 hover:text-zinc-100 rounded-md cursor-pointer transition-[transform,color] active:scale-[0.96] [&.done]:bg-[var(--acc)] [&.done]:text-white"
+ />
+ <pre className="m-0 overflow-auto rounded-[9px] bg-zinc-900 border border-zinc-800 text-zinc-200 font-[var(--mono)] text-[0.76rem] leading-[1.6] px-[13px] py-[11px] pr-[42px] whitespace-pre">
+ {s.code}
+ </pre>
+ </div>
+ )}
+ <ImagePlaceholder src={s.img} alt={s.alt} />
+ </div>
+ {i < steps.length - 1 && (
+ <div
+ className="flex flex-col items-center py-[7px]"
+ aria-hidden="true"
+ >
+ <span className="w-px h-[12px] bg-border" />
+ <LuArrowDown size={16} className="text-[var(--acc)]" />
+ </div>
+ )}
+ </div>
+ ))}
+ </div>
+ </div>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/SpecRow.tsx b/apps/erp/app/routes/mcp+/components/SpecRow.tsx
new file mode 100644
index 0000000000..0d42f56413
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/SpecRow.tsx
@@ -0,0 +1,26 @@
+import type { ReactNode } from "react";
+
+export function SpecList({ children }: { children: ReactNode }) {
+ return (
+ <div className="stagger border-t border-border mt-[2px]">{children}</div>
+ );
+}
+
+export function SpecRow({
+ label,
+ children
+}: {
+ label: ReactNode;
+ children: ReactNode;
+}) {
+ return (
+ <div className="grid grid-cols-[180px_1fr] gap-[28px] items-baseline py-[15px] border-b border-border">
+ <div className="font-semibold text-[0.95rem] flex items-center gap-[9px]">
+ {label}
+ </div>
+ <p className="text-muted-foreground text-[0.9rem] m-0 [text-wrap:pretty]">
+ {children}
+ </p>
+ </div>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/Tag.tsx b/apps/erp/app/routes/mcp+/components/Tag.tsx
new file mode 100644
index 0000000000..59fb36c32a
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/Tag.tsx
@@ -0,0 +1,28 @@
+import { cn } from "@carbon/react";
+
+const KIND_CLASSES = {
+ READ: "text-[#1f7a52] bg-[#dcefe6] dark:text-[#79d3a6] dark:bg-[#14241c]",
+ WRITE: "text-[#9a5a0c] bg-[#f2e6d3] dark:text-[#e0a24a] dark:bg-[#2a2113]",
+ DESTRUCTIVE:
+ "text-[#b23123] bg-[#f2dcd8] dark:text-[#f08a7c] dark:bg-[#2c1714]"
+} as const;
+
+export function Tag({
+ kind,
+ className
+}: {
+ kind: keyof typeof KIND_CLASSES;
+ className?: string;
+}) {
+ return (
+ <span
+ className={cn(
+ "inline-block font-[var(--mono)] text-[0.6rem] font-bold tracking-[0.04em] px-[6px] py-[2px] rounded-[4px]",
+ KIND_CLASSES[kind],
+ className
+ )}
+ >
+ {kind}
+ </span>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/ThemeToggle.tsx b/apps/erp/app/routes/mcp+/components/ThemeToggle.tsx
new file mode 100644
index 0000000000..ba946c5c01
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/ThemeToggle.tsx
@@ -0,0 +1,29 @@
+import { useEffect, useState } from "react";
+import { LuMoon, LuSun } from "react-icons/lu";
+
+// Toggles the app's light/dark mode. The token values are rendered server-side
+// from the `mode` cookie (see app/services/mode.server.ts), so we set the cookie
+// and reload to pick up the correct theme — the bulletproof, mechanism-matching way.
+export function ThemeToggle() {
+ const [dark, setDark] = useState(false);
+ useEffect(() => {
+ setDark(document.documentElement.classList.contains("dark"));
+ }, []);
+
+ const toggle = () => {
+ const next = !document.documentElement.classList.contains("dark");
+ document.cookie = `mode=${next ? "dark" : "light"}; path=/; max-age=31536000; samesite=lax`;
+ window.location.reload();
+ };
+
+ return (
+ <button
+ type="button"
+ aria-label={dark ? "Switch to light mode" : "Switch to dark mode"}
+ onClick={toggle}
+ className="inline-flex items-center justify-center w-9 h-9 rounded-lg border border-border bg-card text-foreground hover:border-muted-foreground transition-[transform,border-color] duration-150 active:scale-[0.96]"
+ >
+ {dark ? <LuSun size={16} /> : <LuMoon size={16} />}
+ </button>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/ToolBrowser.tsx b/apps/erp/app/routes/mcp+/components/ToolBrowser.tsx
new file mode 100644
index 0000000000..960128162f
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/ToolBrowser.tsx
@@ -0,0 +1,106 @@
+import { useMemo, useState } from "react";
+import { LuChevronDown } from "react-icons/lu";
+import type { CatalogModule, CatalogTool } from "../catalog.server";
+import { filterTools } from "../tools-filter";
+import { FilterSelect } from "./FilterSelect";
+import { ModuleCards } from "./ModuleCards";
+import { Tag } from "./Tag";
+
+const PAGE = 30;
+
+export function ToolBrowser({
+ tools,
+ modules
+}: {
+ tools: CatalogTool[];
+ modules: CatalogModule[];
+}) {
+ const [q, setQ] = useState("");
+ const [module, setModule] = useState("");
+ const [classification, setClassification] = useState("");
+ const [limit, setLimit] = useState(PAGE);
+
+ const filtered = useMemo(
+ () => filterTools(tools, { q, module, classification }),
+ [tools, q, module, classification]
+ );
+ const shown = filtered.slice(0, limit);
+ const remaining = filtered.length - shown.length;
+
+ return (
+ <div>
+ <ModuleCards
+ modules={modules}
+ total={tools.length}
+ value={module}
+ onChange={(v) => {
+ setModule(v);
+ setLimit(PAGE);
+ }}
+ />
+ <div className="border border-border rounded-[11px] overflow-hidden bg-card shadow-[0_1px_2px_rgba(0,0,0,0.04),0_10px_26px_-18px_rgba(0,0,0,0.14)]">
+ <div className="flex gap-2 items-center p-[11px] border-b border-border">
+ <input
+ className="flex-1 bg-muted border border-border rounded-lg px-3 py-2 text-foreground placeholder:text-muted-foreground text-[0.85rem] font-[inherit] outline-none focus:border-[var(--acc)]"
+ placeholder={`Search ${tools.length.toLocaleString()} tools…`}
+ value={q}
+ onChange={(e) => {
+ setQ(e.target.value);
+ setLimit(PAGE);
+ }}
+ />
+ <FilterSelect
+ value={classification}
+ placeholder="All types"
+ options={[
+ { value: "READ", label: "READ" },
+ { value: "WRITE", label: "WRITE" },
+ { value: "DESTRUCTIVE", label: "DESTRUCTIVE" }
+ ]}
+ onChange={(v) => {
+ setClassification(v);
+ setLimit(PAGE);
+ }}
+ />
+ </div>
+ {shown.map((t) => (
+ <div
+ className="flex items-center gap-[11px] p-[11px] border-b border-border last:border-b-0 hover:bg-muted"
+ key={t.name}
+ >
+ <Tag kind={t.classification} />
+ <span className="font-[var(--mono)] font-medium text-[0.78rem]">
+ {t.name}
+ </span>
+ <span className="text-muted-foreground flex-1 text-[0.8rem]">
+ {t.description}
+ </span>
+ <span className="text-muted-foreground text-[0.72rem] whitespace-nowrap">
+ {t.paramCount} params
+ </span>
+ </div>
+ ))}
+ {remaining > 0 ? (
+ <button
+ type="button"
+ onClick={() => setLimit((l) => l + PAGE)}
+ className="w-full flex items-center justify-center gap-[8px] px-[11px] py-[12px] text-[0.8rem] font-semibold text-foreground bg-muted border-t border-border cursor-pointer transition-colors hover:text-[var(--acc)]"
+ >
+ <LuChevronDown size={15} />
+ Load {Math.min(PAGE, remaining).toLocaleString()} more
+ <span className="font-[var(--mono)] text-[0.7rem] font-normal text-muted-foreground tabular-nums">
+ {shown.length.toLocaleString()} /{" "}
+ {filtered.length.toLocaleString()}
+ </span>
+ </button>
+ ) : (
+ <div className="px-[11px] py-[10px] text-[0.75rem] text-muted-foreground bg-muted border-t border-border font-[var(--mono)] tabular-nums">
+ {filtered.length === 0
+ ? "No tools match your filters."
+ : `All ${filtered.length.toLocaleString()} tools shown`}
+ </div>
+ )}
+ </div>
+ </div>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/ToolDiscovery.tsx b/apps/erp/app/routes/mcp+/components/ToolDiscovery.tsx
new file mode 100644
index 0000000000..d7b76ff361
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/ToolDiscovery.tsx
@@ -0,0 +1,69 @@
+import { FlowDiagram } from "./FlowDiagram";
+
+export function ToolDiscovery({ total }: { total: number }) {
+ return (
+ <>
+ <p className="text-muted-foreground max-w-[64ch] mb-6 text-[0.95rem] [text-wrap:pretty]">
+ Carbon doesn&apos;t pour {total.toLocaleString()} tools into the model
+ at once. Three meta-tools let assistants discover what they need, just
+ in time.
+ </p>
+ <FlowDiagram
+ label="DISCOVERY LOOP"
+ caption="Search → describe → call. Auth context is injected automatically."
+ steps={[
+ {
+ name: "search_tools",
+ tag: "READ",
+ text: "Find tools by query, module, or classification."
+ },
+ {
+ name: "describe_tool",
+ tag: "READ",
+ text: "Get parameters & schema for one tool."
+ },
+ {
+ name: "call_tool",
+ tag: "WRITE",
+ text: "Execute it with arguments and get the result."
+ }
+ ]}
+ />
+ <p className="text-muted-foreground max-w-[64ch] mt-[26px] mb-6 text-[0.95rem] [text-wrap:pretty]">
+ You ask for an outcome; the assistant chains the calls itself.
+ Here&apos;s the real sequence behind one request.
+ </p>
+ <FlowDiagram
+ vertical
+ label={'WORKFLOW — "CHASE DOWN EVERYTHING SHIPPING LATE THIS WEEK"'}
+ caption="One sentence from you → five tool calls → a summary back."
+ steps={[
+ {
+ name: "search_tools",
+ tag: "READ",
+ text: "Finds the sales-order and shipment tools."
+ },
+ {
+ name: "sales_getSalesOrders",
+ tag: "READ",
+ text: "Filters to orders due this week that are still open."
+ },
+ {
+ name: "production_getJobs",
+ tag: "READ",
+ text: "Flags the linked jobs running behind schedule."
+ },
+ {
+ name: "sales_sendCustomerUpdate",
+ tag: "WRITE",
+ text: "Drafts a status note to each affected customer."
+ },
+ {
+ name: "Summary",
+ text: "Returns the list, the delays, and the drafts — for your approval."
+ }
+ ]}
+ />
+ </>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/Tools.tsx b/apps/erp/app/routes/mcp+/components/Tools.tsx
new file mode 100644
index 0000000000..ab81e1b064
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/Tools.tsx
@@ -0,0 +1,14 @@
+import type { McpCatalog } from "../catalog.server";
+import { ToolBrowser } from "./ToolBrowser";
+
+export function Tools({ catalog }: { catalog: McpCatalog }) {
+ return (
+ <>
+ <p className="text-muted-foreground max-w-[64ch] mb-6 text-[0.95rem] [text-wrap:pretty]">
+ {catalog.total.toLocaleString()} tools across {catalog.moduleCount}{" "}
+ modules. Filter by module, or search the full catalog.
+ </p>
+ <ToolBrowser tools={catalog.tools} modules={catalog.modules} />
+ </>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/WaveScrollRail.tsx b/apps/erp/app/routes/mcp+/components/WaveScrollRail.tsx
new file mode 100644
index 0000000000..42d81ef197
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/WaveScrollRail.tsx
@@ -0,0 +1,97 @@
+import { useEffect, useRef } from "react";
+
+const N = 46;
+
+export function WaveScrollRail() {
+ const railRef = useRef<HTMLDivElement>(null);
+ useEffect(() => {
+ const rail = railRef.current;
+ if (!rail) return;
+ const RM = matchMedia("(prefers-reduced-motion: reduce)").matches;
+ const dashes: HTMLDivElement[] = [];
+ for (let i = 0; i < N; i++) {
+ const d = document.createElement("div");
+ d.className = "dash";
+ rail.appendChild(d);
+ dashes.push(d);
+ }
+ let crest = 0;
+ let hoverT: number | null = null;
+ let scrubbing = false;
+ let raf = 0;
+ const t0 = performance.now();
+
+ const fracAt = (clientY: number) => {
+ const r = rail.getBoundingClientRect();
+ return Math.max(0, Math.min(1, (clientY - r.top) / r.height));
+ };
+ const scrollP = () => {
+ const h = document.documentElement.scrollHeight - window.innerHeight;
+ return h > 0 ? Math.max(0, Math.min(1, window.scrollY / h)) : 0;
+ };
+ const scrollToFrac = (t: number, behavior: ScrollBehavior) => {
+ const h = document.documentElement.scrollHeight - window.innerHeight;
+ window.scrollTo({ top: t * h, behavior });
+ };
+
+ // Click jumps (smooth); dragging scrubs (instant follow).
+ const onDown = (e: PointerEvent) => {
+ scrubbing = true;
+ rail.setPointerCapture(e.pointerId);
+ hoverT = fracAt(e.clientY);
+ scrollToFrac(hoverT, "smooth");
+ };
+ const onMove = (e: PointerEvent) => {
+ hoverT = fracAt(e.clientY);
+ if (scrubbing) scrollToFrac(hoverT, "auto");
+ };
+ const onUp = (e: PointerEvent) => {
+ scrubbing = false;
+ rail.releasePointerCapture?.(e.pointerId);
+ };
+ const onLeave = () => {
+ if (!scrubbing) hoverT = null;
+ };
+ rail.addEventListener("pointerdown", onDown);
+ rail.addEventListener("pointermove", onMove);
+ rail.addEventListener("pointerup", onUp);
+ rail.addEventListener("pointerleave", onLeave);
+
+ const frame = (now: number) => {
+ const time = (now - t0) / 1000;
+ const target = hoverT != null ? hoverT : scrollP();
+ crest += (target - crest) * 0.12;
+ const p = scrollP();
+ for (let i = 0; i < N; i++) {
+ const tt = i / (N - 1);
+ const dd = tt - crest;
+ const env = Math.exp(-(dd * dd) * 55);
+ const ripple = RM
+ ? 0
+ : 0.5 + 0.5 * Math.sin(time * 2 - tt * Math.PI * 7);
+ const w = 5 + env * 15 + ripple * env * 3 + ripple * 1;
+ const d = dashes[i];
+ const passed = tt <= p + 0.002;
+ d.style.width = `${w.toFixed(1)}px`;
+ d.style.background =
+ env > 0.5
+ ? "var(--acc)"
+ : passed
+ ? "hsl(var(--foreground))"
+ : "hsl(var(--border))";
+ d.style.opacity = String((passed ? 0.7 : 0.45) + 0.3 * env);
+ }
+ raf = requestAnimationFrame(frame);
+ };
+ raf = requestAnimationFrame(frame);
+ return () => {
+ cancelAnimationFrame(raf);
+ rail.removeEventListener("pointerdown", onDown);
+ rail.removeEventListener("pointermove", onMove);
+ rail.removeEventListener("pointerup", onUp);
+ rail.removeEventListener("pointerleave", onLeave);
+ for (const d of dashes) d.remove();
+ };
+ }, []);
+ return <div className="waverail" ref={railRef} aria-hidden="true" />;
+}
diff --git a/apps/erp/app/routes/mcp+/components/WhatIsMcp.tsx b/apps/erp/app/routes/mcp+/components/WhatIsMcp.tsx
new file mode 100644
index 0000000000..94d608a7a2
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/WhatIsMcp.tsx
@@ -0,0 +1,33 @@
+import { SpecList, SpecRow } from "./SpecRow";
+
+export function WhatIsMcp() {
+ return (
+ <>
+ <p className="text-muted-foreground max-w-[64ch] mb-6 text-[0.95rem] text-pretty">
+ MCP is an open standard from Anthropic. It gives AI assistants one
+ consistent way to reach outside systems, so any MCP client can work with
+ Carbon without custom integration code.
+ </p>
+ <SpecList>
+ <SpecRow label="Hosts">
+ The assistants you already use — Claude (web, Desktop, Code), Cursor,
+ VS Code, Codex.
+ </SpecRow>
+ <SpecRow label="Clients">
+ The MCP transport inside the host. Carbon speaks Streamable HTTP.
+ </SpecRow>
+ <SpecRow label="Server">
+ Carbon's remote MCP server — backed by your ERP, secured by a scoped
+ API key.
+ </SpecRow>
+ </SpecList>
+ <p className="text-muted-foreground text-[0.9rem] mt-3 max-w-[64ch] text-pretty">
+ Carbon runs a remote server, so there's nothing to install. Every client
+ points at the same{" "}
+ <span className="font-[var(--mono)] tabular-nums">/api/mcp</span>{" "}
+ endpoint, and new tools become available without any update on your
+ side.
+ </p>
+ </>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/WhatYouCanAsk.tsx b/apps/erp/app/routes/mcp+/components/WhatYouCanAsk.tsx
new file mode 100644
index 0000000000..f6accdfc35
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/WhatYouCanAsk.tsx
@@ -0,0 +1,69 @@
+import { useInViewClass } from "../hooks/useInViewClass";
+import { CopyButton } from "./CopyButton";
+import { PROMPTS, SPECIFICITY } from "./mcp-content";
+
+export function WhatYouCanAsk() {
+ const ref = useInViewClass<HTMLElement>();
+ return (
+ <section
+ ref={ref}
+ id="ask"
+ className="reveal relative py-[54px] scroll-mt-20"
+ >
+ <div className="bg-[#1f2023] bg-[url(/reviews.webp)] bg-cover bg-center text-white rounded-[12px] p-[28px]">
+ {/* Label */}
+ <div className="font-[var(--mono)] text-[0.68rem] tracking-[0.18em] uppercase text-white mb-[16px]">
+ <span className="text-[var(--acc)] font-medium">FIG.02</span> · USE
+ CASES
+ </div>
+ {/* Heading */}
+ <h2
+ className="font-semibold tracking-[-0.03em] leading-[1.12] m-0 mb-[9px] text-white [text-wrap:balance]"
+ style={{ fontSize: "1.6rem" }}
+ >
+ What you can ask
+ </h2>
+ {/* Subline */}
+ <p className="text-zinc-300 max-w-[64ch] mb-[15px] text-[0.95rem] [text-wrap:pretty]">
+ Things you can ask it to do:
+ </p>
+ {/* Prompts */}
+ <div className="stagger flex flex-col gap-[7px]">
+ {PROMPTS.map((p) => (
+ <div
+ key={p}
+ className="flex items-center gap-[10px] justify-between bg-white/5 border border-white/10 rounded-[9px] py-[9px] px-[9px] pl-[13px] text-[0.85rem] transition-[background,border-color] duration-[160ms]"
+ >
+ <span className="flex-1">{p}</span>
+ <CopyButton
+ className="shrink-0 w-7 h-7 inline-flex items-center justify-center bg-white/[0.08] border border-white/[0.18] text-[#d8d8d7] rounded-md cursor-pointer transition-[transform,background,color,border-color] duration-150 [transition-timing-function:cubic-bezier(0.2,0,0,1)] hover:bg-[var(--acc)] hover:border-[var(--acc)] hover:text-white active:scale-[0.96] [&.done]:bg-[var(--acc)] [&.done]:border-[var(--acc)] [&.done]:text-white"
+ text={p}
+ label="Copy prompt"
+ />
+ </div>
+ ))}
+ </div>
+ {/* Specificity block */}
+ <div className="mt-[18px] border-t border-white/10 pt-[14px]">
+ <p className="text-[0.8rem] text-zinc-400 m-0 mb-[10px]">
+ The more specific the ask, the better the result:
+ </p>
+ {/* Too broad row */}
+ <div className="grid grid-cols-[84px_1fr] gap-[12px] items-baseline py-[6px] text-[0.85rem]">
+ <span className="font-[var(--mono)] text-[0.62rem] tracking-[0.08em] uppercase text-[#8f8f8d]">
+ Too broad
+ </span>
+ <span className="text-[#8f8f8d]">{SPECIFICITY.broad}</span>
+ </div>
+ {/* Good/specific row */}
+ <div className="grid grid-cols-[84px_1fr] gap-[12px] items-baseline py-[6px] text-[0.85rem]">
+ <span className="font-[var(--mono)] text-[0.62rem] tracking-[0.08em] uppercase text-[var(--acc)]">
+ Specific
+ </span>
+ <span className="text-[#dcdcdb]">{SPECIFICITY.specific}</span>
+ </div>
+ </div>
+ </div>
+ </section>
+ );
+}
diff --git a/apps/erp/app/routes/mcp+/components/mcp-content.ts b/apps/erp/app/routes/mcp+/components/mcp-content.ts
new file mode 100644
index 0000000000..f2bed642c6
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/mcp-content.ts
@@ -0,0 +1,90 @@
+export const ENDPOINT = "https://app.carbon.ms/api/mcp";
+
+export const PROMPTS: string[] = [
+ "Show all open sales orders due to ship this week.",
+ "Create a job for 50 units of SKU-1042 on the CNC work center.",
+ "Which purchase orders are past their promised receipt date?",
+ "What's the on-hand quantity and reorder point for BRACKET-200 across locations?",
+ "Draft a quote for Acme for 200 aluminum housings and email it.",
+ "List every job behind schedule and who's assigned."
+];
+
+export const SPECIFICITY = {
+ broad: "“Sort out my late orders.”",
+ specific:
+ "“Move every sales order stuck in Needs Approval for 3+ days to Confirmed and email the owner.”"
+};
+
+export const FAQ: { q: string; a: string }[] = [
+ {
+ q: "Do I need an API key?",
+ a: "Not for connector clients — add the URL and authorize in your browser. Keys are for CLI/config clients and headless or CI use."
+ },
+ {
+ q: "Does it respect my Carbon permissions?",
+ a: "Yes. A connector inherits the role and company of whoever authorizes it; an API key carries its own scopes. The assistant can only do what that identity can."
+ },
+ {
+ q: "I'm getting 401 Unauthorized",
+ a: "Key clients: the key is missing, malformed, expired, or deleted — recreate it in Settings → API Keys and update the Authorization header. Connector clients: re-authorize the connection from your client."
+ },
+ {
+ q: "How do I manage or revoke a key?",
+ a: "Each key in Settings → API Keys shows its scopes, rate limit, expiry, and who created it. Delete a key to revoke it; use a separate key per client so revoking one doesn't break the rest."
+ },
+ {
+ q: "Which clients are supported?",
+ a: "Any MCP client that speaks HTTP. Claude.ai, Claude Desktop, and ChatGPT authorize over OAuth; Claude Code, Cursor, VS Code, and Codex send a key header; stdio-only clients bridge through mcp-remote."
+ },
+ {
+ q: "Why can't the assistant see every tool at once?",
+ a: "By design. Three discovery meta-tools — search_tools, describe_tool, and call_tool — let the model find and load only the tools a task needs, keeping its context lean."
+ }
+];
+
+export const TOC = [
+ { id: "whatis", label: "What is MCP?" },
+ { id: "ask", label: "What you can ask" },
+ { id: "quickstart", label: "Quickstart" },
+ { id: "discovery", label: "Tool discovery" },
+ { id: "tools", label: "Tools" },
+ { id: "auth", label: "Authentication" },
+ { id: "safety", label: "Safety" },
+ { id: "faq", label: "FAQ" }
+];
+
+// Connector clients authorize via OAuth (no key); command clients paste a snippet
+// carrying a scoped key. `code`/`target`/`action` describe step 2 of the command flow.
+export type Client =
+ | { name: string; flow: "connector"; where: string }
+ | {
+ name: string;
+ flow: "command";
+ target: string;
+ action: string;
+ code: string;
+ };
+
+// The major clients only — everything else follows one of these two patterns
+// (see the Authentication section / the note below the pipeline).
+export const CLIENTS: Client[] = [
+ {
+ name: "Claude Code",
+ flow: "command",
+ target: "Terminal · Claude Code",
+ action: "Run the command",
+ code: `claude mcp add --transport http \\\n carbon ${ENDPOINT} \\\n --header "Authorization: Bearer crbn_…"`
+ },
+ {
+ name: "Claude Desktop & Web",
+ flow: "connector",
+ where: "Settings → Connectors"
+ },
+ {
+ name: "Cursor",
+ flow: "command",
+ target: ".cursor/mcp.json",
+ action: "Add to your config",
+ code: `{\n "mcpServers": {\n "carbon": {\n "url": "${ENDPOINT}",\n "headers": { "Authorization": "Bearer crbn_…" }\n }\n }\n}`
+ }
+];
diff --git a/apps/erp/app/routes/mcp+/components/module-icons.ts b/apps/erp/app/routes/mcp+/components/module-icons.ts
new file mode 100644
index 0000000000..d1d78f8ea3
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/module-icons.ts
@@ -0,0 +1,40 @@
+import type { IconType } from "react-icons";
+import {
+ LuBox,
+ LuCircleUser,
+ LuCrown,
+ LuFactory,
+ LuFiles,
+ LuFolderCheck,
+ LuLandmark,
+ LuLayers,
+ LuReceipt,
+ LuSettings,
+ LuShield,
+ LuShoppingCart,
+ LuSquareStack,
+ LuUsers,
+ LuWrench
+} from "react-icons/lu";
+
+// Mirrors the ERP's module icons (app/hooks/useModules.tsx). invoicing/account/
+// shared have no top-level nav icon, so the closest lucide stands in.
+export const MODULE_ICONS: Record<string, IconType> = {
+ sales: LuCrown,
+ items: LuSquareStack,
+ production: LuFactory,
+ purchasing: LuShoppingCart,
+ resources: LuWrench,
+ settings: LuSettings,
+ quality: LuFolderCheck,
+ accounting: LuLandmark,
+ inventory: LuBox,
+ people: LuUsers,
+ users: LuShield,
+ documents: LuFiles,
+ invoicing: LuReceipt,
+ account: LuCircleUser,
+ shared: LuLayers
+};
+
+export const FALLBACK_MODULE_ICON: IconType = LuBox;
diff --git a/apps/erp/app/routes/mcp+/components/quickstart-nav.ts b/apps/erp/app/routes/mcp+/components/quickstart-nav.ts
new file mode 100644
index 0000000000..4c0883afa8
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/components/quickstart-nav.ts
@@ -0,0 +1,14 @@
+// Lets the hero CTAs drive the Quickstart: smooth-scroll to it and, optionally,
+// preselect a client in the SetupPipeline (which listens for this event).
+export const SELECT_CLIENT_EVENT = "mcp:select-client";
+
+export function goToQuickstart(client?: string) {
+ document
+ .getElementById("quickstart")
+ ?.scrollIntoView({ behavior: "smooth", block: "start" });
+ if (client) {
+ window.dispatchEvent(
+ new CustomEvent(SELECT_CLIENT_EVENT, { detail: client })
+ );
+ }
+}
diff --git a/apps/erp/app/routes/mcp+/hooks/useInViewClass.ts b/apps/erp/app/routes/mcp+/hooks/useInViewClass.ts
new file mode 100644
index 0000000000..b6c5533432
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/hooks/useInViewClass.ts
@@ -0,0 +1,16 @@
+import { useEffect, useRef } from "react";
+
+export function useInViewClass<T extends HTMLElement>(threshold = 0.12) {
+ const ref = useRef<T>(null);
+ useEffect(() => {
+ const el = ref.current;
+ if (!el) return;
+ const io = new IntersectionObserver(
+ (es) => es.forEach((e) => e.isIntersecting && el.classList.add("in")),
+ { threshold }
+ );
+ io.observe(el);
+ return () => io.disconnect();
+ }, [threshold]);
+ return ref;
+}
diff --git a/apps/erp/app/routes/mcp+/hooks/useScrollSpy.ts b/apps/erp/app/routes/mcp+/hooks/useScrollSpy.ts
new file mode 100644
index 0000000000..cb32014043
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/hooks/useScrollSpy.ts
@@ -0,0 +1,19 @@
+import { useEffect, useState } from "react";
+
+export function useScrollSpy(ids: string[], offset = 150) {
+ const [activeIndex, setActiveIndex] = useState(0);
+ useEffect(() => {
+ const onScroll = () => {
+ let idx = 0;
+ ids.forEach((id, i) => {
+ const el = document.getElementById(id);
+ if (el && el.getBoundingClientRect().top < offset) idx = i;
+ });
+ setActiveIndex(idx);
+ };
+ onScroll();
+ document.addEventListener("scroll", onScroll, { passive: true });
+ return () => document.removeEventListener("scroll", onScroll);
+ }, [ids, offset]);
+ return activeIndex;
+}
diff --git a/apps/erp/app/routes/mcp+/tools-filter.ts b/apps/erp/app/routes/mcp+/tools-filter.ts
new file mode 100644
index 0000000000..679d1cc981
--- /dev/null
+++ b/apps/erp/app/routes/mcp+/tools-filter.ts
@@ -0,0 +1,21 @@
+import type { CatalogTool } from "./catalog.server";
+
+export interface ToolFilter {
+ q: string;
+ module: string;
+ classification: string;
+}
+
+export function filterTools(
+ tools: CatalogTool[],
+ f: ToolFilter
+): CatalogTool[] {
+ const q = f.q.trim().toLowerCase();
+ return tools.filter((t) => {
+ if (f.module && t.module !== f.module) return false;
+ if (f.classification && t.classification !== f.classification) return false;
+ if (q && !`${t.name} ${t.description}`.toLowerCase().includes(q))
+ return false;
+ return true;
+ });
+}
diff --git a/apps/erp/app/styles/mcp.css b/apps/erp/app/styles/mcp.css
new file mode 100644
index 0000000000..037cbe0545
--- /dev/null
+++ b/apps/erp/app/styles/mcp.css
@@ -0,0 +1,200 @@
+/* Page tokens + animation/marker systems only.
+ All layout/component styles live in Tailwind utilities on the components. */
+
+.MCP {
+ --acc: #ff442d;
+ --acc-tint: rgb(255 68 45 / 0.06);
+ --acc-tint-strong: rgb(255 68 45 / 0.08);
+ --acc-ring: rgb(255 68 45 / 0.15);
+ --canvas: #d8dad9;
+ --canvas-blur: rgb(216 218 217 / 0.8);
+ --mono: "Geist Mono Variable", ui-monospace, monospace;
+ font-family: "Geist Variable", system-ui, sans-serif;
+ font-size: 0.95rem;
+ line-height: 1.6;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.MCP * {
+ box-sizing: border-box;
+}
+
+.dark .MCP {
+ --canvas: #1a1a1c;
+ --canvas-blur: rgb(26 26 28 / 0.8);
+}
+
+.MCP .container {
+ max-width: 1080px;
+ margin: 0 auto;
+ padding: 0 24px;
+}
+
+/* ── Reveal animation ──────────────────────────────────────── */
+
+.MCP .reveal {
+ opacity: 0;
+ transform: translateY(20px);
+ filter: blur(6px);
+ transition: opacity 0.75s cubic-bezier(0.2, 0, 0, 1),
+ transform 0.75s cubic-bezier(0.2, 0, 0, 1),
+ filter 0.75s cubic-bezier(0.2, 0, 0, 1);
+}
+
+.MCP .reveal.in {
+ opacity: 1;
+ transform: none;
+ filter: none;
+}
+
+/* ── Generic stagger marker ────────────────────────────────── */
+
+.MCP .stagger > * {
+ opacity: 0;
+ transform: translateY(12px);
+ transition: opacity 0.6s cubic-bezier(0.2, 0, 0, 1),
+ transform 0.6s cubic-bezier(0.2, 0, 0, 1);
+}
+
+.MCP .in .stagger > * {
+ opacity: 1;
+ transform: none;
+}
+
+.MCP .in .stagger > *:nth-child(2) {
+ transition-delay: 0.08s;
+}
+
+.MCP .in .stagger > *:nth-child(3) {
+ transition-delay: 0.16s;
+}
+
+.MCP .in .stagger > *:nth-child(4) {
+ transition-delay: 0.24s;
+}
+
+.MCP .in .stagger > *:nth-child(5) {
+ transition-delay: 0.32s;
+}
+
+.MCP .in .stagger > *:nth-child(n + 6) {
+ transition-delay: 0.36s;
+}
+
+/* ── Hairline wipe marker ──────────────────────────────────── */
+
+.MCP .hr-wipe {
+ position: relative;
+}
+
+.MCP .hr-wipe::before {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 1px;
+ background: hsl(var(--border));
+ transform: scaleX(0);
+ transform-origin: left;
+ transition: transform 0.9s cubic-bezier(0.2, 0, 0, 1);
+}
+
+.MCP .hr-wipe.in::before {
+ transform: scaleX(1);
+}
+
+/* ── TOC active indicator ──────────────────────────────────── */
+
+.MCP .toc-track {
+ position: relative;
+ padding-left: 16px;
+}
+
+.MCP .toc-track::before {
+ content: "";
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ width: 1px;
+ background: hsl(var(--border));
+}
+
+.MCP .toc-track a {
+ position: relative;
+}
+
+.MCP .toc-track a::before {
+ content: "";
+ position: absolute;
+ left: -16px;
+ top: 0;
+ bottom: 0;
+ width: 0;
+ background: var(--acc);
+ opacity: 0;
+ transition: width 0.22s cubic-bezier(0.2, 0, 0, 1), opacity 0.22s;
+}
+
+.MCP .toc-track a.passed::before {
+ width: 1px;
+ opacity: 0.55;
+}
+
+.MCP .toc-track a.active::before {
+ width: 2px;
+ opacity: 1;
+}
+
+/* ── Wave rail (progress indicator) ───────────────────────── */
+
+.MCP .waverail {
+ position: fixed;
+ right: max(30px, 3.4vw);
+ top: 50%;
+ transform: translateY(-50%);
+ height: 56vh;
+ width: 26px;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ align-items: flex-end;
+ z-index: 900;
+ cursor: pointer;
+}
+
+.MCP .dash {
+ height: 2px;
+ border-radius: 2px;
+ width: 7px;
+ will-change: opacity;
+}
+
+/* ── Reduced motion ────────────────────────────────────────── */
+
+@media (prefers-reduced-motion: reduce) {
+ .MCP * {
+ transition-duration: 0.001ms !important;
+ animation-duration: 0.001ms !important;
+ }
+
+ .MCP .reveal,
+ .MCP .stagger > *,
+ .MCP .in .stagger > * {
+ opacity: 1 !important;
+ transform: none !important;
+ filter: none !important;
+ }
+
+ .MCP .hr-wipe::before {
+ transform: scaleX(1) !important;
+ }
+}
+
+@media (max-width: 1200px) {
+ .MCP .waverail {
+ display: none;
+ }
+}
diff --git a/apps/erp/public/cta.webp b/apps/erp/public/cta.webp
new file mode 100644
index 0000000000..61674631d4
Binary files /dev/null and b/apps/erp/public/cta.webp differ
diff --git a/apps/erp/public/mcp/add-claude-ai.png b/apps/erp/public/mcp/add-claude-ai.png
new file mode 100644
index 0000000000..81fe6387f4
Binary files /dev/null and b/apps/erp/public/mcp/add-claude-ai.png differ
diff --git a/apps/erp/public/mcp/add-claude-code.png b/apps/erp/public/mcp/add-claude-code.png
new file mode 100644
index 0000000000..6be1a009af
Binary files /dev/null and b/apps/erp/public/mcp/add-claude-code.png differ
diff --git a/apps/erp/public/mcp/add-cursor.png b/apps/erp/public/mcp/add-cursor.png
new file mode 100644
index 0000000000..5f866e6668
Binary files /dev/null and b/apps/erp/public/mcp/add-cursor.png differ
diff --git a/apps/erp/public/mcp/api-key.png b/apps/erp/public/mcp/api-key.png
new file mode 100644
index 0000000000..ed29746136
Binary files /dev/null and b/apps/erp/public/mcp/api-key.png differ
diff --git a/apps/erp/public/mcp/authorize-connector.png b/apps/erp/public/mcp/authorize-connector.png
new file mode 100644
index 0000000000..8f7a9aa297
Binary files /dev/null and b/apps/erp/public/mcp/authorize-connector.png differ
diff --git a/apps/erp/public/mcp/verify-claude-ai.png b/apps/erp/public/mcp/verify-claude-ai.png
new file mode 100644
index 0000000000..dc4363abaf
Binary files /dev/null and b/apps/erp/public/mcp/verify-claude-ai.png differ
diff --git a/apps/erp/public/mcp/verify-claude-code.png b/apps/erp/public/mcp/verify-claude-code.png
new file mode 100644
index 0000000000..aa214ad131
Binary files /dev/null and b/apps/erp/public/mcp/verify-claude-code.png differ
diff --git a/apps/erp/public/mcp/verify-cursor.png b/apps/erp/public/mcp/verify-cursor.png
new file mode 100644
index 0000000000..7aa337bcc1
Binary files /dev/null and b/apps/erp/public/mcp/verify-cursor.png differ
diff --git a/apps/erp/public/reviews.webp b/apps/erp/public/reviews.webp
new file mode 100644
index 0000000000..700ce8e670
Binary files /dev/null and b/apps/erp/public/reviews.webp differ