Better Stack MCP Server
OFFICIAL SERVERHosted Better Stack server for incidents, on-call, uptime monitors, logs, metrics and error tracking
Query a BetterDB monitor's Valkey and Redis metrics, slowlogs, hot keys and cache proposals from a chat
Official · BetterDB TypeScript Local · stdio DevOps and monitoringDatabases
43 popularity score ★ 1.3k ↓ 75/wk
Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
It needs BETTERDB_URL. Replace each <NAME> with your value.
claude mcp add betterdb -e BETTERDB_URL=<BETTERDB_URL> -- npx @betterdb/mcp{
"mcpServers": {
"betterdb": {
"command": "npx",
"args": [
"@betterdb/mcp"
],
"env": {
"BETTERDB_URL": "<BETTERDB_URL>"
}
}
}
}{
"mcpServers": {
"betterdb": {
"command": "npx",
"args": [
"@betterdb/mcp"
],
"env": {
"BETTERDB_URL": "<BETTERDB_URL>"
}
}
}
}{
"servers": {
"betterdb": {
"type": "stdio",
"command": "npx",
"args": [
"@betterdb/mcp"
],
"env": {
"BETTERDB_URL": "<BETTERDB_URL>"
}
}
}
}[mcp_servers.betterdb]
command = "npx"
args = ["@betterdb/mcp"]
[mcp_servers.betterdb.env]
BETTERDB_URL = "<BETTERDB_URL>"gemini mcp add --scope user -e BETTERDB_URL=<BETTERDB_URL> betterdb npx -- @betterdb/mcpBETTERDB_URL |
Required: Address of the BetterDB monitor or Cloud workspace (https://<workspace>.app.betterdb.com). |
|---|---|
BETTERDB_TOKEN secret |
Optional: MCP token from Settings → MCP Tokens, sent as a Bearer header. Needed for BetterDB Cloud, optional for a self-hosted monitor. |
BETTERDB_INSTANCE_ID |
Optional: Instance to use from the start, so select_instance is not needed. |
BETTERDB_TELEMETRY |
Optional: Set to false to stop the tool-call usage reports the server posts to the monitor. |
The BetterDB MCP server (npm package @betterdb/mcp) is the assistant-facing side of BetterDB Monitor, an observability tool for Valkey and Redis. It does not open a database connection itself: every tool calls the REST API of a running BetterDB monitor, either a self-hosted one (http://localhost:3001 by default) or a BetterDB Cloud workspace, and returns what that monitor has collected.
Through it an assistant can pick one of the monitored instances and read its health summary, INFO sections, slowlog and COMMANDLOG entries (live and persisted, with pattern aggregation), latency events, memory diagnostics, client lists and activity over time, hot and largest keys, the ACL audit log, cluster node and per-slot stats, capacity forecasts, anomaly events, vector index health and FT.SEARCH latency, and OpenTelemetry traces from AI applications correlated with Valkey state.
It can also change things: add, test, remove or set the default monitored connection; start and stop a local monitor process; and work with the review flow for BetterDB's semantic and agent caches and agent-memory stores, where tools propose a threshold, TTL, invalidation or forget, and separate approve tools apply the change to Valkey.
The version 1.5.0 source registers 60 tools (packages/mcp/src/index.ts at tag mcp-v1.5.0). The package README lists 51 of them: it leaves out the nine agent-memory tools (memory_stores, memory_list, memory_get, memory_stats, memory_recall, memory_forget, memory_list_pending_forgets, memory_approve_forget, memory_reject_forget). With --autostart the server launches the monitor itself by running npx --yes @betterdb/monitor, records the process id in ~/.betterdb/monitor.pid, and gives up if the monitor is not healthy within 15 seconds (src/autostart.ts).
| Runtime | Node.js 20+ |
|---|---|
| Runs on | macOS, Windows, Linux |
| BetterDB | Your own instanceA running BetterDB monitor (self-hosted or BetterDB Cloud) that watches a Valkey 8.0+ or Redis 6+ instance. Cloud needs an MCP token. |
| Also |
|
On BetterDB Cloud, create a token under Settings → MCP Tokens and set it as BETTERDB_TOKEN. A self-hosted monitor can run from the betterdb/monitor Docker image, npx @betterdb/monitor or Helm. With --autostart nothing has to run beforehand. The started monitor gets the server's whole environment, so its own database settings (DB_HOST, DB_TLS, DB_TLS_CA_FILE, DB_TLS_CERT_FILE, DB_TLS_KEY_FILE, DB_AUTH_MODE and so on, from the main README) can go in the client's env block. sqlite storage may need better-sqlite3 installed globally (npm install -g better-sqlite3).
It only sees what the BetterDB monitor exposes; it has no direct database access and runs no arbitrary commands. get_anomalies, get_latency_regressions, get_largest_keys and the SLA fields of get_inference_latency are Pro features (free in early access, per the README). COMMANDLOG and per-slot stats need Valkey 8 or newer; vector tools need the Search module (valkey-search or RediSearch); cache and memory tools need BetterDB's own semantic-cache, agent-cache or agent-memory libraries. memory_recall takes a precomputed embedding vector; the server does not embed text. Each API call times out after 30 seconds (src/index.ts). --storage accepts only sqlite or memory.
Suits teams already running BetterDB Monitor, self-hosted or on Cloud, who want an assistant to investigate Valkey or Redis incidents from history that the database itself has discarded: slow commands, hot keys, cluster imbalance, anomalies. Also suits users of BetterDB's semantic or agent caches who want proposed tuning changes reviewed before they are applied. It is a poor fit if you do not want to run the BetterDB monitor at all, or want an assistant to run arbitrary Redis commands or read and write keys directly: this server only goes through the monitor's API.
46 only read, 12 change things, 2 can delete or overwrite. A ? marks an optional parameter.
list_instancesselect_instanceinstanceId: stringadd_connection changesname: stringhost: stringport?: numberusername?: stringpassword?: stringsetAsDefault?: booleantest_connectionname: stringhost: stringport?: numberusername?: stringpassword?: stringremove_connection deletesinstanceId: stringset_default_connection changesinstanceId: stringget_healthget_infosection?: stringinstanceId?: stringget_slowlogcount?: numberinstanceId?: stringget_commandlogcount?: numberinstanceId?: stringget_latencyget_latency_historyeventName: stringinstanceId?: stringget_memoryget_clientsget_hot_keysstartTime?: numberendTime?: numberlimit?: numberinstanceId?: stringget_slowlog_patternslimit?: numberinstanceId?: stringget_commandlog_historystartTime?: numberendTime?: numbercommand?: stringminDuration?: numberlimit?: numberinstanceId?: stringget_commandlog_patternsstartTime?: numberendTime?: numberlimit?: numberinstanceId?: stringget_anomalieslimit?: numbermetricType?: stringstartTime?: numberinstanceId?: stringget_client_activitystartTime?: numberendTime?: numberbucketSizeMinutes?: numberinstanceId?: stringget_acl_auditusername?: stringreason?: stringstartTime?: numberendTime?: numberlimit?: numberinstanceId?: stringget_cluster_nodesget_cluster_node_statsget_cluster_slowloglimit?: numberinstanceId?: stringget_slot_statsorderBy?: enumlimit?: numberinstanceId?: stringstart_monitor changesport?: numberstorage?: enumstop_monitor changesget_forecastmetricKind: enuminstanceId?: stringget_latency_regressionslimit?: numberstartTime?: numberinstanceId?: stringget_largest_keyslimit?: numberstartTime?: numberendTime?: numberinstanceId?: stringget_vector_indexesinstanceId?: stringget_inference_latencywindowMs?: numberinstanceId?: stringai_list_instancesinstanceId?: stringai_instance_historyfield: stringhours?: numberinstanceId?: stringlist_ai_traceshours?: numberservice?: stringlimit?: numberget_ai_tracetraceId: stringcorrelate_ai_tracetraceId: stringinstanceId?: stringcache_listinstanceId?: stringcache_healthcache_name: stringinstanceId?: stringcache_threshold_recommendationcache_name: stringcategory?: stringminSamples?: numberinstanceId?: stringcache_tool_effectivenesscache_name: stringinstanceId?: stringcache_similarity_distributioncache_name: stringcategory?: stringwindow_hours?: numberinstanceId?: stringcache_recent_changescache_name: stringlimit?: numberinstanceId?: stringcache_propose_threshold_adjust changescache_name: stringnew_threshold: numbercategory?: stringreasoning: stringinstanceId?: stringcache_propose_tool_ttl_adjust changescache_name: stringtool_name: stringnew_ttl_seconds: numberreasoning: stringinstanceId?: stringcache_propose_invalidate changescache_name: stringfilter_kind: enumfilter_expression?: stringfilter_value?: stringestimated_affected: numberreasoning: stringinstanceId?: stringcache_list_pending_proposalscache_name?: stringlimit?: numberinstanceId?: stringcache_get_proposalproposal_id: stringcache_approve_proposal changesproposal_id: stringactor?: stringcache_reject_proposal changesproposal_id: stringreason?: stringactor?: stringcache_edit_and_approve_proposal changesproposal_id: stringnew_threshold?: numbernew_ttl_seconds?: numberactor?: stringmemory_storesmemory_listmemory_name: stringthreadId?: stringagentId?: stringnamespace?: stringtags?: arraylimit?: numberoffset?: numberinstanceId?: stringmemory_getmemory_name: stringid: stringinstanceId?: stringmemory_statsmemory_name: stringinstanceId?: stringmemory_recallmemory_name: stringvector: arrayk?: numberthreshold?: numbertags?: arraythreadId?: stringagentId?: stringnamespace?: stringinstanceId?: stringmemory_forget changesmemory_name: stringid?: stringthreadId?: stringagentId?: stringnamespace?: stringtags?: arrayreasoning: stringinstanceId?: stringmemory_list_pending_forgetsmemory_name?: stringlimit?: numberinstanceId?: stringmemory_approve_forget deletesproposal_id: stringactor?: stringinstanceId?: stringmemory_reject_forget changesproposal_id: stringreason?: stringactor?: stringinstanceId?: string