Skip to main content
Glama
kairosdb-mcp-server

kairosdb-mcp-server

by ae3e

kairosdb-mcp-server

MCP server for querying KairosDB (REST API v1) from Claude Desktop.

Available tools

Tool

Description

kairosdb_query_range

Raw or aggregated data over a relative range (e.g. last 24h)

kairosdb_query_absolute

Data over an absolute range (ISO 8601 dates)

kairosdb_last_value

Latest known value of a metric

kairosdb_aggregate

Several aggregations (min/max/avg) in a single request

kairosdb_list_metrics

Lists all available metrics

kairosdb_list_tag_values

Available values for a given tag

kairosdb_health

Checks the server status

Related MCP server: osm-mcp

Installation

cd kairosdb-mcp-server
npm install
npm run build

Verify the build is OK:

node dist/index.js
# Should print: [kairosdb-mcp] Starting. KairosDB URL: http://localhost:8080
# Then: [kairosdb-mcp] Ready.
# Then wait for MCP messages (stdio)

Claude Desktop configuration

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "directus": {
      // ... your existing Directus config
    },
    "kairosdb": {
      "command": "node",
      "args": ["/absolute/path/to/kairosdb-mcp-server/dist/index.js"],
      "env": {
        "KAIROSDB_URL": "http://your-kairosdb-server:8080",
        "KAIROSDB_USER": "",
        "KAIROSDB_PASSWORD": ""
      }
    }
  }
}

Replace /absolute/path/to/ with the actual path on your machine. Leave KAIROSDB_USER and KAIROSDB_PASSWORD empty if authentication isn't used.

Environment variables

Variable

Default

Description

KAIROSDB_URL

http://localhost:8080

KairosDB server URL

KAIROSDB_USER

(empty)

HTTP Basic username (optional)

KAIROSDB_PASSWORD

(empty)

HTTP Basic password (optional)

Example questions in Claude Desktop

Exploration

  • "List all KairosDB metrics"

  • "What values exist for the tag 'host'?"

  • "Is KairosDB available?"

Real-time data

  • "What is the latest value of the metric server.cpu_usage for tag host=web-01?"

Time series

  • "Give me the data for network.latency over the last 48 hours"

  • "Show me the memory usage between 2024-01-01 and 2024-01-31"

Aggregations

  • "Compute the min/max/avg of http.request_duration hourly over the last 7 days for server web-01"

Combined with Directus

  • "Show me all hosts in the 'Payment Service' group, then give me their latest CPU value in KairosDB"

Architecture

src/
├── index.ts              # Entry point, stdio transport
├── constants.ts          # URL, limits
├── types.ts              # KairosDB API interfaces
├── schemas/
│   └── index.ts          # Zod schemas for all tools
├── services/
│   ├── kairosdb-client.ts  # KairosDB HTTP client
│   └── formatters.ts       # Markdown/JSON formatting
└── tools/
    ├── query-tools.ts      # query_range, query_absolute, last_value
    └── aggregate-tools.ts  # aggregate, list_metrics, list_tag_values, health

Available Tools

7 tools
kairosdb_aggregateMultiple aggregations over a relative rangeA
Read-onlyIdempotent

Computes several aggregations (min, max, avg, etc.) in a single request over a relative time range.

Use cases:

  • "Give me the min/max/avg CPU usage on server web-01 over the last 7 days, hourly"

  • "Daily request latency statistics over the last 30 days"

Args:

  • metric_name: Exact metric name

  • tags: Tag filters

  • range_value / range_unit: Time range (default: 24 hours)

  • aggregators: List of functions (default: [avg, min, max])

  • sampling_value / sampling_unit: Computation window (default: 1 hour)

  • response_format: "markdown" or "json"

Returns: One series per aggregator with statistics.

Inputs: metric_name (required), tags, range_unit, aggregators, +4 more.

kairosdb_healthKairosDB server statusA
Read-only

Checks that the KairosDB server is reachable and operational.

Use cases:

  • "Is KairosDB available?"

  • Diagnosing a connection error

Returns: "ok" or "error" status with details.

Inputs: no named parameters.

kairosdb_last_valueLatest value of a metricA
Read-only

Retrieves the most recent value of a metric (equivalent to a real-time reading).

Use cases:

  • "What is the current CPU usage on server web-01?"

  • "Latest reading from the request latency metric"

Args:

  • metric_name: Exact metric name

  • tags: Tag filters to target a specific host

  • response_format: "markdown" or "json"

Returns: Latest known value with its timestamp.

Inputs: metric_name (required), tags, response_format.

kairosdb_list_metricsList available metricsA
Read-onlyIdempotent

Returns all metrics (host/service series names) stored in KairosDB.

Use cases:

  • "Which metrics are available for the servers?"

  • "List all metrics starting with 'server.'"

Args:

  • prefix: Optional prefix filter (e.g. "server." to filter client-side)

  • response_format: "markdown" or "json"

Returns: List of metric names.

Inputs: prefix, response_format.

kairosdb_list_tag_valuesAvailable values for a tagA
Read-onlyIdempotent

Returns all known values for a given tag name.

Use cases:

  • "What hosts are available?" → tag_name = "host"

  • "What environments exist?" → tag_name = "environment"

Args:

  • tag_name: Tag name (e.g. "host", "environment", "region")

  • response_format: "markdown" or "json"

Returns: List of values for this tag.

Inputs: tag_name (required), response_format.

kairosdb_query_absoluteQuery over an absolute time rangeA
Read-onlyIdempotent

Queries KairosDB over a time range defined by precise ISO 8601 dates.

Use cases:

  • "Server metrics between 2024-01-01 and 2024-01-31"

  • "Analysis of a precise incident over a timestamped window"

Args:

  • metric_name: Exact metric name

  • tags: Tag filters

  • start: Start (ISO 8601, e.g. 2024-01-15T00:00:00Z)

  • end: End (ISO 8601, default: now)

  • aggregator / sampling_value / sampling_unit: Optional aggregation

  • limit: Max points (default 1000)

  • response_format: "markdown" or "json"

Returns: Timestamped points with statistics.

Inputs: start (required), metric_name (required), end, tags, +5 more.

kairosdb_query_rangeQuery over a relative time rangeA
Read-onlyIdempotent

Queries KairosDB for a metric's data over a relative time range (e.g. the last 24 hours).

Typical use cases:

  • "Give me the CPU usage data for server web-01 over the last 7 days"

  • "Show me the memory usage from last week"

Args:

  • metric_name: Exact KairosDB metric name

  • tags: Tag filters (e.g. {"host": ["web-01"]})

  • range_value: Duration to look back (default: 24)

  • range_unit: Unit (hours/days/weeks/..., default: hours)

  • aggregator: Optional aggregation function (avg/min/max/sum/count)

  • sampling_value / sampling_unit: Window size if aggregation is enabled

  • limit: Max number of points (default: 1000, max: 10,000)

  • response_format: "markdown" (default) or "json"

Returns: Timestamped data points with statistics (min/max/avg).

Inputs: metric_name (required), tags, limit, aggregator, +5 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 7 tools

    Disambiguation4/5

    query_range/query_absolute/last_value are clearly separated by time framing, and list_metrics/list_tag_values/health serve distinct discovery and operations roles. Some overlap exists between query_range and aggregate, since both support relative ranges with aggregation, though one returns data points with optional stats and the other computes multiple aggregations.

    Naming Consistency4/5

    All tools share the kairosdb_ prefix and most follow a kairosdb_<operation>_<object> pattern, e.g. query_range, query_absolute, list_metrics, list_tag_values. Minor deviations like kairosdb_aggregate and kairosdb_last_value are still predictable within the overall convention.

    Tool Count5/5

    Seven tools is a well-scoped size for a read-only time-series database MCP server. Each tool earns its place by covering a distinct querying, discovery, or health-check need without unnecessary redundancy.

    Completeness4/5

    The set covers relative and absolute time-range queries, latest-value reads, aggregation, metric discovery, tag-value discovery, and health checks. Minor gaps like listing tag keys or write/delete operations are acceptable for a read-oriented query server.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides read-only access to Loki, Prometheus, and Tempo APIs, enabling natural language queries for logs, metrics, and traces. Supports multiple instances and authentication via bearer tokens.
      1
      MIT
    • F
      license
      B
      quality
      D
      maintenance
      Provides read-only query tools over OpenStreetMap data in PostGIS, enabling natural language queries for features, categories, and spatial analysis.
      7
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables querying Prometheus metrics, performing cluster diagnostics, and analyzing resource usage through natural language, with automatic Kubernetes connectivity.
      MIT