> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ghostlyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server

> Connect AI coding assistants to your GhostlyX analytics data using the Model Context Protocol.

## What is the GhostlyX MCP server?

GhostlyX exposes a Model Context Protocol (MCP) server that allows AI coding assistants and agents to query your analytics data directly. Instead of copying numbers from the dashboard into a prompt, your AI assistant can retrieve live data on demand.

**MCP server URL:** `https://ghostlyx.com/mcp`

## Authentication

The MCP server uses API token authentication. Create a token in **Settings > API Tokens > Create token**. Tokens are read-only and have access to analytics data for all sites on your account.

See [API tokens](/developer/api-tokens) for full instructions.

## Compatible clients

* Claude Desktop
* Cursor
* Windsurf
* Any MCP-compatible client

## Available tools

| Tool                       | Description                                                                        |
| -------------------------- | ---------------------------------------------------------------------------------- |
| `get_site_stats`           | Summary metrics (visitors, pageviews, bounce rate, duration) for a site and period |
| `get_top_pages`            | Top pages by pageviews with visitor counts                                         |
| `get_traffic_sources`      | Top referrers and traffic sources                                                  |
| `get_realtime_visitors`    | Current active visitors (last 5 minutes)                                           |
| `list_goals`               | All goals with completion counts and conversion rates                              |
| `get_funnel_stats`         | Step-by-step funnel conversion data                                                |
| `get_session_replay_stats` | Recording counts and UX signal summary                                             |
| `get_uptime_status`        | Current uptime status, response time, and 30-day uptime percentage                 |
| `manage_annotations`       | List or create annotations on the trend chart                                      |

## Configuration: Claude Desktop

Add the following to your `claude_desktop_config.json`:

```json theme={"dark"}
{
  "mcpServers": {
    "ghostlyx": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://ghostlyx.com/mcp"],
      "env": { "API_TOKEN": "your-token-here" }
    }
  }
}
```

Replace `your-token-here` with the API token you created in GhostlyX.

## Configuration: Cursor and Windsurf

Add the same JSON block to your MCP configuration file for those clients. Refer to the Cursor or Windsurf documentation for the exact file location.
