# CLI MCP server
> Use the local Snowplow CLI MCP server to work with the tracking plan files on your disk through AI assistants.
> Source: https://docs.snowplow.io/docs/ai/cli-mcp-server/
> Documentation index: https://docs.snowplow.io/llms.txt

The [Snowplow CLI](/docs/api-reference/snowplow-cli/) includes a local Model Context Protocol (MCP) server that enables natural language interaction with AI assistants for creating, validating, and managing your Snowplow tracking plans. This allows you to:

- Create and validate data structures through conversation
- Analyze tracking requirements and suggest implementations
- Validate tracking plans and source applications

> **Info: Read more**
>
> For a step-by-step guide to using the Snowplow CLI MCP server, see the [MCP tutorial](/tutorials/snowplow-cli-mcp/introduction/).

The MCP server allows AI assistants to interact with the Snowplow CLI using the `snowplow-cli mcp` command.

> **Note: Snowplow MCP server**
>
> This server works on tracking plan files on your machine. To work with your Snowplow Console account, including pipelines, failed events, enrichments, and Signals, directly from your codebase, install the [Snowplow MCP server](/docs/ai/snowplow-mcp/) and the Snowplow [skills](/docs/ai/skills/) in your coding agent with `npx plugins add snowplow/skills`.

## Install the MCP server

The MCP server is included with [Snowplow CLI](/docs/api-reference/snowplow-cli/). Start by installing the CLI and authenticating to your Snowplow account.

To connect your AI client to the MCP server, provide a configuration object. The exact structure depends which client you are using, and whether you're connecting to the Snowplow CLI installed locally or via npx. For example:

**Claude Desktop:**

Add the following to your Claude Desktop configuration file, found at:

- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`

For direct Snowplow CLI connection:

```json
{
  "mcpServers": {
    "snowplow-cli": {
      "command": "snowplow-cli",
      "args": ["mcp"]
    }
  }
}
```

Using npx:

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

> **Note: Filesystem access**
>
> Claude Desktop requires additional filesystem access to create and modify files.

**VS Code:**

Add to `.vscode/mcp.json` in your workspace.

For direct Snowplow CLI connection:

```json
{
  "servers": {
    "snowplow-cli": {
      "type": "stdio",
      "command": "snowplow-cli",
      "args": ["mcp"]
    }
  }
}
```

Using npx:

```json
{
  "servers": {
    "snowplow-cli": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@snowplow/snowplow-cli", "mcp"]
    }
  }
}
```

**Cursor:**

Add to `.cursor/mcp.json` in your workspace:

```json
{
  "mcpServers": {
    "snowplow-cli": {
      "command": "snowplow-cli",
      "args": ["mcp", "--base-directory", "."]
    }
  }
}
```

***

After adding the configuration, restart the client. The Snowplow CLI MCP tools should be available for use.

## Provided tools

The Snowplow CLI MCP server provides these tools to your AI assistant:

- `get_context`: to call at the start of each conversation, this tool retrieves the underlying Snowplow rules that define how Snowplow components should be structured
- `get_uuid`: generates valid v4 UUIDs that are required by many Snowplow components
- `validate_data_structures`: the assistant will use this validation tool after creating or modifying any data structure.
- `validate_data_products`: the assistant will use this validation tool after creating or modifying any tracking plan or source application file

The `get_context` tool is the only one you might need to call manually.

## Using the tools

To get AI support with your Snowplow tracking plans, start a new conversation and ask the assistant to call `get_context`. It might call this tool automatically if it realises it needs the Snowplow knowledge.

You can then ask it for help. It has access to your existing data structures, tracking plans, or source application definitions. The assistant will automatically validate any file changes using the included validation tools.

Use the standard [Snowplow CLI commands](/docs/api-reference/snowplow-cli/reference/) to publish your changes to [Console](https://console.snowplowanalytics.com) when ready, using the standard Snowplow CLI commands such as `snowplow-cli ds publish`.

> **Note: Publish separately**
>
> The MCP server creates and validates files on your local filesystem only.
