Spartan MCP Server

Spartan Angular UI component docs, blocks and API tables for coding assistants

Official · spartan.ng TypeScript Local · stdio Developer tools

67 popularity score ★ 3.0k ↓ 1.6k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add spartan -- npx -y @spartan-ng/mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "spartan": {
      "command": "npx",
      "args": [
        "-y",
        "@spartan-ng/mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "spartan": {
      "command": "npx",
      "args": [
        "-y",
        "@spartan-ng/mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "spartan": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@spartan-ng/mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.spartan]
command = "npx"
args = ["-y", "@spartan-ng/mcp"]
Gemini CLITerminal
gemini mcp add --scope user spartan npx -- -y @spartan-ng/mcp

Settings 3

SPARTAN_MCP_CACHE_DIR Optional: Folder for the on-disk cache; defaults to $XDG_CACHE_HOME/spartan-mcp or ~/.cache/spartan-mcp.
SPARTAN_CACHE_TTL_MS Optional: Lifetime of the in-memory fetch cache in milliseconds (default 300000).
SPARTAN_CACHE_TTL_HOURS Optional: Hours before on-disk cache entries count as stale (default 24).

What it does

@spartan-ng/mcp is the MCP server published by the spartan project, the open-source Angular UI library (spartan/ui). It gives a coding assistant current Spartan reference material, so it can answer questions about a component or write code against the real API instead of guessing from older training data.

The server reads public pages on spartan.ng when asked and returns them in a form an assistant can use: a list of components, one component's page as code examples or as structured API data split into the Brain (Brn*) and Helm (Hlm*) layers, ready-made blocks such as sidebar, login, signup and calendar layouts, and documentation topics such as installation, CLI, theming, dark mode and the update guide. It can also report which npm packages, Angular CDK pieces and peer components a component or block depends on, and summarise a component's accessibility features (ARIA, keyboard, screen reader).

Fetched pages are kept in an on-disk cache stored per Spartan version, and a set of cache tools shows, clears, rebuilds or switches that version. Further tools check that the docs site answers and build the Spartan CLI health-check command for an ng or nx workspace. Besides its 17 tools it offers four resources for direct component lookups and five prompts for common tasks such as getting started or troubleshooting.

What it needs

RuntimeNode.js

Node.js with npx (or a global npm install of the package) on the machine running the MCP client. Network access to spartan.ng, where all content is fetched from. It is only useful for projects that use, or plan to use, the spartan/ui Angular library. No account or key is needed.

Limits

It covers Spartan only: components, blocks and docs topics published on spartan.ng, not Angular itself or other UI libraries. It reads documentation and does not edit project files or run the Spartan CLI; the health-check tools only build the command for you to run. Content depends on spartan.ng being reachable; cached copies are treated as stale after 24 hours by default.

Who it suits

Suits Angular developers building with spartan/ui who want an assistant to use the current component APIs and examples, including version-specific lookups. It is official, local, needs no sign-in and only reads public docs, so it is a low-friction addition to an editor setup. Pick something else if the project does not use Spartan, or if you need a server that changes code or runs project commands. A separate community-made server for the same library, spartan-ng-mcp, is also in our directory; this one is the package the Spartan maintainers publish from their own repository.

Tools 17

spartan_components_list
Lists Spartan components with their documentation addresses
spartan_components_get
Returns one component's page, as code examples or structured API data
spartan_components_dependencies
Shows the packages, CDK parts and peer components a component relies on
spartan_accessibility_check
Summarises a component's ARIA, keyboard and screen-reader support
spartan_blocks_list
Lists the available pre-built blocks
spartan_blocks_get
Returns one block's page as HTML or plain text
spartan_blocks_dependencies
Shows which components and packages a block uses
spartan_docs_get
Returns a documentation topic, optionally only its code, headings or links
spartan_meta
Gives the names of topics, components and blocks for autocompletion
spartan_health_check
Checks whether docs and component pages on spartan.ng respond
spartan_health_instructions
Explains the Spartan CLI health-check commands
spartan_health_command
Builds the health-check command for an ng or nx workspace
spartan_cache_status
Reports the active cache version and its statistics
spartan_cache_clear
Empties the cache for the current version or all versions
spartan_cache_rebuild
Refills the cache from the live site
spartan_cache_switch_version
Changes which Spartan version the cache serves
spartan_cache_list_versions
Lists the versions held in the cache

Similar servers