Spartan Ng Mcp

by carlospalacin

346 downloads
Not rated
GitHub

About

An MCP server that turns the entire Spartan Angular UI ecosystem into a queryable tool surface for AI-powered IDEs. It exposes 14 tools covering component discovery with fuzzy search across 56+ components and 17 page-level blocks, detailed Brain (headless) and Helm (styled) API i

Details

Author
carlospalacin
Downloads
346
Categories
Developer Tools, Knowledge Base, Other

- Component discovery with fuzzy search across 56+ components and 17 page blocks
- Inspect Brain (headless) and Helm (styled) APIs in detail
- Fetch TypeScript source code directly from GitHub
- Generate CLI install commands with peer dependency resolution
- Run post‑install audits and detect Angular/Nx/Tailwind project context
- Three‑tier data resolution (static registry, Analog API, GitHub API) with multi‑layer caching

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Spartan Ng Mcp
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Configure the server in your MCP client’s configuration file. It works with Claude Code, Cursor, VS Code Copilot, and any MCP‑compatible client. No additional setup commands are documented.

spartan_list

List all available Spartan Angular UI components and blocks. Components show Brain/Helm availability. Blocks are grouped by category.

spartan_search

Fuzzy search across Spartan components, blocks, and documentation topics. Returns ranked results with relevance scores.

spartan_view

View detailed information for a Spartan component including Brain directives, Helm components, inputs/outputs, signal models, code examples, and installation snippets.

spartan_dependencies

Show the dependency graph for a Spartan component. Returns direct dependencies (which components it needs), transitive dependencies (up to configurable depth), and reverse dependencies (which components depend on it).

spartan_source

Fetch the TypeScript source code of a Spartan component from GitHub. Returns files from libs/brain/{name}/src/ and/or libs/helm/{name}/src/ with extracted exports.

spartan_block_source

Fetch the source code of a Spartan page-level block from GitHub. Returns component files, shared utilities, and extracted imports (spartan/angular/cdk/other).

spartan_docs

Fetch Spartan documentation topics (installation, CLI, theming, dark-mode, typography, figma, changelog). Returns structured content with code blocks and headings.

spartan_project_info

Detect the Angular/Nx project configuration in the current directory. Returns Angular version, Nx workspace info, Tailwind version, installed Spartan packages, package manager, and zoneless mode status.

spartan_project_components

List Spartan components installed in the current project. Shows Brain/Helm packages with versions and identifies missing pairs (Brain without Helm or vice versa).

spartan_install_command

Generate ready-to-run CLI commands to install Spartan components. Supports Nx generator (recommended) or direct npm install. Returns commands plus required peer dependencies.

spartan_audit

Generate a verification checklist after installing Spartan components. Checks imports, peer dependencies, Tailwind preset, Brain/Helm pairing, and common setup issues.

spartan_cache

Manage the MCP server cache. Check status (memory + file stats), clear cached data, or trigger a full rebuild from live sources.

spartan_registry_refresh

Refresh the component registry from the live Spartan Analog API. Updates the in-memory registry with the latest components without requiring an MCP update. Shows diff of added/updated/removed components.

spartan_install_skills

Install Spartan Angular UI skills into a project's .claude/skills/spartan/ directory. Skills teach AI assistants how to correctly use Spartan components — Brain/Helm patterns, composition rules, styling conventions. Fetches from GitHub if not available locally.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "spartan ng mcp": {
            "spartan-ng": {
                "command": "npx",
                "args": [
                    "-y",
                    "spartan-ng-mcp"
                ],
                "env": {
                    "GITHUB_TOKEN": "ghp_...",
                    "SPARTAN_CACHE_TTL_HOURS": "48"
                }
            }
        }
    }
}

McpServers

{
    "spartan-ng": {
        "command": "npx",
        "args": [
            "-y",
            "spartan-ng-mcp"
        ],
        "env": {
            "GITHUB_TOKEN": "ghp_...",
            "SPARTAN_CACHE_TTL_HOURS": "48"
        }
    }
}

An MCP (Model Context Protocol) server that exposes theSpartan Angular UIecosystem as intelligent tools for AI-powered IDEs and assistants. Discover components, browse Brain/Helm APIs, fetch source code, generate install commands, detect project context, and use page-level building blocks — all through the MCP protocol.

Spartan's dual-layer architecture (Brain for headless logic + Helm for styled components) is powerful but has a learning curve. AI assistants need structured access to component APIs, source code, and installation patterns to generate correct Angular code. This MCP server bridges that gap — turning the entire Spartan ecosystem into a queryable, context-aware tool surface.

- 56 componentswith full Brain/Helm API details (directives, inputs, outputs, signal models)
- 17 page-level blocks(sidebar, login, signup, calendar variants)
- Fuzzy searchacross components, blocks, and documentation
- TypeScript source codefetching from GitHub with intelligent caching
- Project context detection— Angular version, Nx workspace, Tailwind config, zoneless mode
- Installation command generationnx generateornpm installwith peer dependency resolution
- Post-install audit— verification checklist for Tailwind preset, Brain/Helm pairing, OnPush
- Runtime registry refresh— pick up new Spartan components without an MCP update
- Skills installer— deployspartan-ng-skillsto any Angular project

{ "mcpServers": { "spartan-ng": { "command": "npx", "args": ["-y", "spartan-ng-mcp"], "env": { "GITHUB_TOKEN": "ghp_your_token_here" } } } }
{ "mcpServers": { "spartan-ng": { "command": "npx", "args": ["-y", "spartan-ng-mcp"], "env": { "GITHUB_TOKEN": "ghp_your_token_here" } } } }
{ "servers": { "spartan-ng": { "command": "npx", "args": ["-y", "spartan-ng-mcp"], "env": { "GITHUB_TOKEN": "ghp_your_token_here" } } } }

Note:TheGITHUB_TOKENis optional but recommended. Without it, GitHub API requests are limited to 60/hr. With a token (no scopes needed — public repo access only), the limit is 5000/hr.

Instead of putting tokens in IDE config files (which may get committed to git), you can create a.envfile in your project root:

GITHUB_TOKEN=ghp_your_token_here SPARTAN_CACHE_TTL_HOURS=48

The MCP server loads.envautomatically on startup. Make sure.envis in your.gitignore.

git clone https://github.com/carlospalacin/spartan-ng-mcp.git cd spartan-ng-mcp npm install npm run build

When installing from source, replace"command": "npx"and"args": ["-y", "spartan-ng-mcp"]with"command": "node"and"args": ["/absolute/path/to/spartan-ng-mcp/dist/index.js"]in the IDE configurations above.

MCP resources provide direct data access via thespartan://URI scheme:

Pre-built workflow templates for common tasks:

src/ ├── index.ts # Entry point — stdio transport ├── server.ts # McpServer factory + tool registration ├── tools/ # 14 MCP tools (one file per group) │ ├── discovery.ts # list, search, view, dependencies │ ├── source.ts # component + block source │ ├── docs.ts # documentation topics │ ├── install.ts # CLI commands + audit │ ├── context.ts # project detection │ ├── cache.ts # cache + registry refresh │ ├── dependencies.ts # dependency graph │ └── skills.ts # skills installer ├── data/ # API clients │ ├── analog-api.ts # Spartan Analog API (primary data source) │ ├── github.ts # GitHub API (source code) │ └── types.ts # Shared TypeScript types ├── registry/ # Hybrid component registry │ ├── registry.ts # Loader + search + runtime refresh │ ├── schema.ts # Zod validation schemas │ └── registry.json # Static registry (56 components, 17 blocks) ├── cache/ # Multi-layer caching │ ├── memory-cache.ts # LRU with TTL (5 min) │ ├── file-cache.ts # Versioned file cache (24h) │ └── cache-manager.ts # Orchestrator: memory → file → network ├── project/ # Project scanner │ ├── detector.ts # Angular/Nx/Tailwind/zoneless detection │ └── types.ts # SpartanProjectContext type ├── search/fuzzy.ts # fuzzysort wrapper ├── errors/errors.ts # SpartanError + 17 error codes ├── resources/spartan.ts # spartan:// URI handlers ├── prompts/workflows.ts # 5 workflow templates └── utils/ # Pure utilities ├── constants.ts # URLs, timeouts, allowed hosts ├── fetch.ts # HTTP client with SSRF protection ├── html.ts # HTML parsing + extraction └── imports.ts # TypeScript import/export extraction
Discovery (list, search) → Static Registry (instant, offline) Details (view, examples) → Memory Cache → File Cache → Analog API Source code (source, block) → Memory Cache → File Cache → GitHub API

- Static Registry(registry.json) — committed per release, zero latency
- Analog API— structured JSON from spartan.ng, cached 30min (memory) + 24h (file)
- GitHub API— TypeScript source code, cached 24h, rate-limited

- Brain— headless, logic-only primitives. Attribute selectors like[brnDialogTrigger]. Provides ARIA, keyboard handling, and focus management.
- Helm— styled wrappers usinghostDirectivesto compose Brain. Mixed selectors:[hlmBtn],hlm-dialog-content,[hlmCard],hlm-card. Uses CVA (Class Variance Authority) for variants and Tailwind for styling.

Some Helm components wrap@angular/cdkdirectly instead of Brain (DropdownMenu, ContextMenu, Menubar).

Blocksare page-level building blocks — complete Angular components combining multiple Spartan components (sidebar layouts, login forms, calendar views).

This MCP server is designed to work alongsidespartan-ng-skills— Claude Code skills that teach AI assistants how to correctly compose Spartan components.

MCPprovides the knowledge: what components exist, their APIs, source code.Skillsprovide the wisdom: how to use them correctly, composition rules, styling conventions.

# Via MCP tool spartan_install_skills(cwd="/path/to/your-angular-project") # Or manually cp -r /path/to/spartan-ng-skills/.claude /path/to/your-angular-project/

The skills include 6 rule files with correct/incorrect Angular code pairs covering:

- Brain vs Helm selection andhostDirectives
- Component composition (Dialog, Card, Tabs, forms)
- Styling withhlm(),classes(), CVA variants, semantic tokens
- Angular Reactive Forms with HlmField system
- Icon patterns withng-icon
- Angular directives: signals,@if/@for,inject(), OnPush

All settings are passed via theenvblock in your MCP configuration file (.mcp.json,.cursor/mcp.json, etc.):

{ "mcpServers": { "spartan-ng": { "command": "npx", "args": ["-y", "spartan-ng-mcp"], "env": { "GITHUB_TOKEN": "ghp_...", "SPARTAN_CACHE_TTL_HOURS": "48" } } } }
# Regenerate from live Analog API npm run generate-registry # Rebuild npm run build
npm run dev # TypeScript watch mode npm run typecheck # Type-check without emitting npm run build # Compile to dist/ npm test # Run tests npm run lint # ESLint

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Local stdio MCP server that lets AI coding agents read and maintain structured architecture, rules, and decisions directly from your repository.

Official Context7 MCP server that brings up-to-date, version-specific library documentation and code examples into AI coding prompts.

Remote, no-auth MCP server providing AI-powered codebase context and answers

MCP server that ingests project docs once and lets Claude search by meaning instead of reading everything — saving tokens on large codebases

Easily provide codebase context to Large Language Models (LLMs).

Context7 Private Docs MCP is a paid hosted remote MCP for private, version-pinned documentation context, source citations, stale-doc checks, and usage receipts for coding agents.

An intelligent system for managing programming rules, supporting search, versioning, code validation, and prompt enhancement.

Search DevExpress documentation (300,000+ help topics) using natural language queries across Angular, Blazor, WPF, WinForms, ASP.NET Core, React, Vue, and more in the AI Coding Assistant and/or IDE of your choice. Receive instant code examples, implementation guidance, and step-by-step instructions. Built-in tools and prompts guide AI coding agents to help developers build better applications faster with DevExpress components.

The official Duck Framework MCP server provides AI assistants with rich, project-aware context for building applications using Duck Framework. It offers documentation retrieval, code guidance, API references, best practices, component discovery, and framework-specific recommendations to help developers generate high-quality Duck Framework projects faster and more accurately.

GeneXus 18 MCP server for Claude, Cursor, and AI agents — read, edit, analyze KB objects (transactions, web panels, procedures, SDTs) over the Model Context Protocol.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.