• Joined on 2026-02-18

@assemblcorp/mcp-server (1.0.1)

Published 2026-03-06 10:22:48 +00:00 by admin

Installation

@assemblcorp:registry=
npm install @assemblcorp/mcp-server@1.0.1
"@assemblcorp/mcp-server": "1.0.1"

About this package

@assemblcorp/mcp-server

Model Context Protocol (MCP) server for @jax/ui design system. Enables AI agents (Claude, Cursor, etc.) to discover components, validate code, and follow brand guidelines automatically.

Installation

pnpm add @assemblcorp/mcp-server
# or
npm install @assemblcorp/mcp-server

Quick Start

Claude Desktop Integration

Add to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "jax-ui": {
      "command": "npx",
      "args": ["@assemblcorp/mcp-server"],
      "env": {
        "JAX_MANIFEST_PATH": "/path/to/your/project/packages/ui/dist/unified-manifest.json"
      }
    }
  }
}

Running Locally

# From project root (manifest auto-discovered)
npx @assemblcorp/mcp-server

# With explicit manifest path
JAX_MANIFEST_PATH=./dist/unified-manifest.json npx @assemblcorp/mcp-server

Available Tools

get_component_api

Get the complete API schema for a component.

Input: { componentName: "Button" }
Output: { id, name, props, slots, verification, ... }

list_components

List all available components with optional filtering.

Input: { filter: "primitives" | "compounds" | "all" }
Output: [{ name, role, type, props }, ...]

list_api_symbols

List runtime symbols exported by @assemblcorp/ui with kind metadata (component, hook, constant, error, utility).

Input: { query?: "Button", kind?: "component", limit?: 200 }
Output: { source, entryPath, totalSymbols, returned, symbols: [{ name, kind, runtimeType, isManifestComponent }] }

get_api_symbol

Get detailed metadata for one runtime symbol.

Input: { symbolName: "Button" }
Output: { found, symbol, manifestComponent, entryPath, manifestPath, ... }

get_brand_rules

Get brand guidelines, style rules, and integration contract metadata.

Input: {}
Output: { brand, physics, geometry, rules, integration, metadata }

get_integration_rules

Get anti-drift integration conventions for consumers (imports, token naming, layout patterns, verification commands).

Input: {}
Output: { package, sourceOfTruth, theming, layout, verification }

get_integration_snapshot

Get a single integration payload for docs/codegen consumers, including source-of-truth paths, layout APIs, token aliases, brand rules, and verification commands.

Input: {}
Output: { package, sourceOfTruth, componentInventory, layout, theming, verification }

validate_component_usage

Validate JSX/TSX code against the component API.

Input: { code: "<Button variant=\"solid\" color=\"primary\">Click</Button>" }
Output: { valid: true, component: "Button", errors: [], suggestions: [] }

get_verification_url

Get a URL to verify component rendering in the showcase.

Input: { componentName: "Button", props: { variant: "solid", color: "primary" } }
Output: { component: "Button", url: "https://...", instructions: "..." }

list_tokens

List DTCG token entries from base tokens or a merged theme token file.

Input: { source?: "base" | "theme", themeId?: "arctic", prefix?: "semantic.color", mode?: "light", limit?: 200 }
Output: { source, tokenPath, totalTokens, returned, entries: [{ path, type, value, mode, description }] }

get_token

Get one token by exact dotted path.

Input: { tokenPath: "semantic.color.primary.base", source?: "base" | "theme", themeId?: "arctic" }
Output: { found, token?, suggestions? }

query_tokens

Fuzzy-search tokens by path, with optional type/mode filters.

Input: { query: "surface", source?: "theme", themeId?: "neo", mode?: "dark", limit?: 50 }
Output: { query, totalCandidates, returned, matches: [...] }

get_theme_manifest

Return the preset theme manifest and optional token file metadata for a specific theme.

Input: { themeId?: "arctic", includeTokenMetadata?: true }
Output: { manifest, availableThemes, selectedTheme, tokenMetadata }

validate_snapshot

Validate AI snapshot payloads against unified-manifest.json + ai-director validation contracts.

Input: { snapshot: {...}, blockPack?: "all" | "rallydog" | "blog", collectAllErrors?: boolean, expectedManifestHash?: "abc", includeNodes?: false }
Output: { valid, nodeCount, errorCount, errors, manifestCheck?, ... }

get_block_api

Get block metadata by ID/name from ai-director block packs (rallydog, blog) with manifest fallback.

Input: { blockId: "hero", pack?: "all" | "rallydog" | "blog" }
Output: { found, source, pack, block, ... }

get_rallydog_block_status

Audit Rallydog block slot wiring, slot type coverage, and section-composer render readiness (defaults to hero and rsvp-card).

Input: { blockIds: ["hero", "rsvp-card"] } // optional
Output: {
  summary: {
    overallStatus,
    found,
    missing,
    editableSlotsWired,
    slotTypeMismatches,
    averageStrictTypeCoveragePercent,
    composerRenderReady,
    composerRenderWarnings,
    composerRenderFailures
  },
  sources: { aiDirector, manifest, composerRegistry },
  blocks: [...]
}

Available Resources

Static resources

  • jax://protocol/llms - Generated llms.txt protocol guidance
  • jax://manifest/unified - Full unified component manifest payload
  • jax://manifest/style - Style manifest (brand/physics/geometry/rules)
  • jax://integration/contract - Anti-drift integration contract
  • jax://integration/snapshot - Consolidated integration snapshot

Resource templates

  • jax://tokens/base/{tokenPath} - Base token lookup by exact dotted path
  • jax://tokens/theme/{themeId}/{tokenPath} - Theme token lookup by exact dotted path

Environment Variables

Variable Description Default
JAX_MANIFEST_PATH Path to unified-manifest.json Auto-discovered
JAX_STYLE_PATH Path to style-manifest.json Auto-discovered or built-in defaults
JAX_AI_DIRECTOR_PATH Path to ai-director.mjs for Rallydog block definitions Auto-discovered
JAX_AI_DIRECTOR_VALIDATION_PATH Path to ai-director validation module (validation.ts or ai-director-validation.mjs) Auto-discovered
JAX_SECTION_COMPOSER_REGISTRY_PATH Path to section composer registry source (registry.tsx) for render readiness checks Auto-discovered (in-repo only; set explicitly for external Rallydog repos)
RALLYDOG_SHARED_BLOCK_REGISTRY_PATH Path to Rallydog shared block registry source (block-registry.ts) Auto-discovered (in-repo only; set explicitly for external Rallydog repos)
RALLYDOG_ALLOW_UNSUPPORTED_BLOCK_IDS Comma-separated temporary allowlist for blocks mapped to unsupportedDef Empty (no allowlist)

How It Works

  1. Manifest Discovery: The server reads unified-manifest.json (generated by jui unified-manifest) and refreshes from disk on each tool call
  2. Tool Registration: Exposes MCP tools for component discovery and validation
  3. Protocol Communication: Uses stdio transport for Claude Desktop/Cursor integration

Development

# Build
pnpm build

# Run in dev mode
pnpm dev

# Type check
pnpm typecheck

# Rallydog block gate (required blocks + expanded coverage)
pnpm check:rallydog-blocks

Gate tuning:

  • RALLYDOG_REQUIRED_BLOCK_IDS=hero,rsvp-card override required block gate set
  • RALLYDOG_COVERAGE_BLOCK_IDS=hero,rsvp-card,header,... override expanded coverage set
  • RALLYDOG_COVERAGE_STRICT=1 fail when expanded coverage has any failures
  • JAX_SECTION_COMPOSER_REGISTRY_PATH=/abs/path/to/rallydog/apps/web/src/features/sectionComposer/model/registry.tsx opt into cross-repo composer checks
  • RALLYDOG_SHARED_BLOCK_REGISTRY_PATH=/abs/path/to/rallydog/packages/shared/src/block-registry.ts opt into cross-repo ownership checks

Ownership contract:

  • Ownership is derived from sectionRegistry mapping style:
    • defineSection(...) => native-jax-ui
    • autoSection(...) => autoSection
    • defineLensStrategySection(...) => custom-section
    • unsupportedDef => intentionally-unsupported
  • check:rallydog-blocks now fails if:
    • ai-director and shared block registries drift
    • sectionRegistry is missing mappings for known blocks (or has unknown extras)
    • sectionRegistry mapping expressions are unresolved
    • A block is mapped to unsupportedDef (unless temporarily allowlisted via RALLYDOG_ALLOW_UNSUPPORTED_BLOCK_IDS)
  • Adding/migrating a block safely:
    1. Add block in ai-director (packages/ui/src/ai-director/blocks/rallydog-definitions/index.ts)
    2. Add block in Rallydog shared registry (../rallydog/packages/shared/src/block-registry.ts)
    3. Add concrete section mapping in Rallydog section composer (../rallydog/apps/web/src/features/sectionComposer/model/registry.tsx)
    4. Run pnpm check:rallydog-blocks

License

MIT

Dependencies

Dependencies

ID Version
@assemblcorp/shared 1.0.9
@modelcontextprotocol/sdk ^1.27.1
zod ^4.3.6

Development Dependencies

ID Version
@types/node ^25.3.1
tsdown 0.20.3
tsx ^4.21.0
typescript npm:@typescript/native-preview@7.0.0-dev.20260225.1

Peer Dependencies

ID Version
@assemblcorp/ui 1.0.46

Keywords

mcp model-context-protocol design-system ai claude
Details
npm
2026-03-06 10:22:48 +00:00
15
MIT
latest
3.9 KiB
Assets (1)
Versions (2) View all
1.0.1 2026-03-06
1.0.0 2026-03-06