Name:v0.11.0Status:complete
v0.11.0 — Unified Config & MCP Server
Not enough history yet — burndown needs at least one completed day of activity.
Progress 0/17 work items
- Promote
refrakt.config.jsonfrom a site-only file to a unified root config withplugins,plan, andsite/sitessections (ADR-010) - Multi-site support — one repo can declare multiple sites under a
sitesmap; all five framework adapters (SvelteKit, Astro, Nuxt, Next, Eleventy) accept asiteoption to pick their target - Loader normalization shared between the CLI and the framework adapters via
@refrakt-md/transform/nodeso both paths see the same canonical config shape - First-class plugin discovery in
@refrakt-md/cliviadiscoverPlugins(), with explicitconfig.pluginsoverriding heuristic dependency scanning - New
@refrakt-md/mcppackage wrapping the refrakt CLI as a Model Context Protocol server (SPEC-043) - Extended
cli-plugincontract — commands can declareinputSchema,outputSchema, andmcpHandlerfor clean structured I/O @refrakt-md/plancommands wired with MCP-friendly schemas;plan initscaffolds the unified config- create-refrakt and the refrakt repo itself migrated to the new config shape
- Site docs for configuration (incl. multi-site) and the MCP server
Work Items
Draft 17
WORK-159 main
Unified RefraktConfig types, loader, and JSON Schema Promote refrakt.config.json from a site-only file into the unified root config defined in ADR-010. Add type-level support for plugins, plan, site, and sites, normalize the three valid input shapes (flat / singular site / plural sites) into a canonical internal form, and publish a JSON Schema so editors can autocomplete and validate the file.
0/10 criteria
WORK-160 main
Add discoverPlugins() helper to @refrakt-md/cli Replace the lazy runPlugin import-on-demand pattern in packages/cli/src/bin.ts with a first-class discoverPlugins() helper that returns the full set of installed plugins. The helper has four consumers in v0.11.0 — CLI dispatch, refrakt --help, refrakt plugins list, and the new MCP server — and centralizing the logic eliminates three different implementations of the same scan.
0/10 criteria
WORK-161 main
Extend CliPluginCommand with inputSchema/outputSchema/mcpHandler Add three optional fields to the CliPluginCommand interface so plugin commands can declare structured input/output schemas and an MCP-friendly handler that bypasses argv parsing. Existing plugins keep working unchanged — the fields are purely additive.
0/5 criteria
WORK-162 main
Refactor runPlugin dispatch to use discoverPlugins Switch the CLI's plugin dispatch in packages/cli/src/bin.ts from blind import('@refrakt-md/<namespace>/cli-plugin') to a discoverPlugins() lookup. This produces a friendlier "did you mean?" error when a namespace is misspelled (since we know the full set of installed plugins) and centralizes plugin loading on the new helper.
0/5 criteria
WORK-163 main
refrakt --help lists installed plugins + new refrakt plugins list command Surface the installed plugin set in two places: the top-level refrakt --help output (so users discover available namespaces without reading docs) and a dedicated refrakt plugins list command (canonical machine-readable output for tooling, including MCP clients debugging their setup).
0/6 criteria
WORK-164 main
Add --site flag to site-scoped CLI commands Site-scoped commands (inspect, contracts, validate, scaffold-css, package validate) need to know which site they are operating on when the project declares multiple. Add a --site <name> flag that selects an entry from the normalized sites map; for single-site projects the flag is optional and resolves to the lone entry.
0/7 criteria
WORK-165 main
Lint cli-plugin shape in refrakt package validate Add a lint pass to refrakt package validate that checks a package's cli-plugin export for structural issues — missing namespace, missing descriptions, malformed inputSchema, namespace conflicts with already-installed plugins. Catches problems at package-publish time rather than at runtime when the MCP server tries to advertise the broken tool.
0/7 criteria
WORK-166 main
Framework adapters accept site option Update all five framework adapter packages — @refrakt-md/sveltekit, @refrakt-md/astro, @refrakt-md/nuxt, @refrakt-md/next, @refrakt-md/eleventy — to accept a site?: string option. Each adapter resolves its target site via the shared normalizer from WORK-159, then reads contentDir, theme, target, packages, routeRules, icons, backgrounds from the resolved site entry instead of the top-level config. Single-site projects and the legacy flat shape continue to work without changes; multi-site repos pick a target per adapter.
0/12 criteria
WORK-167 main
Add inputSchema + mcpHandler to plan commands Wire the @refrakt-md/plan CLI commands with the new schema fields from WORK-161 so the MCP server exposes them as cleanly typed tools. Each command gets a JSON Schema for its inputs and an mcpHandler that bypasses argv parsing and accepts a structured object directly.
0/7 criteria
WORK-168 main
Plan package consumes unified config (init scaffolds, serve/build read paths) Wire @refrakt-md/plan to the unified refrakt.config.json. plan init scaffolds the config (creating it or extending an existing one with a plan section), and plan serve / plan build / other plan commands read plan.dir from the loaded config instead of relying solely on the --dir flag and defaults. The plan section currently exposes only dir; specs path remains derived from dir (a child folder), and surfacing it as a config field can come later if real-world projects demand it.
0/8 criteria
WORK-169 main
Scaffold @refrakt-md/mcp package with stdio entry, auto-detect, and core tools Create the @refrakt-md/mcp package: stdio MCP server entry point, auto-detection of plan and site contexts from the unified config and the filesystem, and the initial set of core CLI-mirroring tools (refrakt.inspect, refrakt.contracts, refrakt.validate, refrakt.reference, refrakt.package_validate).
0/9 criteria
WORK-170 main
MCP plugin tools (via discovery) and resources Wire plugin-contributed tools (notably the @refrakt-md/plan commands) into the MCP server via discoverPlugins(), and implement the read-only resources (refrakt://detect, refrakt://reference, refrakt://contracts, refrakt://rune/<name>, refrakt://plan/*) so agents that prefer pull semantics have first-class URIs.
0/8 criteria
WORK-171 main
Add refrakt config migrate command Add a small migration command that rewrites a flat-shape refrakt.config.json into the nested form (site.* and explicit plugins). Optional for users — the flat shape stays valid indefinitely — but useful for projects adopting the unified config or moving to multi-site.
0/8 criteria
WORK-172 main
Migrate this repo's site config to the unified root config Move site/refrakt.config.json to a unified refrakt.config.json at the repo root, declaring plugins, the plan section, and sites.main (or whatever name we settle on) for the existing site. Validates the design against our own project and gives us a multi-site-ready structure for any future additions (separate plan dashboard site, blog, etc.).
0/9 criteria
WORK-173 main
Update create-refrakt scaffolds for the unified config shape create-refrakt currently writes a flat-shape site/refrakt.config.json for site projects and (via plan init) no config at all for plan projects. Update both paths to produce the new unified root-shape config — site projects get a sites.main section, plan projects get a plan section, and any combined scaffolds (future) declare both.
0/8 criteria
WORK-174 main
Site docs — configuration section Document the unified refrakt.config.json at site/content/docs/configuration/. Cover the three valid shapes (flat / singular site / plural sites), each section (plugins, plan, site/sites), the multi-site workflow, and the migration story for existing flat-shape configs.
0/5 criteria
WORK-175 main
Site docs — MCP + plugin authoring update + CLAUDE.md pointer Document the new @refrakt-md/mcp server (registration, tool reference, resource reference) at site/content/docs/mcp/, update the existing plugin authoring docs to cover the new cli-plugin schema fields (inputSchema, outputSchema, mcpHandler), and add a brief pointer in the root CLAUDE.md so AI agents know the MCP server exists when registered.
0/5 criteria