Skip to main content
Glama

@betterdb/mcp

npm version total downloads license: MIT types GitHub stars

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.

See it live in BetterDB Monitor

BetterDB Monitor gives you live dashboards for the AI workloads running on your Valkey:

  • AI Cache & Memory - hit rate, cost saved, evictions, and index size across all your caches and memory stores, with history.

  • AI Traces - OpenTelemetry waterfalls for each request, correlated with live Valkey state to explain every cache hit and miss.

AI Cache & Memory tab in BetterDB Monitor

AI Traces waterfall in BetterDB Monitor

Run it self-hosted (docker run -p 3001:3001 betterdb/monitor), or use BetterDB Cloud - which can also provision a managed, TLS-enabled Valkey instance (Search module included) in one click.

Related MCP server: infrawise

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

In Claude Code, install the BetterDB plugin and enter your URL and token when prompted:

claude plugin marketplace add https://raw.githubusercontent.com/BetterDB-inc/monitor/master/.claude-plugin/marketplace.json
claude plugin install betterdb@betterdb

For other clients such as OpenAI Codex, or to configure Claude Code by hand, add to your MCP client config:

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

For local development with an existing monitor (token not required):

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

For zero-config local development (auto-starts and manages a monitor process):

{
  "mcpServers": {
    "betterdb": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@betterdb/mcp@1.6.0", "--autostart", "--persist"]
    }
  }
}

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?"

  • "Tune the threshold on my faq-cache — propose a change for me to review"

  • "Why is the weather_lookup tool's hit rate so low?"

Skills

Clients that load skills from a plugin (Connect Apps and other skill-aware clients) pick these up from skills/<name>/SKILL.md. They are playbooks for the tools above: which call to make, which arguments a time window needs, and how to read a license sentence or an empty list.

Skill

Use when

betterdb-triage

"Is this instance healthy?" or any question before an instance is selected

betterdb-slow-commands

Slowest commands in a time window

betterdb-hot-keys

Hot keys or uneven key access

betterdb-memory

Fragmentation, MEMORY DOCTOR, or time to the memory ceiling

betterdb-latency

What is slow, fork time, or a latency regression

betterdb-durability

What a crash would lose, last save, replicas, or cluster vs standalone

betterdb-cache-miss

Cache hit rate, a trace, or vector index health

Configuration

Environment Variables

Variable

Default

Description

BETTERDB_URL

http://localhost:3001

BetterDB instance URL (port depends on your Docker config)

BETTERDB_TOKEN

—

MCP token from Settings → MCP Tokens. Required for cloud. Optional for self-hosted: without it, read tools work anonymously; with it, calls act as the token's owner (write tools need an admin's token) and changes they make are recorded under the owner's name in the activity log. Tokens cannot manage members or other tokens

BETTERDB_LOCAL_TOKEN

—

Token for a monitor started with --autostart or start_monitor when BETTERDB_URL is set to a different monitor. Without it, that monitor gets no token. BETTERDB_TOKEN is used when BETTERDB_URL is unset or points at the started monitor

BETTERDB_INSTANCE_ID

—

Pre-select a specific instance (skips select_instance)

BETTERDB_TELEMETRY

on

Set to false, 0, no or off to turn off telemetry: the MCP server's tool usage events, and a monitor started with --autostart or start_monitor. Usage events (tool name, success, duration, up to 200 characters of error text) go to the monitor the call was made against, which relays them to BetterDB when its own telemetry is on

BETTERDB_MCP_TELEMETRY

—

Same values as BETTERDB_TELEMETRY, for the MCP server's usage events only. Usage events are off if either variable is off; neither turns them back on

BETTERDB_MONITOR_<NAME>

—

Passed to a monitor started with --autostart or start_monitor as <NAME>, overriding the inherited value. PORT and STORAGE_TYPE come from --port and --storage instead

CLI Arguments

Argument

Default

Description

--autostart

—

Spawn and manage a local BetterDB monitor process on startup. It inherits the MCP server's environment, except BETTERDB_URL, BETTERDB_TOKEN, BETTERDB_LOCAL_TOKEN, BETTERDB_INSTANCE_ID and BETTERDB_MCP_TELEMETRY

--no-monitor-tools

—

Do not register start_monitor and stop_monitor

--persist

—

Keep the monitor running after the MCP server exits (requires --autostart)

--port <number>

3001

Port for the auto-started monitor API

--storage <type>

sqlite

Storage backend: sqlite or memory

--stop

—

Stop a previously persisted monitor process and exit

Available Tools

Instance Tools

Tool

Description

list_instances

List all registered Valkey/Redis instances with connection status

select_instance

Select which instance subsequent calls operate on

get_health

Synthetic health summary — the best starting point for any investigation

get_info

Full INFO stats, optionally filtered by section

get_slowlog

Recent slow commands from the slowlog buffer

get_commandlog

Recent COMMANDLOG entries (Valkey 8+)

get_latency

Latency event history

get_latency_history

Detailed history for a specific latency event

get_memory

MEMORY DOCTOR assessment and MEMORY STATS breakdown

get_clients

Active client list with connection details

get_hot_keys

Hot key tracking data from LFU or idle time analysis

get_slowlog_patterns

Aggregated slowlog patterns with frequency and avg duration

get_commandlog_history

Persisted COMMANDLOG entries with time range filtering

get_commandlog_patterns

Aggregated COMMANDLOG patterns

get_anomalies

Anomaly detection events (Pro)

get_retry_amplification

Live retry-amplification state, last episode and top clients (Pro)

get_hot_shards

Open hot shards on a cluster with their top slots, hot keys and a suggested slot rebalance, or the reason none is suggested (Pro)

get_topology_disagreements

Where the nodes of a cluster disagree about slot owners, config epochs, failure flags or membership, with the number of views on each side and one line per shard (Pro)

get_client_activity

Time-bucketed client activity from persisted snapshots

get_acl_audit

ACL audit log entries

get_cluster_nodes

Cluster node discovery — roles, state (healthy, suspect or failed), slot ranges, whether the monitor collects each node, plus availability zone and shard id on Valkey 9.1+ (older versions: the zone from the connection's zone map)

get_cluster_node_stats

Per-node performance stats across the cluster

get_cluster_slowlog

Aggregated slowlog across all cluster nodes

get_slot_stats

Per-slot key counts and CPU usage (Valkey 8+)

Analytics Tools

Tool

Description

get_forecast

Capacity forecast for a metric (opsPerSec, usedMemory, cpuTotal, memFragmentation) with projected time to ceiling

get_latency_regressions

Detected sustained p99 latency regressions vs baseline from the anomaly store (Pro)

get_replication_divergence

Per-replica offset gap series and divergence events for a primary (Pro)

get_largest_keys

Largest keys by measured memory usage from key analytics snapshots (Pro)

get_incident_timeline

Anomaly incidents as ordered timelines with matched sequence patterns and recovery status (Pro)

Vector Search Tools

For deployments running the Search module (valkey-search / RediSearch).

Tool

Description

get_vector_indexes

Per-index health: document count, memory usage, indexing failures, and percent indexed

get_inference_latency

FT.SEARCH p50/p95/p99 per vector index plus SLA breach status (SLA fields require Pro)

AI Observability Tools

For AI components (semantic caches, agent caches, agent-memory stores, retrieval pipelines) and traces ingested via OpenTelemetry.

Tool

Description

ai_list_instances

Superset discovery view of all AI component instances with liveness and latest metrics sample

ai_instance_history

Stored metrics time-series for one AI component instance (hit rate, cost saved, evictions, threshold, …)

list_ai_traces

List recent AI application traces (LLM calls, cache lookups, memory recalls, retrieval spans)

get_ai_trace

Full span waterfall for one trace with timing, parent relationships, and attributes

correlate_ai_trace

Join a trace's cache/memory spans with live Valkey state to explain misses or stale recalls

Connection Management Tools

Tool

Description

add_connection

Add a new Valkey/Redis connection to BetterDB

test_connection

Test connection credentials without persisting

remove_connection

Remove a connection from BetterDB

set_default_connection

Set a connection as the active default

Monitor Lifecycle Tools

Registered unless --no-monitor-tools is set. start_monitor runs npx --yes @betterdb/monitor as a background process and switches the session to it. The token for a monitor the server switches to (with --autostart or start_monitor) is BETTERDB_TOKEN when BETTERDB_URL is unset or points at that monitor (localhost, 127.0.0.1 and ::1 count as the same host), and BETTERDB_LOCAL_TOKEN otherwise. The selected instance follows the same rule with BETTERDB_INSTANCE_ID. stop_monitor switches back to the previous monitor, token and instance.

Tool

Description

start_monitor

Start a persistent BetterDB monitor background process

stop_monitor

Stop a previously started persistent monitor process

Cache Intelligence Tools

For deployments running @betterdb/semantic-cache or @betterdb/agent-cache. Caches register themselves in a Valkey-side discovery hash; Monitor exposes them through the tools below.

Read-only:

Tool

Description

cache_list

List all caches registered for the active instance with hit rate and total ops

cache_health

Detailed health for one cache; response branches on cache_type (semantic_cache vs agent_cache)

cache_threshold_recommendation

Threshold-tuning recommendation for a semantic_cache, derived from the rolling similarity window

cache_tool_effectiveness

Per-tool hit rate, cost saved, and TTL recommendation for an agent_cache

cache_similarity_distribution

Histogram of recent similarity scores for a semantic_cache (20 buckets, width 0.1)

cache_recent_changes

Recent proposals (any status) for a single cache, so agents can avoid re-proposing

Propose changes (advisory — no Valkey writes until approved):

Tool

Description

cache_propose_threshold_adjust

Propose a similarity-threshold change on a semantic_cache (per-category or global)

cache_propose_tool_ttl_adjust

Propose a per-tool TTL change on an agent_cache

cache_propose_invalidate

Propose an invalidation; filter shape branches on cache type

Approve / reject / list:

Tool

Description

cache_list_pending_proposals

List pending proposals on the active instance, optionally filtered by cache_name

cache_get_proposal

Fetch a single proposal by id, including its audit trail

cache_approve_proposal

Approve a pending proposal; synchronously applies the change to Valkey

cache_reject_proposal

Reject a pending proposal with an optional reason

cache_edit_and_approve_proposal

Edit a proposal's value (threshold or TTL) and approve in one step; invalidate proposals are not editable

Requirements

  • Node.js 20+

  • A running BetterDB instance (cloud or self-hosted), or use --autostart to have the MCP server manage one automatically

Documentation

Full docs: docs.betterdb.com

License

See LICENSE for details.

Available Tools

64 tools
add_connectionB

Add a new Valkey/Redis connection to BetterDB. Optionally set it as the active default.

Inputs: host (required), name (required), port, password, +2 more.

ai_instance_historyA

Get the stored metrics time-series for one AI component instance (hits, misses, hit rate, cost saved, evictions, item count, index size, threshold). Use ai_list_instances first to find the instance field identifier. Use this to see trends: hit-rate degradation, growth, threshold drift.

Inputs: field (required), hours, instanceId.

ai_list_instancesA

List AI component instances (semantic caches, agent caches, agent memory stores, retrieval pipelines) auto-discovered on the connected Valkey/Redis instance, with liveness and the latest stored metrics sample. This is the superset discovery view across all AI components — use cache_list for cache-specific live stats and memory_stores for memory-store details. Use the returned instance field value as the field parameter of ai_instance_history.

Inputs: instanceId.

cache_approve_proposalA

Approve a pending proposal. Synchronously applies the change to Valkey and returns the terminal status (applied|failed). Idempotent: a second call on an already-applied proposal returns the cached result.

Inputs: proposal_id (required), actor.

cache_edit_and_approve_proposalA

Edit an existing pending proposal and approve it in one step. Provide exactly one edit field matching the proposal type: new_threshold for threshold_adjust, new_ttl_seconds for tool_ttl_adjust. Invalidate proposals are not editable.

Inputs: proposal_id (required), actor, new_threshold, new_ttl_seconds.

cache_get_proposalA

Fetch a single cache proposal by id, including its audit trail.

Inputs: proposal_id (required).

cache_healthA

Detailed health for a single cache. Response branches by type: semantic_cache reports category_breakdown + uncertain_hit_rate; agent_cache reports tool_breakdown.

Inputs: cache_name (required), instanceId.

cache_listA

List all caches (semantic_cache and agent_cache) registered for the active instance, with hit rate and total ops.

Inputs: instanceId.

cache_list_pending_proposalsA

List pending cache proposals for the active instance, newest first. Optionally filter by cache_name.

Inputs: limit, cache_name, instanceId.

cache_propose_invalidateA

Propose a cache invalidation for review. Filter shape depends on cache type: semantic_cache requires filter_kind=valkey_search + filter_expression; agent_cache requires filter_kind in (tool|key_prefix|session) + filter_value. Warns when estimated_affected exceeds 10000.

Inputs: reasoning (required), cache_name (required), filter_kind (required), estimated_affected (required), +3 more.

cache_propose_threshold_adjustA

Propose a semantic-cache similarity-threshold change for review. Creates a pending proposal that requires human approval before any change is applied. Reasoning must be at least 20 characters.

Inputs: reasoning (required), cache_name (required), new_threshold (required), category, +1 more.

cache_propose_tool_ttl_adjustA

Propose an agent-cache per-tool TTL change for review. Creates a pending proposal that requires human approval. Reasoning must be at least 20 characters.

Inputs: reasoning (required), tool_name (required), cache_name (required), new_ttl_seconds (required), +1 more.

cache_recent_changesA

Recent proposals for a single cache (any status), so agents can avoid re-proposing pending or recently-applied changes. Newest first.

Inputs: cache_name (required), limit, instanceId.

cache_reject_proposalA

Reject a pending proposal. Optionally records a reason in the audit trail.

Inputs: proposal_id (required), actor, reason.

cache_similarity_distributionA

Histogram of recent similarity scores (20 buckets, width 0.1) for a semantic_cache. Errors on agent_cache.

Inputs: cache_name (required), category, instanceId, window_hours.

cache_threshold_recommendationA

Threshold-tuning recommendation for a semantic_cache, based on the rolling similarity-score window. Errors with INVALID_CACHE_TYPE on agent_cache.

Inputs: cache_name (required), category, instanceId, minSamples.

cache_tool_effectivenessB

Per-tool hit rate, cost saved, and TTL recommendation for an agent_cache. Errors with INVALID_CACHE_TYPE on semantic_cache.

Inputs: cache_name (required), instanceId.

correlate_ai_traceA

Explain WHY a trace behaved the way it did by joining its cache/memory spans with live Valkey state: does the key still exist, what is its TTL, what threshold was active, what is the index state. The strongest tool for diagnosing unexpected cache misses or stale memory recalls. Requires a selected instance (the one the AI components run on).

Inputs: traceId (required), instanceId.

get_acl_auditA

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.

Inputs: limit, reason, endTime, username, +2 more.

get_ai_traceA

Get the full span waterfall for one AI trace: every span with timing, parent relationships, and attributes (model, cache hit/miss, similarity scores). Use list_ai_traces to find trace IDs.

Inputs: traceId (required).

get_anomaliesA

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. On a cluster an event that is about one node names it in node (nodeId, address, role, plus shardId and availabilityZone when known, and collected: false when no connection of the monitor points at that node, so its own metrics are not gathered; connectionId names the connection that collects it). Use to investigate what triggered an alert or correlate with an incident.

Inputs: limit, startTime, instanceId, metricType.

get_client_activityA

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.

Inputs: endTime, startTime, instanceId, bucketSizeMinutes.

get_clientsC

Get the active client list with connection details.

Inputs: instanceId.

get_cluster_nodesA

Discover all nodes in the Valkey cluster — role (master/replica), address, state, and slot ranges. Each node has a state: failed when its peers agreed it is down (the fail flag), suspect when they only suspect it (fail?, PFAIL) or it is not a full member yet (handshake, noaddr), and healthy otherwise. The healthy boolean is deprecated: it is true only when state is healthy, use state instead. On Valkey 9.1+ each node also carries shardId, and availabilityZone when the node has one configured. On older versions availabilityZone comes from the zone map set on the connection, if any. collected is true when a connection of the monitor points at the node (its address or announced hostname) and is not known to read another node there, or the node is the one this instance reads; connectionId then names that connection. A node that is not collected has no connection of its own: its slow log, client list and stored metrics are not gathered. Cluster-wide checks can still raise events about it. Returns an error message if this instance is not running in cluster mode.

Inputs: instanceId.

get_cluster_node_statsA

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.

Inputs: instanceId.

get_cluster_slowlogA

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.

Inputs: limit, instanceId.

get_commandlogA

Get the most recent entries from COMMANDLOG (Valkey 8+ only, superset of slowlog).

Inputs: count, instanceId.

get_commandlog_historyA

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.

Inputs: limit, command, endTime, startTime, +2 more.

get_commandlog_patternsA

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.

Inputs: limit, endTime, startTime, instanceId.

get_forecastA

Get a capacity forecast for one metric: current trajectory and projected time until the resource ceiling is hit. Metric kinds: opsPerSec, usedMemory, cpuTotal, memFragmentation. Use for capacity planning ("when does memory run out at current growth?").

Inputs: metricKind (required), instanceId.

get_healthA

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.

Inputs: instanceId.

get_hot_keysA

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).

Inputs: limit, endTime, startTime, instanceId.

get_hot_shardsA

Get the hot shards open on a cluster right now: each shard that has carried at least twice the median CPU for a minute, with its load, top slots, hot keys when they can be read, and a rebalance suggestion. Each hot shard names its primary in node (nodeId, address, role, plus shardId and availabilityZone when known, and collected: false when no connection of the monitor points at that node, so its own metrics are not gathered; connectionId names the connection that collects it). rebalance.kind is plan (slot ranges to move to named target shards, the projected load of every shard before and after, warnings such as a target short on memory or replicas, and in commands the command an operator can run for the move when support is valkey_atomic or redis_atomic) or no_plan with a reason: key_level (one or a few slots carry the load, so moving slots will not help), cluster_hot (the other shards together have no room), too_many_targets (there is room, but not within the 4 shards one suggestion may use), covered_by_other_plan (the plan for another hot shard, listed in coveredBy, already brings this one near the median: apply that plan first), conflicts_with_other_plan (no plan for this shard fits next to the plans for the hot shards listed in conflictsWith: apply those first), no_target, unhealthy_node, migration_running, settling or slots_scattered. The suggestion is read-only: nothing is moved. An empty list means no hot shard event is open; it does not prove the cluster is balanced: a shard must stay hot for a minute first, and the per-slot load must be measured (cluster-slot-stats-enabled yes on every primary, on a connection that reaches each node). Use when a cluster looks unbalanced or a hot_shard anomaly is open.

Inputs: instanceId.

get_incident_timelineA

Get anomaly incidents as ordered timelines. Anomalies on one instance or topology that follow each other closely are grouped into one incident, in the order they happened, with any matched multi-step sequence pattern and a recovery status (active, recovering, recovered, degraded when signals stay open long after the incident went quiet, or unknown when recovery can no longer be measured, with those metrics in recovery.unknownSignals). An entry that is about one cluster node names it in node (nodeId, address, role, plus shardId and availabilityZone when known, and collected: false when no connection of the monitor points at that node, so its own metrics are not gathered; connectionId names the connection that collects it). A sequence match can carry values: the settings its recommendations name, each with the current value and a target computed from the instance (setting, current, target, unit, and nodeAddr when the value is for one node). A hard output-buffer target includes the soft limit when that buffer is already past it. Use to answer "what happened, in what order, and has it recovered".

Inputs: limit, startTime, instanceId.

get_inference_latencyA

Get the FT.SEARCH latency profile: p50/p95/p99 per vector index over the sampling window, plus SLA breach status per index. sla is null when BetterDB Pro inference SLA monitoring is absent or unlicensed, and an empty array when it is active with no indexes configured. More specific than get_latency, which covers general command latency. Use to answer "are vector searches meeting their latency budget?".

Inputs: windowMs, instanceId.

get_infoA

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.

Inputs: section, instanceId.

get_largest_keysA

Get the largest keys from key analytics snapshots, ranked by measured memory usage. Coverage note: snapshots track the biggest collections by element count, so a memory-heavy key with few elements may not be tracked. Companion to get_hot_keys, which ranks by access frequency. Use to find memory hogs, bloated hashes/sets, or candidates for TTL/eviction. Requires BetterDB Pro (keyAnalytics).

Inputs: limit, endTime, startTime, instanceId.

get_latencyB

Get latency event history for the active instance.

Inputs: instanceId.

get_latency_historyA

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.

Inputs: eventName (required), instanceId.

get_latency_regressionsA

Get detected latency regressions (sustained p99 command-latency degradations vs baseline) from persisted storage. Companion to get_anomalies: same event store, pre-filtered to latency regressions. Use when investigating "the database got slower".

Inputs: limit, startTime, instanceId.

get_memoryB

Get memory diagnostics: MEMORY DOCTOR assessment and MEMORY STATS breakdown.

Inputs: instanceId.

get_replication_divergenceA

Get replication divergence for a primary: the per-replica offset gap series (bytes behind as the primary sees it, write rate, seconds behind, replicaGapBytes as the replica reports it with replicaView saying whether it could be read (ok, unreachable, replid_mismatch, not_replica, or null when it was not sampled), live alert level, behind when it lags under the alert thresholds or has an event left open by a restart, or unobserved when the replica is not connected) and the divergence events from the anomaly store; eventsUnavailable: true means the events could not be read, not that there are none. Use when a replica is falling behind under write load, to see whether the gap is growing, at a ceiling, or not closing after the burst, and whether the replica agrees with the primary on how far behind it is. Companion to get_anomalies.

Inputs: limit, startTime, instanceId.

get_retry_amplificationA

Get the live retry-amplification detector state: whether its baseline is armed, whether a candidate or amplifying episode is open (load per client rising with latency, errors or churn while the client count stays flat), the last episode and its trigger, and the clients whose command rate or reconnects grew most. On a cluster or Sentinel group, nodes holds the same state for each other primary it reads. Use when an incident looks like a self-sustaining retry storm rather than real traffic growth.

Inputs: instanceId.

get_slot_statsA

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 { slots, failedNodes }; failedNodes lists cluster primaries that did not answer, whose slots are missing. Returns an error message if not supported.

Inputs: limit, orderBy, instanceId.

get_slowlogB

Get the most recent slow commands from the slowlog.

Inputs: count, instanceId.

get_slowlog_patternsA

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.

Inputs: limit, instanceId.

get_vector_indexesA

Get health details for every vector search index on the instance: document count, memory usage, indexing failures, and percent indexed. Requires the Search module (valkey-search / RediSearch) on the connection — errors clearly if absent. Use to diagnose incomplete indexing or index memory growth.

Inputs: instanceId.

list_ai_tracesA

List recent AI application traces ingested via OpenTelemetry (LLM calls, cache lookups, memory recalls, retrieval spans). Not tied to a Valkey instance — traces come from instrumented AI apps. Use get_ai_trace for a full span waterfall and correlate_ai_trace to join a trace with live Valkey state.

Inputs: hours, limit, service.

list_instancesA

List all Valkey/Redis instances registered in BetterDB. Shows connection status and capabilities.

Inputs: no named parameters.

memory_approve_forgetA

Approve a pending forget proposal, applying the deletion against the live store.

Inputs: proposal_id (required), actor, instanceId.

memory_forgetA

Propose forgetting memories (by id, or by scope/tags). Creates a pending proposal that a human must approve before anything is deleted.

Inputs: reasoning (required), memory_name (required), id, tags, +4 more.

memory_getB

Fetch a single memory by ID from a store.

Inputs: id (required), memory_name (required), instanceId.

memory_listA

List memories in a store, newest first, with optional scope and tag filters.

Inputs: memory_name (required), tags, limit, offset, +4 more.

memory_list_pending_forgetsB

List pending forget proposals awaiting approval on an instance.

Inputs: limit, instanceId, memory_name.

memory_recallB

Recall memories from a store by a precomputed query vector (the caller supplies the embedding).

Inputs: vector (required), memory_name (required), k, tags, +5 more.

memory_reject_forgetA

Reject a pending forget proposal without deleting anything.

Inputs: proposal_id (required), actor, reason, instanceId.

memory_statsB

Get item count, eviction count, and live config for a memory store.

Inputs: memory_name (required), instanceId.

memory_storesA

List agent-memory stores discovered on an instance (name, capabilities, stats key).

Inputs: instanceId.

remove_connectionC

Remove a connection from BetterDB.

Inputs: instanceId (required).

select_instanceC

Select which instance subsequent tool calls operate on.

Inputs: instanceId (required).

set_default_connectionC

Set a connection as the active default for BetterDB.

Inputs: instanceId (required).

start_monitorA

Start the BetterDB monitor as a persistent background process. If already running, returns the existing URL. The monitor persists across MCP sessions and must be stopped explicitly with stop_monitor.

Inputs: port, storage.

stop_monitorA

Stop a persistent BetterDB monitor process that was previously started with start_monitor or --autostart --persist.

Inputs: no named parameters.

test_connectionA

Test a Valkey/Redis connection without persisting it. Use before add_connection to validate credentials.

Inputs: host (required), name (required), port, password, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 64 tools

    Disambiguation3/5

    Most tools have distinct resource/action targets, but several clusters overlap heavily: live vs historical vs patterned latency/slowlog/commandlog tools, and hot keys vs hot shards vs slot stats vs node stats. Descriptions help clarify boundaries, but with 64 tools an agent can still easily choose the wrong diagnostic surface.

    Naming Consistency3/5

    Names are all snake_case and generally readable, but conventions are mixed: generic get_/list_ prefixes coexist with domain-prefixed forms like ai_list_instances, cache_list, memory_list, plus verb-first tools such as add_connection and select_instance. The pattern is understandable within subdomains but not consistent across the whole set.

    Tool Count2/5

    64 tools is far above the reasonable range for a single MCP server surface, even for a broad Valkey/Redis monitoring product. Many tools are specialized subcommands that could be consolidated or grouped, and the volume itself increases selection cost and ambiguity.

    Completeness4/5

    The surface covers a wide monitoring lifecycle: connection management, instance inspection, health, latency, slowlog/commandlog, cluster diagnostics, anomalies/incidents, forecasts, AI caches/traces/memory, proposals, ACL audit, and vector indexes. Minor gaps may exist around direct configuration/key inspection or memory write/update operations, but core monitoring workflows are well-covered.

    Maintenance

    ActivityActive
    ResponsivenessMixed handling

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A production-ready MCP server ecosystem providing Claude AI with 150+ specialized tools across enhanced memory, data analytics, security, design, and infrastructure domains with PostgreSQL, Redis, Qdrant, and Docker orchestration.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      MCP server for AWS infrastructure analysis. Connects to DynamoDB, Lambda, SQS, SNS, Secrets Manager, EventBridge, RDS, PostgreSQL, MongoDB, and CloudWatch — surfaces missing indexes, queue DLQs, Lambda config issues, IaC drift, and security findings for Claude Code and Cursor.
      22
      124 npm
      22
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      A Model Context Protocol (MCP) server for Redis. Connect to any Redis instance and execute queries through AI assistants.
      3
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Provides real-time monitoring of AI agents, context, usage limits, workflows, files, Git, tests, builds, errors, secrets, and model-economy advice for tools like Claude Code, Codex, and Cursor, with 30 MCP tools for comprehensive observability.
      1
      -