# `mix mishka.mcp.server`
[🔗](https://github.com/mishka-group/mishka_chelekom/blob/v0.0.9/lib/mix/tasks/mishka.mcp.server.ex#L1)

Starts the Mishka Chelekom MCP Server.

The server provides an MCP (Model Context Protocol) interface for AI tools
like Claude Code, Cursor, and Claude Desktop to interact with the
Mishka Chelekom component library.

## Usage

    # HTTP transport (default) — long-running server on port 4003
    mix mishka.mcp.server

    # Stdio transport — MCP client spawns this process and talks over stdin/stdout
    mix mishka.mcp.server --transport stdio

## Options

* `--transport` or `-t` - Transport to use: `http` (default) or `stdio`
* `--port` or `-p` - HTTP port to listen on (default: 4003, http transport only)

## Transports

### HTTP (default)

Starts a Bandit HTTP listener that AI tools connect to over the network.
Suitable for running as a background service.

    mix mishka.mcp.server
    mix mishka.mcp.server --port 5000

### Stdio

Speaks the MCP stdio protocol over stdin/stdout. The MCP client (e.g.
Claude Code) spawns this command itself — no separate server needed.
This is the zero-setup option for project-local `.mcp.json` files
shared via version control.

    mix mishka.mcp.server --transport stdio

> Stdio mode prints nothing to stdout (stdout is the protocol channel).
> All logs are redirected to stderr by the transport.

## Connecting AI Tools

### Claude Code (HTTP)

    claude mcp add --transport http mishka-chelekom http://localhost:4003/mcp

### Claude Code (Stdio)

    claude mcp add --transport stdio mishka-chelekom \
      --env MIX_QUIET=1 -- mix mishka.mcp.server --transport stdio

### Cursor / VSCode (HTTP) — create `.mcp.json` in project root:

    {
      "mcpServers": {
        "mishka-chelekom": {
          "type": "http",
          "url": "http://localhost:4003/mcp"
        }
      }
    }

### Cursor / VSCode (Stdio) — create `.mcp.json` in project root:

    {
      "mcpServers": {
        "mishka-chelekom": {
          "type": "stdio",
          "command": "mix",
          "args": ["mishka.mcp.server", "--transport", "stdio"],
          "env": {"MIX_QUIET": "1"}
        }
      }
    }

> `MIX_QUIET=1` keeps Mix's `Compiling …` messages off stdout when a
> rebuild happens, so the MCP handshake stays clean on first run.

## Available Tools (11)

- `generate_component` - Generate mix command for a single component
- `generate_components` - Generate mix command for multiple components
- `get_component_info` - Get component configuration options (variants, colors, sizes)
- `get_example` - Get HEEx code examples with usage patterns
- `get_js_hook_info` - Get JavaScript hook documentation
- `get_mix_task_info` - Get mix task documentation
- `search_components` - Search components by name or functionality
- `uninstall_component` - Generate uninstall command
- `update_config` - Update project configuration settings
- `validate_config` - Validate configuration file for errors
- `get_docs` - Fetch documentation from mishka.tools

## Available Resources (9)

- `list_components` - List all available components with categories
- `list_colors` - List color variants with CSS variables
- `list_variants` - List style variants (default, outline, shadow, etc.)
- `list_sizes` - List size options (small, medium, large, etc.)
- `list_spaces` - List spacing options
- `list_scripts` - List JavaScript hooks (Carousel, Clipboard, etc.)
- `list_dependencies` - List component dependencies
- `list_css_variables` - List all CSS custom properties
- `get_config` - Get current project configuration

# `parse_args`

Parses task argv into a transport selection.

Returns:
  * `{:ok, {:http, port}}` — default, HTTP transport on `port` (default 4003)
  * `{:ok, :stdio}` — stdio transport
  * `{:error, message}` — unknown `--transport` value

Public so it can be unit-tested without running the (blocking) task.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
