# Wix MCP

## Installation & Usage

### From npm Package

```sh
npx @wix/mcp
```

### Local Development

1. Clone the repository
2. Install dependencies
3. Build the project

Run locally with:

```sh
npx /Users/absolute/path/to/repo/dir/.
```

Or directly with Node:

```sh
node /Users/absolute/path/to/build/bin-standalone.js
```

## Configuration Options

### Tool Selection

Enable specific standard tools (all enabled by default):

```
--tools=WDS,REST,SDK,WIX_HEADLESS,BUILD_APPS
```

### Experimental Tools

Enable experimental tools (disabled by default):

```
--experimental=WIX_API,CLI_COMMAND
```

### CLI Mode

Specify CLI mode:

```
--cli=wix-one
```

### Logger

Set logging output:

- `--logger=mcp` (default, logs to MCP server)
- `--logger=file` (logs to `~/wix-mcp-log.txt`)

### Tool Reference

**Standard Tools:**
- `WDS`: Wix Design System Documentation (`SearchWixWDSDocumentation`)
- `REST`: Wix REST API Documentation (`SearchWixRESTDocumentation`)
- `SDK`: Wix SDK Documentation (`SearchWixSDKDocumentation`)
- `BUILD_APPS`: Build Apps Documentation (`SearchBuildAppsDocumentation`)
- `WIX_HEADLESS`: Wix Headless Documentation (`SearchWixHeadlessDocumentation`)

**Experimental Tools:**
- `WIX_API`: Wix API tools (`CallWixAPI`)
- `CLI_COMMAND`: CLI commands for Wix apps (`RunWixCliCommand`)

> Experimental tools are in early development and may have limited functionality or breaking changes. They must be explicitly enabled with `--experimental`.

## Resources

The resource feature provides access to Wix documentation via the MCP server:

- Fetches documentation indexes from specified Wix portals
- Makes documentation articles available as resources
- Allows fetching article content using the MCP protocol

Resources use the `wix-docs://` URI scheme, which maps to Wix Docs URLs:

- Docs URL: `https://dev.wix.com/docs/...`
- Resource URI: `wix-docs://...`

To load all docs from a portal:

```
--portals=<docs-portal-name>
```

## Cursor Integration

### MCP Docs

See: https://docs.cursor.com/context/model-context-protocol

### Configuration (`~/.cursor/mcp.json`)

#### Using npm package

```json
{
  "mcpServers": {
    "wix-local-mcp": {
      "command": "npx",
      "args": ["-y", "@wix/mcp"]
    }
  }
}
```

#### Using local build

```json
{
  "mcpServers": {
    "wix-local-mcp": {
      "command": "npx",
      "args": ["/Users/absolute/path/to/repo/dir/."]
    }
  }
}
```

#### Using Node

```json
{
  "mcpServers": {
    "wix-local-mcp": {
      "command": "node",
      "args": ["/Users/absolute/path/to/build/bin-standalone.js"]
    }
  }
}
```

## Troubleshooting

- Check logs from Claude Desktop or Cursor
- For Node/fnm/nvm errors: ensure the latest Node version is set as default
- For npx errors: use `-y` and the correct npm registry
- Try specifying the full path to Node
- Try using Bun and `index.ts` directly
- Ensure build files have appropriate permissions

### NVM Example Fix

```json
"wix-mcp-remote-prod": {
  "command": "npx",
  "args": ["-y", "@wix/mcp-remote", "https://mcp.wix.com/sse"],
  "env": {
    "PATH": "<path-to-your-nvm-node-version>/bin"
  }
}
```

### FNM Example Fix

```json
{
  "mcpServers": {
    "wix-mcp-remote-prod": {
      "command": "sh",
      "args": [
        "-c",
        "eval $(fnm env) && npx -y @wix/mcp-remote https://mcp.wix.com/sse"
      ]
    }
  }
}
```

> Node 20 is required to build.
