CAT
/MCP
SkillsMCPMarketplacesDigestToolsAdvertise

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by Category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP Servers by Category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by Category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control

Cross AI Tools

Discover Claude Code plugins, extensions, and tools. Automatically updated directory of Anthropic Claude AI marketplaces with development tools, productivity plugins, and integrations.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Marketplaces
  • Plugins Reference

Community

  • About
  • Tools
  • Feedback
  • Privacy Policy
  • Advertise

Built for the Claude Code community with Claude Code by @mertduzgun

Independent project, not affiliated with Anthropic

Monitor

betterdb-inc/monitor
1.1k41 toolsauthSTDIOregistry active
Summary

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.

Install to Claude Code

verified
claude mcp add monitor --env BETTERDB_URL=YOUR_BETTERDB_URL --env BETTERDB_TOKEN=YOUR_BETTERDB_TOKEN --env BETTERDB_INSTANCE_ID=YOUR_BETTERDB_INSTANCE_ID -- npx -y @betterdb/mcp

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

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

CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →

Tools

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

verified live41 tools
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
portinteger
Port numberdefault: 6379
passwordstring
Auth password
usernamestring
ACL username (default: "default")
setAsDefaultboolean
Set this connection as the active 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
portinteger
Port numberdefault: 6379
passwordstring
Auth password
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
sectionstring
INFO section to filter (server, clients, memory, stats, replication, keyspace)
instanceIdstring
Optional instance ID override
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
limitnumber
Max entries to analyze
instanceIdstring
Optional instance ID override
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
limitnumber
Max entries to return
commandstring
Filter by command name
endTimenumber
End time (Unix timestamp ms)
startTimenumber
Start time (Unix timestamp ms)
instanceIdstring
Optional instance ID override
minDurationnumber
Min duration in microseconds
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
limitnumber
Max entries to analyze
endTimenumber
End time (Unix timestamp ms)
startTimenumber
Start time (Unix timestamp ms)
instanceIdstring
Optional instance ID override
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
limitnumber
Max events to return
startTimenumber
Start time (Unix timestamp ms)
instanceIdstring
Optional instance ID override
metricTypestring
Filter by metric type
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
endTimenumber
End time (Unix timestamp ms)
startTimenumber
Start time (Unix timestamp ms)
instanceIdstring
Optional instance ID override
bucketSizeMinutesnumber
Bucket size in minutes (default 5)
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
limitnumber
Max entries to return (default 50, max 200)
endTimenumber
End time (Unix timestamp ms)
startTimenumber
Start time (Unix timestamp ms)
instanceIdstring
Optional instance ID override
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
limitnumber
Max entries to return (default 100)
instanceIdstring
Optional instance ID override
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
limitnumber
Max slots to return (default 20)
orderBystring
Sort order: 'key-count' or 'cpu-usec' (default 'key-count')one of key-count · cpu-usec
instanceIdstring
Optional instance ID override
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
limitnumber
Max entries to return
reasonstring
Filter by reason (auth, command, key, channel)
endTimenumber
End time (Unix timestamp ms)
usernamestring
Filter by username
startTimenumber
Start time (Unix timestamp ms)
instanceIdstring
Optional instance ID override
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
categorystring
Restrict to a single category; omit for the global threshold
cache_name*string
Cache name as registered in __betterdb:caches (e.g. 'betterdb_scache_prod').
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
categorystring
Restrict to a single category
cache_name*string
Cache name as registered in __betterdb:caches (e.g. 'betterdb_scache_prod').
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
limitinteger
Max proposals to return (default 20, max 200)
cache_name*string
Cache name as registered in __betterdb:caches (e.g. 'betterdb_scache_prod').
instanceIdstring
Connection ID; defaults to the active instance
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
categoryvalue
Optional per-category override; null/undefined = global threshold
reasoning*string
Why the change is being proposed (≥20 chars)
cache_name*string
Name of the semantic cache (e.g. 'betterdb_scache_prod')
instanceIdstring
Connection ID; defaults to the active instance
new_threshold*number
Proposed cosine-distance threshold, 0–2
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
reasoning*string
Why the change is being proposed (≥20 chars)
tool_name*string
Tool whose TTL is being changed
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)
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
reasoning*string
Why the invalidation is being proposed (≥20 chars)
cache_name*string
Name of the cache to invalidate
instanceIdstring
Connection ID; defaults to the active instance
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
filter_expressionstring
Required when filter_kind=valkey_search; FT.SEARCH filter
estimated_affected*integer
Caller-estimated number of affected entries
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
limitinteger
Max proposals to return (default 100, max 200)
cache_namestring
Restrict to a single cache
instanceIdstring
Connection ID; defaults to the active instance
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
reasonstring
Optional rejection reason recorded on the audit row
proposal_id*string
Proposal id
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
proposal_id*string
Proposal id
new_thresholdnumber
For threshold_adjust proposals
new_ttl_secondsinteger
For tool_ttl_adjust proposals
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.

BetterDB Monitor

A monorepo application for monitoring Valkey/Redis databases with a NestJS backend and React frontend.

Website | Docker Hub | npm | Documentation | Blog

BetterDB is built by BetterDB Inc., a public benefit company operating under the OCV Open Charter.

Project Structure

betterdb-monitor/
├── apps/
│   ├── api/                 # NestJS backend (Fastify)
│   └── web/                 # React frontend (Vite)
├── packages/                # Published packages (see below)
├── docs/                    # Documentation site (Jekyll)
├── docker-compose.yml       # Local Valkey (port 6380) and Redis (port 6382) for testing
└── package.json             # Workspace root

Packages

This monorepo ships several standalone packages. See packages/ for the full list.

Caching

PackageLanguageRegistry
@betterdb/semantic-cacheTypeScriptnpm
betterdb-semantic-cachePythonPyPI
@betterdb/agent-cacheTypeScriptnpm
betterdb-agent-cachePythonPyPI

Tools

PackageLanguageRegistry
@betterdb/monitorTypeScriptnpm
@betterdb/mcpTypeScriptnpm
@betterdb/agentTypeScriptnpm

Benchmarking

PackageLanguageDescription
cache-benchmarkPythonReplay harness for benchmarking semantic caches against public datasets

Tech Stack

Backend

  • NestJS with Fastify adapter
  • iovalkey for Valkey/Redis connections
  • TypeScript with strict mode
  • Runs on port 3001

Frontend

  • React with TypeScript
  • Vite for build tooling
  • TailwindCSS for styling
  • Recharts for data visualization
  • Runs on port 5173

Monorepo

  • pnpm workspaces for dependency management
  • Turborepo for build orchestration

Quick Start

Prerequisites

  • Node.js >= 20.0.0
  • pnpm >= 9.0.0
  • Docker (for local Valkey or Redis instances)

Installation

  1. Install dependencies:
pnpm install
  1. Copy environment variables:
cp .env.example .env
  1. Start local database instances (Valkey on 6380, Redis on 6382):
pnpm docker:up

To connect to Redis instead of Valkey, update .env:

DB_PORT=6382
  1. Start development servers:
pnpm dev

The application will be available at:

  • Frontend: http://localhost:5173
  • Backend API: http://localhost:3001

Individual Commands

Run only the API:

pnpm dev:api

Run only the web frontend:

pnpm dev:web

Stop Docker containers:

pnpm docker:down

Build for production:

pnpm build

CLI Installation (npx)

The easiest way to run BetterDB Monitor without Docker:

npx @betterdb/monitor

On first run, an interactive setup wizard will guide you through configuration:

  • Database connection (host, port, credentials)
  • Storage backend (SQLite, PostgreSQL, or in-memory)
  • Server port and other settings

Configuration is saved to ~/.betterdb/config.json.

Global Installation

npm install -g @betterdb/monitor
betterdb

CLI Options

betterdb --setup           # Re-run setup wizard, then start server
betterdb --port 8080       # Override server port
betterdb --db-host 1.2.3.4 # Override database host
betterdb --help            # Show all options

SQLite Storage (Optional)

To use SQLite storage with the CLI, install better-sqlite3:

npm install -g better-sqlite3

Requirements

  • Node.js >= 20.0.0
  • A Valkey or Redis instance to monitor

Docker Production Deployment

Building the Docker Image

pnpm docker:build

For multi-arch builds (AMD64 + ARM64), first set up buildx:

docker buildx create --name mybuilder --use --bootstrap

Then build:

pnpm docker:build:multiarch

Running the Docker Container

The Docker image contains only the monitoring application (backend + frontend). It requires:

  1. A Valkey/Redis instance to monitor
  2. A PostgreSQL instance for data persistence (or use memory storage)

Basic Run (Memory Storage)

docker run -d \
  --name betterdb-monitor \
  -p 3001:3001 \
  -e DB_HOST=your-valkey-host \
  -e DB_PORT=6379 \
  -e DB_PASSWORD=your-password \
  -e STORAGE_TYPE=memory \
  betterdb/monitor

Run on Custom Port

You can run the application on any port by setting the PORT environment variable with -e PORT=<port>:

docker run -d \
  --name betterdb-monitor \
  -p 8080:8080 \
  -e PORT=8080 \
  -e DB_HOST=your-valkey-host \
  -e DB_PORT=6379 \
  -e DB_PASSWORD=your-password \
  -e STORAGE_TYPE=memory \
  betterdb/monitor

Note: When not using --network host, make sure the -p flag port mapping matches the PORT environment variable (e.g., -p 8080:8080 -e PORT=8080).

Run with PostgreSQL Storage

docker run -d \
  --name betterdb-monitor \
  -p 3001:3001 \
  -e DB_HOST=your-valkey-host \
  -e DB_PORT=6379 \
  -e DB_PASSWORD=your-password \
  -e STORAGE_TYPE=postgres \
  -e STORAGE_URL=postgresql://user:pass@postgres-host:5432/dbname \
  betterdb/monitor

Run with Host Network (Access localhost services)

If your Valkey and PostgreSQL are running on the same host:

docker run -d \
  --name betterdb-monitor \
  --network host \
  -e DB_HOST=localhost \
  -e DB_PORT=6380 \
  -e DB_PASSWORD=devpassword \
  -e STORAGE_TYPE=postgres \
  -e STORAGE_URL=postgresql://dev:devpass@localhost:5432/postgres \
  betterdb/monitor

Auto-Remove Previous Container

To automatically remove any existing container with the same name:

docker rm -f betterdb-monitor 2>/dev/null; docker run -d \
  --name betterdb-monitor \
  -p 3001:3001 \
  -e DB_HOST=your-valkey-host \
  -e DB_PORT=6379 \
  -e DB_PASSWORD=your-password \
  -e STORAGE_TYPE=postgres \
  -e STORAGE_URL=postgresql://user:pass@postgres-host:5432/dbname \
  betterdb/monitor

Environment Variables

VariableRequiredDefaultDescription
DB_HOSTYeslocalhostValkey/Redis host to monitor
DB_PORTNo6379Valkey/Redis port
DB_PASSWORDNo-Valkey/Redis password
DB_USERNAMENodefaultValkey/Redis ACL username
DB_TYPENoautoDatabase type: auto, valkey, or redis
STORAGE_TYPENomemoryStorage backend: memory or postgres
STORAGE_URLConditional-PostgreSQL connection URL (required if STORAGE_TYPE=postgres)
PORTNo3001Application HTTP port
NODE_ENVNoproductionNode environment
ANOMALY_DETECTION_ENABLEDNotrueEnable anomaly detection
ANOMALY_PROMETHEUS_INTERVAL_MSNo30000Prometheus summary update interval (ms)

Accessing the Application

Once running, access the web interface at:

  • Web UI: http://localhost:3001
  • Health Check: http://localhost:3001/health
  • Prometheus Metrics: http://localhost:3001/prometheus/metrics

Docker Image Details

  • Base Image: node:20-alpine
  • Size: ~188MB (optimized, no build tools)
  • Platforms: linux/amd64, linux/arm64
  • Contains: Backend API + Frontend static files (served by Fastify)
  • Excluded: SQLite support (use PostgreSQL or Memory storage)

Checking Container Logs

docker logs -f betterdb-monitor

Stopping the Container

docker stop betterdb-monitor
docker rm betterdb-monitor

Features

Current Features

  • Database connection health monitoring
  • Auto-detection of Valkey vs Redis
  • Version detection
  • Capability detection (Command Log, Slot Stats)
  • Auto-refresh every 5 seconds
  • Full Redis 6.x and 7.x support (85-90% feature parity with Valkey)
  • Graceful degradation for Valkey-only features

Vector / AI

For deployments running RediSearch or valkey-search, BetterDB ships a dedicated Vector / AI tab that surfaces FT.SEARCH ops/sec and average latency over time alongside per-index health (docs, records, deleted docs, indexing failures, backfill progress). Stale Prometheus labels are reconciled when indexes are dropped, and the tab hides automatically when the Search module isn't available. See docs/vector-ai/ for the full walkthrough and screenshots.

Supported Database Versions

DatabaseMinimum VersionSupported Features
Valkey8.0+All features including COMMANDLOG and CLUSTER SLOT-STATS
Redis6.0+All features except COMMANDLOG and CLUSTER SLOT-STATS

Feature Compatibility Matrix

FeatureCommandValkeyRedis
Server InfoINFOYesYes
Health CheckPINGYesYes
SlowlogSLOWLOGYesYes (2.2+)
Client ListCLIENT LISTYesYes (2.4+)
Latency MonitorLATENCYYesYes (2.8+)
Memory StatsMEMORY STATSYesYes (4.0+)
ACL LogACL LOGYesYes (6.0+)
Command LogCOMMANDLOGYes (8.1+)No (Valkey-only)
Cluster Slot StatsCLUSTER SLOT-STATSYes (8.0+)No (Valkey-only)

Architecture Highlights

Unified Adapter Pattern: The backend uses a unified UnifiedDatabaseAdapter that works seamlessly with both Valkey and Redis through the wire-compatible iovalkey client library.

Auto-detection: The application automatically detects whether it's connecting to Valkey or Redis by inspecting the INFO response.

Capability Detection: Features like Command Log (Valkey 8.1+) and Slot Stats (Valkey 8.0+) are automatically detected based on database type and version. The UI gracefully degrades when connecting to Redis, showing only supported features.

Graceful Degradation: When connected to Redis, Valkey-specific features return clear error messages indicating they're not supported, while all shared features work identically.

Prometheus Metrics

Metrics are exposed at GET /prometheus/metrics in Prometheus text format.

ACL Audit Metrics

MetricTypeLabelsDescription
betterdb_acl_deniedgauge-Total ACL denied events captured
betterdb_acl_denied_by_reasongaugereasonACL denied events by reason
betterdb_acl_denied_by_usergaugeusernameACL denied events by username

Client Connection Metrics

MetricTypeLabelsDescription
betterdb_client_connections_currentgauge-Current number of client connections
betterdb_client_connections_peakgauge-Peak connections in retention period
betterdb_client_connections_by_namegaugeclient_nameCurrent connections by client name
betterdb_client_connections_by_usergaugeuserCurrent connections by ACL user

Slowlog Metrics

MetricTypeLabelsDescription
betterdb_slowlog_pattern_countgaugepatternNumber of slow queries per pattern
betterdb_slowlog_pattern_avg_duration_usgaugepatternAverage duration in microseconds per pattern
betterdb_slowlog_pattern_percentagegaugepatternPercentage of slow queries per pattern

COMMANDLOG Metrics (Valkey 8.1+)

MetricTypeLabelsDescription
betterdb_commandlog_large_requestgauge-Total large request entries
betterdb_commandlog_large_replygauge-Total large reply entries
betterdb_commandlog_large_request_by_patterngaugepatternLarge request count by command pattern
betterdb_commandlog_large_reply_by_patterngaugepatternLarge reply count by command pattern

Node.js Process Metrics

MetricTypeLabelsDescription
betterdb_process_cpu_user_seconds_totalcounter-Total user CPU time spent in seconds
betterdb_process_cpu_system_seconds_totalcounter-Total system CPU time spent in seconds
betterdb_process_cpu_seconds_totalcounter-Total user and system CPU time spent in seconds
betterdb_process_start_time_secondsgauge-Start time of the process since unix epoch in seconds
betterdb_process_resident_memory_bytesgauge-Resident memory size in bytes
betterdb_process_virtual_memory_bytesgauge-Virtual memory size in bytes
betterdb_process_heap_bytesgauge-Process heap size in bytes
betterdb_process_open_fdsgauge-Number of open file descriptors
betterdb_process_max_fdsgauge-Maximum number of open file descriptors

Node.js Event Loop Metrics

MetricTypeLabelsDescription
betterdb_nodejs_eventloop_lag_secondsgauge-Lag of event loop in seconds
betterdb_nodejs_eventloop_lag_min_secondsgauge-Minimum recorded event loop delay
betterdb_nodejs_eventloop_lag_max_secondsgauge-Maximum recorded event loop delay
betterdb_nodejs_eventloop_lag_mean_secondsgauge-Mean of recorded event loop delays
betterdb_nodejs_eventloop_lag_stddev_secondsgauge-Standard deviation of recorded event loop delays
betterdb_nodejs_eventloop_lag_p50_secondsgauge-50th percentile of recorded event loop delays
betterdb_nodejs_eventloop_lag_p90_secondsgauge-90th percentile of recorded event loop delays
betterdb_nodejs_eventloop_lag_p99_secondsgauge-99th percentile of recorded event loop delays

Node.js Runtime Metrics

MetricTypeLabelsDescription
betterdb_nodejs_active_resourcesgaugetypeActive resources keeping the event loop alive
betterdb_nodejs_active_resources_totalgauge-Total number of active resources
betterdb_nodejs_active_handlesgaugetypeActive libuv handles by type
betterdb_nodejs_active_handles_totalgauge-Total number of active handles
betterdb_nodejs_active_requestsgaugetypeActive libuv requests by type
betterdb_nodejs_active_requests_totalgauge-Total number of active requests
betterdb_nodejs_version_infogaugeversion, major, minor, patchNode.js version info

Node.js Heap Metrics

MetricTypeLabelsDescription
betterdb_nodejs_heap_size_total_bytesgauge-Process heap size from Node.js in bytes
betterdb_nodejs_heap_size_used_bytesgauge-Process heap size used from Node.js in bytes
betterdb_nodejs_external_memory_bytesgauge-Node.js external memory size in bytes
betterdb_nodejs_heap_space_size_total_bytesgaugespaceProcess heap space size total in bytes
betterdb_nodejs_heap_space_size_used_bytesgaugespaceProcess heap space size used in bytes
betterdb_nodejs_heap_space_size_available_bytesgaugespaceProcess heap space size available in bytes

Node.js GC Metrics

MetricTypeLabelsDescription
betterdb_nodejs_gc_duration_secondshistogramkindGarbage collection duration (major, minor, incremental, weakcb)

Configuration

Database Connection (Valkey/Redis)

Edit .env to configure the Valkey/Redis database connection:

DB_HOST=localhost
DB_PORT=6379
DB_USERNAME=default
DB_PASSWORD=devpassword
DB_TYPE=auto  # 'valkey' | 'redis' | 'auto'

Storage Backend

BetterDB Monitor supports multiple storage backends for persisting audit trail and client analytics data:

SQLite (Local Development Only)

STORAGE_TYPE=sqlite
STORAGE_SQLITE_FILEPATH=./data/audit.db  # Optional, defaults to this path
  • Use Case: Local development
  • Pros: No external database required, simple setup
  • Cons: Not available in Docker production builds
  • Data Location: apps/api/data/audit.db

PostgreSQL (Recommended for Production)

STORAGE_TYPE=postgres
STORAGE_URL=postgresql://username:password@host:port/database
  • Use Case: Production and local development
  • Pros: Full relational database, better for production workloads
  • Cons: Requires PostgreSQL instance
  • Example: postgresql://dev:devpass@localhost:5432/postgres

Memory (Testing/Ephemeral)

STORAGE_TYPE=memory
  • Use Case: Testing, ephemeral environments
  • Pros: No persistence required, fast
  • Cons: All data lost on restart

Running Locally with Different Storage Backends

With SQLite:

STORAGE_TYPE=sqlite \
DB_HOST=localhost \
DB_PORT=6380 \
DB_PASSWORD=devpassword \
pnpm dev:api

With PostgreSQL:

# Start PostgreSQL (if using docker-compose)
docker compose up -d postgres

# Run API with PostgreSQL
STORAGE_TYPE=postgres \
STORAGE_URL=postgresql://betterdb:devpassword@localhost:5432/betterdb \
DB_HOST=localhost \
DB_PORT=6380 \
DB_PASSWORD=devpassword \
pnpm dev:api

With Memory:

STORAGE_TYPE=memory \
DB_HOST=localhost \
DB_PORT=6380 \
DB_PASSWORD=devpassword \
pnpm dev:api

Development

Adding New Features

The codebase is structured to make it easy to add new monitoring features:

  1. Add new endpoints in apps/api/src/
  2. Add corresponding API calls in apps/web/src/api/
  3. Add shared types in packages/shared/src/types/

Code Style

  • TypeScript strict mode is enabled
  • Explicit return types required on functions
  • No any types allowed
  • ESLint + Prettier configured

License

MIT

Featured
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →

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

Categories
Monitoring & Observability
Registryactive
Package@betterdb/mcp
TransportSTDIO
AuthRequired
Tools verifiedJun 10, 2026
UpdatedMar 14, 2026
View on GitHub

Related Monitoring & Observability MCP Servers

View all →
Mcp Observability

io.github.infoinlet-marketplace/mcp-observability

Observability for incident agents — query Loki (LogQL), Prometheus (PromQL), Elasticsearch.
Datadog

com.mcparmory/datadog

Monitor infrastructure, manage agents and deployments, track metrics, logs, and events
25
Observability Mcp

thotischner/observability-mcp

Unified observability gateway for AI agents — Prometheus, Loki & more, with anomaly detection.
5
Datadog Mcp

io.github.tantiope/datadog-mcp

Full Datadog API access: monitors, logs, metrics, traces, dashboards, and observability tools
4
Datadog

io.github.us-all/datadog

Datadog MCP — 165 tools for metrics, monitors, logs, APM, RUM, incidents, CI/CD, fleet
1
MCP Health Monitor

oaslananka/mcp-health-monitor

Monitor MCP server health, uptime, response times, and Azure DevOps pipeline status