Sponsored by Deepsite.site

Betterdb Mcp

Created By
BetterDB-inc8 days ago
MCP server for Valkey and Redis observability. Query real-time health, slow commands, hot keys, anomaly detection, and cluster analytics directly from your AI assistant.
Overview

@betterdb/mcp

Give your AI assistant deep visibility into your Valkey and Redis databases. The BetterDB MCP server connects Claude Code, Cursor, Windsurf, and other MCP-compatible clients to the BetterDB monitoring platform — letting your AI query real-time metrics, diagnose slow commands, detect anomalies, and investigate incidents without leaving your editor.

Why BetterDB?

BetterDB is a monitoring and observability platform built for Valkey and Redis providing real-time dashboards, anomaly detection, and operational intelligence for your Valkey and Redis deployments. Unlike tools that only show a live snapshot, BetterDB persists historical metrics, slowlogs, and audit trails — so you can investigate what happened yesterday, not just what's happening now.

Key capabilities exposed through MCP:

  • Real-time health checks — memory fragmentation, hit rate, replication lag, connected clients
  • Slow command analysis — slowlog and COMMANDLOG (Valkey 8+) with pattern aggregation
  • Hot key detection — find cache-busting keys via LFU frequency scores or idle time analysis
  • Cluster-wide visibility — per-node stats, aggregated slowlogs, and slot-level metrics across all nodes
  • Anomaly detection — Z-score analysis on memory, CPU, hit rate, and other metrics (Pro)
  • Client activity tracking — connection counts, command distribution, and buffer usage over time
  • ACL audit log — investigate auth failures and access patterns
  • Latency event history — track latency trends for specific event types

Quick Start

1. Get a token

In BetterDB, go to Settings → MCP Tokens and generate a new token.

2. Configure your MCP client

Add to your MCP client config (e.g. Claude Code or OpenAI Codex):

{
  "mcpServers": {
    "betterdb": {
      "type": "stdio",
      "command": "npx",
      "args": ["@betterdb/mcp"],
      "env": {
        "BETTERDB_URL": "https://<your-workspace>.app.betterdb.com",
        "BETTERDB_TOKEN": "<your-token>"
      }
    }
  }
}

For local development (token not required):

{
  "mcpServers": {
    "betterdb": {
      "type": "stdio",
      "command": "npx",
      "args": ["@betterdb/mcp"],
      "env": {
        "BETTERDB_URL": "http://localhost:3001"
      }
    }
  }
}

3. Start asking questions

Once connected, your AI assistant can query your databases directly:

  • "What's the health of my production Valkey instance?"
  • "Show me the slowest commands from the last hour"
  • "Are there any hot keys causing uneven load?"
  • "Which cluster node has the highest memory usage?"
  • "Have there been any anomalies in the last 24 hours?"

Configuration

Environment VariableDefaultDescription
BETTERDB_URLhttp://localhost:3001BetterDB instance URL (port depends on your Docker config)
BETTERDB_TOKENMCP token from Settings (required for cloud, optional for local)
BETTERDB_INSTANCE_IDPre-select a specific instance (skips select_instance)

Available Tools

ToolDescription
list_instancesList all registered Valkey/Redis instances with connection status
select_instanceSelect which instance subsequent calls operate on
get_healthSynthetic health summary — the best starting point for any investigation
get_infoFull INFO stats, optionally filtered by section
get_slowlogRecent slow commands from the slowlog buffer
get_commandlogRecent COMMANDLOG entries (Valkey 8+)
get_latencyLatency event history
get_latency_historyDetailed history for a specific latency event
get_memoryMEMORY DOCTOR assessment and MEMORY STATS breakdown
get_clientsActive client list with connection details
get_hot_keysHot key tracking data from LFU or idle time analysis
get_slowlog_patternsAggregated slowlog patterns with frequency and avg duration
get_commandlog_historyPersisted COMMANDLOG entries with time range filtering
get_commandlog_patternsAggregated COMMANDLOG patterns
get_anomaliesAnomaly detection events (Pro)
get_client_activityTime-bucketed client activity from persisted snapshots
get_acl_auditACL audit log entries
get_cluster_nodesCluster node discovery — roles, health, slot ranges
get_cluster_node_statsPer-node performance stats across the cluster
get_cluster_slowlogAggregated slowlog across all cluster nodes
get_slot_statsPer-slot key counts and CPU usage (Valkey 8+)

Requirements

  • Node.js 20+
  • A running BetterDB instance (cloud or self-hosted)

Documentation

Full docs: docs.betterdb.com

License

See LICENSE for details.

Server Config

{
  "mcpServers": {
    "betterdb": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@betterdb/mcp"
      ],
      "env": {
        "BETTERDB_URL": "https://your-workspace.app.betterdb.com",
        "BETTERDB_TOKEN": "your-token"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Tavily Mcp
Playwright McpPlaywright MCP server
WindsurfThe new purpose-built IDE to harness magic
Serper MCP ServerA Serper MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Amap Maps高德地图官方 MCP Server
CursorThe AI Code Editor
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop
ChatWiseThe second fastest AI chatbot™