npm package: @logrocket/mcp
Description: An MCP (Model Context Protocol) server that enables Claude and other MCP clients to query the LogRocket API in natural language to access information about your LogRocket sessions, metrics, issues, and more. For example, allows you to:
Author: Logrocket
Latest version: 0.4.0

# LogRocket MCP Server

An MCP (Model Context Protocol) server that enables Claude and other MCP clients to query the LogRocket API in natural language to access information about your LogRocket sessions, metrics, issues, and more. For example, allows you to:

- Pull in context about your app's behavior to help with debugging and fixing errors
- Get a better sense of how users interact with your app
- Query a user or account's sessions for targeted investigation

For more information, example usage, and suggested automations, see the [LogRocket MCP documentation](https://mcp.logrocket.com/).

## Available Tools

### `use_logrocket`

Run a natural language query against LogRocket. Chains tool calls internally to limit context usage. Offers the same functionality as Ask Galileo in the LogRocket dashboard.

**Parameters**

- `query` (optional) - The natural language query to run against LogRocket data. Required when starting a new query; omit when polling with `pollForResult`.
- `chatID` (optional) - The ID from a previous response to continue a conversation or to poll; omit to start a new conversation
- `pollForResult` (optional) - Set to `true` to poll for completion when the last response had `status: thinking`

**Example Usage**

- Debug user-reported issues: "User X reported a problem with checkout. Can you use LogRocket to watch their sessions and figure out the root cause?"
- Understand feature usage: "I'm about to work on the search feature — can you use LogRocket to help me understand how it's currently being used?"
- Triage new issues: "Can you look at LogRocket for new issues from the past week, try to figure out their root causes, and then suggest which ones I can fix?"
- Check for regressions: "Look at all commits from last week, and check LogRocket data to ensure they didn't introduce any regressions."
- Prioritize your work: "Use LogRocket to watch sessions and look at issues to figure out what is highest priority that I work on next."

## Environment Variables

| Variable              | Description                             |
| --------------------- | --------------------------------------- |
| `LOGROCKET_API_TOKEN` | API token for authentication (required) |

The API token is available at https://app.logrocket.com/r/settings/general.

## Configuration for MCP Clients

### Cursor

Add the following to your Cursor MCP configuration file (`~/.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "logrocket": {
      "command": "npx",
      "args": ["@logrocket/mcp"],
      "env": {
        "LOGROCKET_API_TOKEN": "..."
      }
    }
  }
}
```

### Claude Desktop

Add to your Claude Desktop configuration file:

```json
{
  "mcpServers": {
    "logrocket": {
      "command": "npx",
      "args": ["@logrocket/mcp"],
      "env": {
        "LOGROCKET_API_TOKEN": "..."
      }
    }
  }
}
```

### Configuration File Locations

- **Cursor**: `~/.cursor/mcp.json`
- **macOS (Claude Desktop)**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows (Claude Desktop)**: `%APPDATA%\Claude\claude_desktop_config.json`
- **Linux (Claude Desktop)**: `~/.config/Claude/claude_desktop_config.json`

## Security Notes

- Never commit your API token to version control
- Rotate tokens regularly according to your security policy
- The token should be treated as sensitive credentials

## Troubleshooting

### Token not found error

If you see an error about `LOGROCKET_API_TOKEN` not being set:

1. Verify the environment variable is set in your MCP configuration
2. Restart your MCP client after updating the configuration

### Connection errors

If you encounter connection timeouts or errors:

1. Verify you have internet connectivity
2. Check if the [API endpoint](https://api.logrocket.com/) is accessible
3. Verify your API token is valid and not expired
4. Check for any firewall or proxy restrictions