betterdb-inc avatar

Monitor

betterdb-inc/monitor

Connects Claude to a running Valkey or Redis instance and surfaces real time observability data through MCP tools. You get memory stats, client connections, keyspace metrics, slow queries, and cluster health without leaving your editor. Built on top of BetterDB's monitoring stack, which they also ship as a standalone web dashboard and CLI. Useful when you're debugging cache behavior, investigating performance issues, or need to check database state while writing code that hits Redis. The same company ships semantic caching libraries for LLMs, so the MCP integration feels like a natural extension of that tooling.

GitHub stars
1.3K
tools
41
auth
Secret needed
transport
STDIO
env vars
6
last updated
Nov 11, 2026

Install

From registry metadata
$ npx add-mcp @betterdb/mcp --name monitor --env 'BETTERDB_TOKEN=${BETTERDB_TOKEN}' --env 'BETTERDB_LOCAL_TOKEN=${BETTERDB_LOCAL_TOKEN}'

Run in your terminal. add-mcp asks which agents to add it to, then asks for each value it needs. Add -g to install it for every project.

Review the command, arguments and environment values before installing. MCP servers run with your local permissions.

Other ways

Claude Code

$ claude mcp add monitor --env BETTERDB_URL=YOUR_BETTERDB_URL --env BETTERDB_TOKEN=YOUR_BETTERDB_TOKEN --env BETTERDB_INSTANCE_ID=YOUR_BETTERDB_INSTANCE_ID --env BETTERDB_LOCAL_TOKEN=YOUR_BETTERDB_LOCAL_TOKEN --env BETTERDB_MCP_TELEMETRY=YOUR_BETTERDB_MCP_TELEMETRY --env BETTERDB_TELEMETRY=YOUR_BETTERDB_TELEMETRY -- npx -y @betterdb/mcp

Run in your terminal. Replace YOUR_* placeholders with real values; add --scope user to install for every project.

Tools

Verified live · 41 tools

Verified live against the running server on Jun 10, 2026.

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

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

No parameters. Call it with no arguments.

select_instanceSelect which instance subsequent tool calls operate on.1 params

Select which instance subsequent tool calls operate on.

Parameters* required
instanceId*string
The instance ID to select
add_connectionAdd a new Valkey/Redis connection to BetterDB. Optionally set it as the active default.6 params

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

Parameters* required
host*string
Hostname or IP address
name*string
Display name for the connection
passwordstring
Auth password
portinteger
Port numberdefault: 6379
setAsDefaultboolean
Set this connection as the active default
usernamestring
ACL username (default: "default")
test_connectionTest a Valkey/Redis connection without persisting it. Use before add_connection to validate credentials.5 params

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

Parameters* required
host*string
Hostname or IP address
name*string
Display name for the connection
passwordstring
Auth password
portinteger
Port numberdefault: 6379
usernamestring
ACL username (default: "default")
remove_connectionRemove a connection from BetterDB.1 params

Remove a connection from BetterDB.

Parameters* required
instanceId*string
The instance ID to remove
set_default_connectionSet a connection as the active default for BetterDB.1 params

Set a connection as the active default for BetterDB.

Parameters* required
instanceId*string
The instance ID to set as default
get_infoGet 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.2 params

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.

Parameters* required
instanceIdstring
Optional instance ID override
sectionstring
INFO section to filter (server, clients, memory, stats, replication, keyspace)
get_slowlogGet the most recent slow commands from the slowlog.2 params

Get the most recent slow commands from the slowlog.

Parameters* required
countnumber
Number of entries to return (default 25)
instanceIdstring
Optional instance ID override
get_commandlogGet the most recent entries from COMMANDLOG (Valkey 8+ only, superset of slowlog).2 params

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

Parameters* required
countnumber
Number of entries to return (default 25)
instanceIdstring
Optional instance ID override
get_latencyGet latency event history for the active instance.1 params

Get latency event history for the active instance.

Parameters* required
instanceIdstring
Optional instance ID override
get_memoryGet memory diagnostics: MEMORY DOCTOR assessment and MEMORY STATS breakdown.1 params

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

Parameters* required
instanceIdstring
Optional instance ID override
get_clientsGet the active client list with connection details.1 params

Get the active client list with connection details.

Parameters* required
instanceIdstring
Optional instance ID override
get_healthGet 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 wit...1 params

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

Parameters* required
instanceIdstring
Optional instance ID override
get_slowlog_patternsGet 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.2 params

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.

Parameters* required
instanceIdstring
Optional instance ID override
limitnumber
Max entries to analyze
get_commandlog_historyGet 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.6 params

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.

Parameters* required
commandstring
Filter by command name
endTimenumber
End time (Unix timestamp ms)
instanceIdstring
Optional instance ID override
limitnumber
Max entries to return
minDurationnumber
Min duration in microseconds
startTimenumber
Start time (Unix timestamp ms)
get_commandlog_patternsGet 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.4 params

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.

Parameters* required
endTimenumber
End time (Unix timestamp ms)
instanceIdstring
Optional instance ID override
limitnumber
Max entries to analyze
startTimenumber
Start time (Unix timestamp ms)
get_anomaliesGet 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.4 params

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.

Parameters* required
instanceIdstring
Optional instance ID override
limitnumber
Max events to return
metricTypestring
Filter by metric type
startTimenumber
Start time (Unix timestamp ms)
get_client_activityGet 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.4 params

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.

Parameters* required
bucketSizeMinutesnumber
Bucket size in minutes (default 5)
endTimenumber
End time (Unix timestamp ms)
instanceIdstring
Optional instance ID override
startTimenumber
Start time (Unix timestamp ms)
get_hot_keysGet 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 t...4 params

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

Parameters* required
endTimenumber
End time (Unix timestamp ms)
instanceIdstring
Optional instance ID override
limitnumber
Max entries to return (default 50, max 200)
startTimenumber
Start time (Unix timestamp ms)
get_cluster_nodesDiscover 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.1 params

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.

Parameters* required
instanceIdstring
Optional instance ID override
get_cluster_node_statsGet 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.1 params

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.

Parameters* required
instanceIdstring
Optional instance ID override
get_cluster_slowlogGet 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.2 params

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.

Parameters* required
instanceIdstring
Optional instance ID override
limitnumber
Max entries to return (default 100)
get_slot_statsGet 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.3 params

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.

Parameters* required
instanceIdstring
Optional instance ID override
limitnumber
Max slots to return (default 20)
orderBystring
Sort order: 'key-count' or 'cpu-usec' (default 'key-count')one of key-count · cpu-usec
get_latency_historyGet 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.2 params

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.

Parameters* required
eventName*string
Latency event name to query
instanceIdstring
Optional instance ID override
get_acl_auditGet 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.6 params

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.

Parameters* required
endTimenumber
End time (Unix timestamp ms)
instanceIdstring
Optional instance ID override
limitnumber
Max entries to return
reasonstring
Filter by reason (auth, command, key, channel)
startTimenumber
Start time (Unix timestamp ms)
usernamestring
Filter by username
start_monitorStart 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.2 params

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.

Parameters* required
portinteger
Port for the monitor API (default 3001)default: 3001
storagestring
Storage backend (default sqlite)one of sqlite · memorydefault: sqlite
cache_listList all caches (semantic_cache and agent_cache) registered for the active instance, with hit rate and total ops.1 params

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

Parameters* required
instanceIdstring
Connection ID; defaults to the active instance
cache_healthDetailed health for a single cache. Response branches by type: semantic_cache reports category_breakdown + uncertain_hit_rate; agent_cache reports tool_breakdown.2 params

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

Parameters* required
cache_name*string
Cache name as registered in __betterdb:caches (e.g. 'betterdb_scache_prod').
instanceIdstring
Connection ID; defaults to the active instance
cache_threshold_recommendationThreshold-tuning recommendation for a semantic_cache, based on the rolling similarity-score window. Errors with INVALID_CACHE_TYPE on agent_cache.4 params

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

Parameters* required
cache_name*string
Cache name as registered in __betterdb:caches (e.g. 'betterdb_scache_prod').
categorystring
Restrict to a single category; omit for the global threshold
instanceIdstring
Connection ID; defaults to the active instance
minSamplesinteger
Minimum samples required (default 100)
cache_tool_effectivenessPer-tool hit rate, cost saved, and TTL recommendation for an agent_cache. Errors with INVALID_CACHE_TYPE on semantic_cache.2 params

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

Parameters* required
cache_name*string
Cache name as registered in __betterdb:caches (e.g. 'betterdb_scache_prod').
instanceIdstring
Connection ID; defaults to the active instance
cache_similarity_distributionHistogram of recent similarity scores (20 buckets, width 0.1) for a semantic_cache. Errors on agent_cache.4 params

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

Parameters* required
cache_name*string
Cache name as registered in __betterdb:caches (e.g. 'betterdb_scache_prod').
categorystring
Restrict to a single category
instanceIdstring
Connection ID; defaults to the active instance
window_hoursinteger
Lookback window (default 24h, max 168h)
cache_recent_changesRecent proposals for a single cache (any status), so agents can avoid re-proposing pending or recently-applied changes. Newest first.3 params

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

Parameters* required
cache_name*string
Cache name as registered in __betterdb:caches (e.g. 'betterdb_scache_prod').
instanceIdstring
Connection ID; defaults to the active instance
limitinteger
Max proposals to return (default 20, max 200)
cache_propose_threshold_adjustPropose 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.5 params

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.

Parameters* required
cache_name*string
Name of the semantic cache (e.g. 'betterdb_scache_prod')
categoryvalue
Optional per-category override; null/undefined = global threshold
instanceIdstring
Connection ID; defaults to the active instance
new_threshold*number
Proposed cosine-distance threshold, 0–2
reasoning*string
Why the change is being proposed (≥20 chars)
cache_propose_tool_ttl_adjustPropose an agent-cache per-tool TTL change for review. Creates a pending proposal that requires human approval. Reasoning must be at least 20 characters.5 params

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.

Parameters* required
cache_name*string
Name of the agent cache (e.g. 'betterdb_agentcache_prod')
instanceIdstring
Connection ID; defaults to the active instance
new_ttl_seconds*integer
Proposed TTL in seconds (10–86400)
reasoning*string
Why the change is being proposed (≥20 chars)
tool_name*string
Tool whose TTL is being changed
cache_propose_invalidatePropose 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.7 params

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.

Parameters* required
cache_name*string
Name of the cache to invalidate
estimated_affected*integer
Caller-estimated number of affected entries
filter_expressionstring
Required when filter_kind=valkey_search; FT.SEARCH filter
filter_kind*string
Discriminator: valkey_search for semantic_cache; tool|key_prefix|session for agent_cacheone of valkey_search · tool · key_prefix · session
filter_valuestring
Required when filter_kind in (tool|key_prefix|session); the matching value
instanceIdstring
Connection ID; defaults to the active instance
reasoning*string
Why the invalidation is being proposed (≥20 chars)
cache_list_pending_proposalsList pending cache proposals for the active instance, newest first. Optionally filter by cache_name.3 params

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

Parameters* required
cache_namestring
Restrict to a single cache
instanceIdstring
Connection ID; defaults to the active instance
limitinteger
Max proposals to return (default 100, max 200)
cache_get_proposalFetch a single cache proposal by id, including its audit trail.1 params

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

Parameters* required
proposal_id*string
Proposal id (returned by cache_propose_*)
cache_approve_proposalApprove 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.2 params

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.

Parameters* required
actorstring
Optional actor identity stamped into the audit trail
proposal_id*string
Proposal id
cache_reject_proposalReject a pending proposal. Optionally records a reason in the audit trail.3 params

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

Parameters* required
actorstring
Optional actor identity stamped into the audit trail
proposal_id*string
Proposal id
reasonstring
Optional rejection reason recorded on the audit row
cache_edit_and_approve_proposalEdit 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.4 params

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.

Parameters* required
actorstring
Optional actor identity stamped into the audit trail
new_thresholdnumber
For threshold_adjust proposals
new_ttl_secondsinteger
For tool_ttl_adjust proposals
proposal_id*string
Proposal id
stop_monitorStop a persistent BetterDB monitor process that was previously started with start_monitor or --autostart --persist.

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

No parameters. Call it with no arguments.

Sponsors

Configuration

BETTERDB_URL

URL of the BetterDB monitor instance

BETTERDB_TOKENsecret

MCP authentication token generated from the BetterDB Settings page

BETTERDB_INSTANCE_ID

Instance ID to target when using multi-instance cloud deployments

BETTERDB_LOCAL_TOKENsecret

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_MCP_TELEMETRY

Set to false, 0, no or off to stop posting tool usage events to the monitor. Usage events are off if this or BETTERDB_TELEMETRY is off

BETTERDB_TELEMETRY

Set to false, 0, no or off to turn off telemetry for both the MCP server and a monitor it starts

Readme

BetterDB Monitor

Docker Pulls Docker Image Version Artifact Hub npm npm downloads API Tests License Valkey Redis

The monitoring layer that Valkey deserves.


View the full README on GitHub

Details

Repository
github.com/betterdb-inc/monitor
Categories
Databases, Monitoring & Observability
Package
@betterdb/mcp
Transport
STDIO
Auth
Required
Registry
MCP registry, active
Tools verified
Jun 10, 2026

Related Databases MCP servers

View all
1falkordb avatarQueryweaverfalkordb/queryweaverAn MCP server for Text2SQL: transforms natural language into SQL using graph schema understanding.1Kstars
2motherduckdb avatarMcp Server Motherduckmotherduckdb/mcp-server-motherduckSQL analytics and data engineering for AI Assistants and IDEs540stars
3mihaibuilds avatarMemory Vaultmihaibuilds/memory-vaultLocal-first AI memory layer with hybrid search. Postgres + pgvector. Self-hosted, MIT.67stars
4ralfbecher avatarOrionbelt Analyticsralfbecher/orionbelt-analyticsOntology-based MCP server for database schema analysis and RDF/OWL ontology generation32stars
5greptimeteam avatarGreptimedb Mcp Servergreptimeteam/greptimedb-mcp-serverQuery GreptimeDB metrics, logs and traces with SQL, TQL and RANGE. Manage pipelines and dashboards.29stars
6insforge avatarInsForgeinsforge/insforge-mcpMCP server for InsForge BaaS — database, storage, edge functions, and deployments29stars