Betterdb Mcp
@BetterDB-inc
Betterdb Mcp について
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.
基本情報
設定
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"betterdb": {
"type": "stdio",
"command": "npx",
"args": [
"@betterdb/mcp"
],
"env": {
"BETTERDB_URL": "https://your-workspace.app.betterdb.com",
"BETTERDB_TOKEN": "your-token"
}
}
}
}ツール
21List all Valkey/Redis instances registered in BetterDB. Shows connection status and capabilities.
Select which instance subsequent tool calls operate on.
Get INFO stats for the active instance. Contains all health data: memory, clients, replication, keyspace, stats (hit rate, ops/sec), and server info. Optionally filter to a section: server|clients|memory|stats|replication|keyspace.
Get the most recent slow commands from the slowlog.
Get the most recent entries from COMMANDLOG (Valkey 8+ only, superset of slowlog).
Get latency event history for the active instance.
Get memory diagnostics: MEMORY DOCTOR assessment and MEMORY STATS breakdown.
Get the active client list with connection details.
Get a synthetic health summary for the active instance: keyspace hit rate, memory fragmentation ratio, connected clients, replication lag (replicas only), and keyspace size. Use this as the first call when investigating an instance — it surfaces the most actionable signals without requiring you to parse raw INFO output.
Get analyzed slowlog patterns from persisted storage. Groups slow commands by normalized pattern, showing frequency, average duration, and example commands. Survives slowlog buffer rotation — data goes back as far as BetterDB has been running.
Get persisted COMMANDLOG entries from storage (Valkey 8+ only). Supports time range filtering to investigate specific incidents. Returns empty with a note if COMMANDLOG is not supported on this instance.
Get analyzed COMMANDLOG patterns from persisted storage (Valkey 8+ only). Like get_slowlog_patterns but includes large-request and large-reply patterns in addition to slow commands.
Get anomaly detection events from persisted storage. BetterDB continuously runs Z-score analysis on memory, hit rate, CPU, and other metrics — this returns the detected anomalies. Use to investigate what triggered an alert or correlate with an incident.
Get time-bucketed client activity from persisted snapshots. Shows connection counts, command distribution, and buffer usage over time. Use startTime/endTime to focus on a specific incident window.
Get hot key tracking data from persisted storage. BetterDB periodically scans keys using LFU frequency scores (when maxmemory-policy is an LFU variant) or OBJECT IDLETIME / COMMANDLOG-derived frequency. Each snapshot captures the top keys ranked by access frequency. Use this to find cache-busting keys, uneven access patterns, or keys that dominate throughput. The signalType field in each entry indicates which detection mode was active (lfu or idletime).
Discover all nodes in the Valkey cluster — role (master/replica), address, health status, and slot ranges. Returns an error message if this instance is not running in cluster mode.
Get per-node performance stats: memory usage, ops/sec, connected clients, replication offset, and CPU. Use this to identify hot nodes, lagging replicas, or uneven load distribution.
Get the aggregated slowlog across ALL nodes in the cluster. This is the primary tool for finding slow commands in cluster mode — per-node slowlogs are incomplete. Returns an error message if not in cluster mode.
Get per-slot key counts and CPU usage (Valkey 8.0+ only). Use orderBy='cpu-usec' to find hot slots, or 'key-count' to find the most populated slots. Returns an error message if not supported.
Get the full latency history for a named event (e.g. 'command', 'fast-command'). Call get_latency first to see which event names are available, then use this to investigate a specific event's trend over time.
Get persisted ACL audit log entries from storage. Filter by username, reason (auth, command, key, channel), or time range. Use this to investigate why a connection is failing or audit access patterns.
概要
What is Betterdb Mcp?
Betterdb Mcp connects AI assistants like Claude Code, Cursor, and Windsurf to the BetterDB monitoring platform for Valkey and Redis databases. It lets your AI query real-time metrics, diagnose slow commands, detect anomalies, and investigate incidents without leaving your editor.
How to use Betterdb Mcp?
Generate an MCP token in BetterDB (Settings → MCP Tokens), then add the server to your MCP client config using npx @betterdb/mcp with the BETTERDB_URL and BETTERDB_TOKEN environment variables. Once connected, ask natural-language questions about your database health, slow commands, hot keys, and anomalies.
Key features of Betterdb Mcp
- Real-time health checks for memory, hit rate, and replication lag
- Slow command analysis with pattern aggregation
- Hot key detection via LFU or idle time analysis
- Cluster-wide visibility across all nodes
- Anomaly detection using Z-score analysis (Pro)
- Latency event history and ACL audit logs
Use cases of Betterdb Mcp
- Check production Valkey or Redis instance health from your editor
- Investigate the slowest commands from the last hour
- Find hot keys causing uneven cluster load
- Review anomaly detection events over the past 24 hours
- Audit ACL failures and access patterns
FAQ from Betterdb Mcp
How is Betterdb Mcp different from live-snapshot tools?
BetterDB persists historical metrics, slowlogs, and audit trails, so you can investigate what happened yesterday — not just what's happening now.
What are the runtime requirements?
Node.js 20+ and a running BetterDB instance (cloud or self-hosted).
How do I configure the server?
Set BETTERDB_URL (default http://localhost:3001) and optionally BETTERDB_TOKEN and BETTERDB_INSTANCE_ID as environment variables.
What instances can I query?
Any Valkey or Redis instances registered in your BetterDB workspace. Use list_instances and select_instance tools to choose one.
What transport does the server use?
It uses stdio transport via the npx @betterdb/mcp command.
「その他」の他のコンテンツ
Reactive Resume
amruthpillaiA one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
Awesome-MCP-ZH
yzflyMCP 资源精选, MCP指南,Claude MCP,MCP Servers, MCP Clients
Awesome Mlops
visengerA curated list of references for MLOps
AutoBrowser MCP
autobrowser-aiBrowser MCP is a Model Context Provider (MCP) server that allows AI applications to control your browser
🚀 Model Context Protocol (MCP) Curriculum for Beginners
microsoftThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable,
コメント