MCP Server

Cotton includes an MCP (Model Context Protocol) server that lets AI assistants like Claude understand and generate Cotton-compliant code.

What is MCP?

MCP is a protocol that allows AI assistants to access external tools and data sources. The Cotton MCP server provides:

Installation

npm install -g @akrade/cotton-mcp

Claude Desktop Setup

Add to your Claude Desktop config (~/.claude/claude_desktop_config.json):

{
  "mcpServers": {
    "cotton": {
      "command": "cotton-mcp",
      "args": []
    }
  }
}

Restart Claude Desktop to activate.

Available Tools

Once connected, Claude can use these tools:

Component Introspection

Design Tokens

Coding Standards

Example Usage

With the MCP server connected, you can ask Claude:

API Endpoint

The MCP server is also available as a REST API at api.withcotton.io