Hikari Documentation

Model Context Protocol

MCP tools

Hikari exposes log investigation tools over Streamable HTTP MCP so AI clients can inspect VictoriaLogs data with bounded, discoverable operations.

Endpoint

Use HTTP transport in MCP clients.

https://logs.example.com/mcp

Recommended workflow

  1. Call get_instructions to load field mapping and investigation guidance.
  2. Call summarize_window to inspect the current time range and major facets.
  3. Use get_fields, get_field_values, or get_facets before writing narrow queries.
  4. Use query_logs for known LogsQL. If AI is enabled, use ai_search for natural-language requests.
  5. Keep result limits bounded and include the query in the final answer.

Optional AI capability

ai_search is registered only when Hikari has an OpenAI API key from OPENAI_API_KEY, or from the optional AWS Secrets Manager integration. Without a key, MCP clients still get the non-AI tools for raw queries, facets, field values, hit counts, summaries, and bounded live-tail samples.

Facet mapping

MCP summaries use the same configured facets as the UI. Configure those facets and aliases in config/field-mappings.json instead of hard-coding source fields into client prompts.

{
  "aliases": {
    "service": ["service", "service.name", "service_name", "kubernetes.container_name"],
    "host": ["host", "host.name", "host_name", "hostname", "kubernetes.pod_node_name"]
  },
  "facets": [
    { "field": "service", "label": "Service", "summary": true },
    { "field": "host", "label": "Host", "summary": true },
    { "field": "level", "label": "Level", "summary": true },
    { "field": "kubernetes.pod_namespace", "key": "namespace", "label": "Namespace", "summary": true },
    { "field": "kubernetes.pod_name", "key": "pod", "label": "Pod", "summary": true }
  ]
}

Hikari applies the aliases to backend VictoriaLogs requests with hidden LogsQL copy pipes. For example, host_name can populate the canonical host facet and service_name can populate service without changing the query shown to users or MCP clients.

Available tools

Tool Purpose
get_instructions Explains Hikari, field mapping, and the recommended workflow.
summarize_window Returns time buckets and UI-like facets for service, hostname, level, namespace, and pod.
query_logs Runs bounded VictoriaLogs LogsQL and returns rows plus count stats.
ai_search Optional. Generates LogsQL from a natural-language prompt when OpenAI is configured.
get_facets Returns grouped counts for selected fields.
get_fields Lists field names visible for a query window.
get_field_values Lists common values for one field within a query window.
get_hits Returns hit counts over time for a LogsQL query.
tail_logs Samples the live VictoriaLogs tail for a bounded duration or row count.

Example calls

get_instructions()

summarize_window({
  "query": "_time:15m",
  "step": "1m",
  "limit": 25
})

ai_search({
  "prompt": "summarize checkout errors from the last hour",
  "limit": 50
})

query_logs({
  "query": "_time:15m level:error service:\"api\"",
  "limit": 100
})

If ai_search is not returned by tools/list, configure OPENAI_API_KEY or use the non-AI query and discovery tools.