Back to MCP Servers

Victorialogs

Provides comprehensive integration with your [VictoriaLogs instance APIs](https://docs.victoriametrics.com/victorialogs/querying/#http-api) and [documentation](https://docs.victoriametrics.com/victorialogs/) for working with logs, investigating and debugging tasks related to you…

databasesapi
By VictoriaMetrics-Community
9023Updated 1 week agoGoApache-2.0

Installation

npx -y mcp-victorialogs

Configuration

{
  "mcpServers": {
    "mcp-victorialogs": {
      "command": "npx",
      "args": ["-y", "mcp-victorialogs"]
    }
  }
}

How to use

  1. Run the installation command above (if needed)
  2. Open your Claude Code settings file (~/.claude/settings.json)
  3. Add the configuration to the mcpServers section
  4. Restart Claude Code to apply changes

VictoriaLogs MCP Server

Latest Release License Slack X Reddit

The implementation of Model Context Protocol (MCP) server for VictoriaLogs.

This provides access to your VictoriaLogs instance and seamless integration with VictoriaLogs APIs and documentation. It can give you a comprehensive interface for logs, observability, and debugging tasks related to your VictoriaLogs instances, enable advanced automation and interaction capabilities for engineers and tools.

Features

This MCP server allows you to use almost all read-only APIs of VictoriaLogs, i.e. all functions available in Web UI:

  • Querying logs and exploring logs data
  • Showing parameters of your VictoriaLogs instance
  • Listing available streams, fields, field values
  • Query statistics for the logs as metrics
  • UI with setup instructions and tools inspection on the root endpoint (only in Streamable HTTP mode)

In addition, the MCP server contains embedded up-to-date documentation and is able to search it without online access.

image

More details about the exact available tools and prompts can be found in the Usage section.

You can combine functionality of tools, docs search in your prompts and invent great usage scenarios for your VictoriaLogs instance. And please note the fact that the quality of the MCP Server and its responses depends very much on the capabilities of your client and the quality of the model you are using.

You can also combine the MCP server with other observability or doc search related MCP Servers and get even more powerful results.

Try without installation

There is a publicly available instance of the VictoriaMetrics MCP Server that you can use to test the features without installing it:

https://play-vmlogs-mcp.victoriametrics.com/mcp

Attention! This URL is not supposed to be opened in a browser, it is intended to be used in MCP clients.

It's available in Streamable HTTP Mode mode and configured to work with Public VictoriaLogs Playground.

Here is example of configuration for Claude Desktop:

image

Requirements

Installation

Go

go install github.com/VictoriaMetrics/mcp-victorialogs/cmd/mcp-victorialogs@latest

Binaries

Just download the latest release from Releases page and put it to your PATH.

Example for Linux x86_64 (note that other architectures and platforms are also available):

latest=$(curl -s https://api.github.com/repos/VictoriaMetrics/mcp-victorialogs/releases/latest | grep 'tag_name' | cut -d\" -f4)
wget https://github.com/VictoriaMetrics/mcp-victorialogs/releases/download/$latest/mcp-victorialogs_Linux_x86_64.tar.gz
tar axvf mcp-victorialogs_Linux_x86_64.tar.gz

Docker

You can run VictoriaLogs MCP Server using Docker.

This is the easiest way to get started without needing to install Go or build from source.

docker run -d --name mcp-victorialogs \
  -e VL_INSTANCE_ENTRYPOINT=https://play-vmlogs.victoriametrics.com \
  -e MCP_SERVER_MODE=http \
  -e MCP_LISTEN_ADDR=:8081 \
  -p 8081:8081 \
  ghcr.io/victoriametrics/mcp-victorialogs

You should replace environment variables with your own parameters.

Note that the MCP_SERVER_MODE=http flag is used to enable Streamable HTTP mode. More details about server modes can be found in the Configuration section.

See available docker images in github registry.

Also see Using Docker instead of binary section for more details about using Docker with MCP server with clients in stdio mode.

Source Code

For building binary from source code you can use the following approach:

  • Clone repo:

    git clone https://github.com/VictoriaMetrics/mcp-victorialogs.git
    cd mcp-victorialogs
  • Build binary from cloned source code:

    make build
    # after that you can find binary mcp-victorialogs and copy this file to your PATH or run inplace
  • Build image from cloned source code:

    docker build -t mcp-victorialogs .
    # after that you can use docker image mcp-victorialogs for running or pushing

Helm

Check out VictoriaLogs MCP Server Helm chart documentation for more details about installation using Helm.

Configuration

MCP Server for VictoriaLogs is configured via environment variables:

VariableDescriptionRequiredDefaultAllowed values
VL_INSTANCE_ENTRYPOINTURL to VictoriaLogs instanceYes--
VL_INSTANCE_BEARER_TOKENAuthentication token for VictoriaLogs APINo--
VL_INSTANCE_HEADERSCustom HTTP headers to send with requests (comma-separated key=value pairs)No--
MCP_PASSTHROUGH_HEADERSHTTP header names to forward from incoming MCP requests to VictoriaLogs (comma-separated list). Overrides VL_INSTANCE_HEADERS on collision. Only applies in sse/http modes.No--
VL_DEFAULT_TENANT_IDDefault tenant ID used when tenant is not specified in requests (format: AccountID:ProjectID or AccountID)No0:0-
MCP_SERVER_MODEServer operation mode. See Modes for details.Nostdiostdio, sse, http
MCP_LISTEN_ADDRAddress for SSE or HTTP server to listen onNolocalhost:8081-
MCP_DISABLED_TOOLSComma-separated list of tools to disableNo--
MCP_HEARTBEAT_INTERVALDefines the heartbeat interval for the streamable-http protocol. <br /> It means the MCP server will send a heartbeat to the client through the GET connection, <br /> to keep the connection alive from being closed by the network infrastructure (e.g. gateways)No30s-
MCP_LOG_FORMATLog output formatNotexttext, json
MCP_LOG_LEVELMinimum log levelNoinfodebug, info, warn, error

Modes

MCP Server supports the following modes of operation (transports):

  • stdio - Standard input/output mode, where the server reads commands from standard input and writes responses to standard output. This is the default mode and is suitable for local servers.
  • sse - Server-Sent Events. Server will expose the /sse and /message endpoints for SSE connections.
  • http - Streamable HTTP. Server will expose the /mcp endpoint for HTTP connections.

More info about transports you can find in MCP docs:

Сonfiguration examples

# For a public playground
export VL_INSTANCE_ENTRYPOINT="https://play-vmlogs.victoriametrics.com"

# Custom headers for authentication (e.g., behind a reverse proxy)
# Expected syntax is key=value separated by commas
export VL_INSTANCE_HEADERS="<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"

# Forward specific headers from incoming MCP requests to VictoriaLogs
export MCP_PASSTHROUGH_HEADERS="X-Token,X

…
View source on GitHub