# monitor

Wires your AI assistant into the BetterDB platform so you can pull Valkey and Redis metrics, dig into slow commands and hunt hot keys without leaving the editor.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 1310
- Author: BetterDB-inc
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/BetterDB-inc/monitor/tree/HEAD/packages/mcp
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/monitor

## What it does

The server runs over stdio and installs through `npx`. It exposes a set of read tools for your databases: `get_health` returns a summary of instance state, `get_slowlog` and `get_commandlog` surface slow commands, and `get_hot_keys` finds the keys skewing your load. Rounding that out are `get_memory`, `get_clients`, `get_acl_audit` and latency event history. Some tools are marked Pro.

Cloud access needs a token, generated in BetterDB under Settings → MCP Tokens. Without one the cloud endpoint will not answer. A self-hosted instance serves read tools anonymously, but writes require an admin token, and whatever that token changes lands in the activity log under its owner's name. Tokens cannot manage members or other tokens.

The instance address lives in `BETTERDB_URL` and defaults to `http://localhost:3001`. `--autostart` spawns a local monitor process, `--persist` keeps it alive after the server exits, and `--storage` picks between `sqlite` and `memory`. Point `--port` at the right port if your monitor already runs elsewhere, or the server will talk to nothing.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `BETTERDB_URL`, `BETTERDB_TOKEN`, `BETTERDB_INSTANCE_ID` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env BETTERDB_URL=<BETTERDB_URL> --env BETTERDB_TOKEN=<BETTERDB_TOKEN> --env BETTERDB_INSTANCE_ID=<BETTERDB_INSTANCE_ID> --transport stdio mcp -- npx -y @betterdb/mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add mcp --env BETTERDB_URL=<BETTERDB_URL> --env BETTERDB_TOKEN=<BETTERDB_TOKEN> --env BETTERDB_INSTANCE_ID=<BETTERDB_INSTANCE_ID> -- npx -y @betterdb/mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@betterdb/mcp"
            ],
            "env": {
                "BETTERDB_URL": "<BETTERDB_URL>",
                "BETTERDB_TOKEN": "<BETTERDB_TOKEN>",
                "BETTERDB_INSTANCE_ID": "<BETTERDB_INSTANCE_ID>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@betterdb/mcp"
            ],
            "env": {
                "BETTERDB_URL": "<BETTERDB_URL>",
                "BETTERDB_TOKEN": "<BETTERDB_TOKEN>",
                "BETTERDB_INSTANCE_ID": "<BETTERDB_INSTANCE_ID>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e BETTERDB_URL=<BETTERDB_URL> -e BETTERDB_TOKEN=<BETTERDB_TOKEN> -e BETTERDB_INSTANCE_ID=<BETTERDB_INSTANCE_ID> mcp npx -y @betterdb/mcp
```
Replace <…> with your own values

## When to use it
- check production Valkey health from inside the editor
- list the slowest commands from the past hour
- spot hot keys causing uneven load
- compare memory usage across cluster nodes
- review latency event history for one event type

## Example prompts
- What's the health of my production Valkey instance?
- Are there any hot keys causing uneven load?

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
