Skip to content

Add diagnostics tools + SENSITIVE_READ_TOOLS category (11 tools) - #199

Closed
celticht32 wants to merge 6 commits into
couchbase:mainfrom
celticht32:feat/diagnostics-tools
Closed

Add diagnostics tools + SENSITIVE_READ_TOOLS category (11 tools)#199
celticht32 wants to merge 6 commits into
couchbase:mainfrom
celticht32:feat/diagnostics-tools

Conversation

@celticht32

Copy link
Copy Markdown

⚠️ This PR stacks on top of #187, #195, #196, #197, and #198. Its diff includes those PRs' code plus this PR's diagnostics code because they are still under review. Once the upstream chain merges, GitHub will auto-shrink this diff to just the 5 new/modified files:

  • src/cb_mcp/tools/diagnostics.py (new)
  • src/cb_mcp/utils/diagnostics_rest.py (new)
  • src/cb_mcp/tools/__init__.py (registration additions + new SENSITIVE_READ_TOOLS category)
  • tests/unit/test_diagnostics.py (new, 26 tests)
  • tests/unit/test_read_only_mode.py (tool-count updates for the 9 new read tools)

If you'd like to review just the diagnostics changes in isolation, view the diff at: celticht32/mcp-server-couchbase@feat/fts-management-tools...feat/diagnostics-tools

Phase 6 of the phased admin-tool contribution discussed in #157. Introduces a new SENSITIVE_READ_TOOLS category — please see the "Open questions" section below for the design decision behind that.

What this adds

Eleven diagnostic tools that surface the same information the cluster manager Web Console shows, structured for programmatic use by an MCP client. Every tool is a GET; nothing here mutates state.

Read-only (9 tools) — always available

  • get_cluster_info — GET /pools/default. Full cluster info: nodes, quotas, storage totals, running tasks.
  • get_cluster_stats — Synthesized summary: node_count, healthy_nodes, storage_totals, balanced, rebalance_status. A compact view for pollers who don't want to parse the full /pools/default response.
  • get_node_info — GET /nodes/self. Hostname, uptime, memory, services, and OS counters for the current node.
  • get_bucket_stats — GET /pools/default/buckets/{bucket}/stats. Per-bucket ops/sec, disk queues, memory, cache hit ratio.
  • get_index_stats — GET /pools/default/buckets/@index/stats. Index service runtime stats.
  • get_query_stats — GET /pools/default/buckets/@query/stats. Query service runtime stats.
  • get_fts_stats — GET /api/nsstats on FTS ports 8094/18094. Per-index doc counts, query throughput.
  • get_kv_stats — GET /pools/default/buckets/{bucket}/stats/curr_items. KV service current items and related stats (bucket-scoped).
  • get_disk_usage — Extracted from /pools/default's storageTotals block. Returns {ram, hdd} summaries at cluster level.

Sensitive reads (2 tools) — gated behind admin_write_mode

  • get_slow_queries(min_duration_ms=1000, limit=50) — Reads system:completed_requests via SQL++

@nithishr

Copy link
Copy Markdown
Collaborator

Closing this as the REST API is not supported by Capella.

@nithishr nithishr closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants