DOCS
v0.4

@cognivo/mcp-server

Model Context Protocol server that exposes the Cognivo catalog — components, tokens, patterns, and biases — to Claude Desktop, Cursor, Windsurf, and Claude Code. 12 tools for component lookup, token search, usage validation, page generation, page auditing, and bias application.

Installation

The server runs via npx, no global install required:

npx -y @cognivo/mcp-server

Or add to your project and use the local binary:

pnpm add -D @cognivo/mcp-server

Quick start

Each MCP client reads a JSON config file. Add a "cognivo" server entry and restart the client.

Client setup

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%/Claude/claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "cognivo": {
      "command": "npx",
      "args": ["-y", "@cognivo/mcp-server"]
    }
  }
}

Cursor

Edit ~/.cursor/mcp.json (or the project-local .cursor/mcp.json):

{
  "mcpServers": {
    "cognivo": {
      "command": "npx",
      "args": ["-y", "@cognivo/mcp-server"]
    }
  }
}

Windsurf

Edit ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "cognivo": {
      "command": "npx",
      "args": ["-y", "@cognivo/mcp-server"]
    }
  }
}

Claude Code

claude mcp add cognivo -- npx -y @cognivo/mcp-server

Tools

All 12 tools are registered on connect. Agents pick them based on your prompt — you don't need to invoke them explicitly.

ToolWhat it does
cognivo_list_componentsBrowse 143 components by category, wave, or keyword.
cognivo_get_componentFull API for a component — props, events, slots, CSS custom props, examples.
cognivo_find_tokensSearch the 1,800+ token catalog by name, tier, category, or component.
cognivo_get_token_forRecommended token for a CSS property with Tier 3 → 2 → 1 guidance.
cognivo_validate_usageLint HTML/CSS for raw hex, tier violations, unknown components, anti-patterns.
cognivo_get_patternFetch composition patterns for common UI scenarios.
cognivo_get_biasLook up one of 180 cognitive biases with design impact.
cognivo_suggest_biasesRecommend biases for a UI scenario (pricing, onboarding, retention).
cognivo_recommend_componentPick the right component for a chunk of content.
cognivo_generate_pageGenerate a full page (pricing / landing / dashboard / settings / chat / onboarding) deterministically.
cognivo_audit_pageAudit HTML for unknown components, missing props, a11y, and structural issues.
cognivo_apply_biasWrap a target element in a <bias-*> wrapper (anchoring, scarcity, social-proof, etc.).

Example prompts

# component discovery
"Which Cognivo component should I use to render a streaming LLM response?"

# token lookup
"What token should I use for a card background? Give me the tier-3 choice."

# validation
"Here's my CSS — is it compliant?

.foo { background: #2d2d30; }"

# page generation
"Generate a pricing page with 3 tiers using Cognivo components."

# bias application
"Wrap the middle pricing tier in an anchoring bias."

# audit
"Audit this HTML for Cognivo issues: <cg-card><cg-buttton>Bad</cg-buttton></cg-card>"

Caveats

  • Restart required. MCP clients load config at launch. Add the server, restart the client.
  • Stdio transport. The server communicates over stdin/stdout — no network ports, no auth surface.
  • Catalog is embedded. Published builds ship a pre-compiled catalog snapshot, so tool responses are deterministic and offline-friendly.
  • Page generators are rule-based. cognivo_generate_page is a template expander, not an LLM — output is deterministic and never hallucinates tag names.
  • Requires Node 20+. The MCP SDK and catalog loader use modern ESM features.