{
  "markdown": "# VictoriaLogs MCP Server\n\n[![Latest Release](https://img.shields.io/github/v/release/VictoriaMetrics/mcp-victorialogs?sort=semver&label=&filter=!*-victorialogs&logo=github&labelColor=gray&color=gray&link=https%3A%2F%2Fgithub.com%2FVictoriaMetrics%2Fmcp-victorialogs%2Freleases%2Flatest)](https://github.com/VictoriaMetrics/mcp-victorialogs/releases)\n![License](https://img.shields.io/github/license/VictoriaMetrics/mcp-victorialogs?labelColor=green&label=&link=https%3A%2F%2Fgithub.com%2FVictoriaMetrics%2Fmcp-victorialogs%2Fblob%2Fmain%2FLICENSE)\n![Slack](https://img.shields.io/badge/Join-4A154B?logo=slack&link=https%3A%2F%2Fslack.victoriametrics.com)\n![X](https://img.shields.io/twitter/follow/VictoriaMetrics?style=flat&label=Follow&color=black&logo=x&labelColor=black&link=https%3A%2F%2Fx.com%2FVictoriaMetrics)\n![Reddit](https://img.shields.io/reddit/subreddit-subscribers/VictoriaMetrics?style=flat&label=Join&labelColor=red&logoColor=white&logo=reddit&link=https%3A%2F%2Fwww.reddit.com%2Fr%2FVictoriaMetrics)\n\nThe implementation of [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for [VictoriaLogs](https://docs.victoriametrics.com/victorialogs/).\n\nThis provides access to your VictoriaLogs instance and seamless integration with [VictoriaLogs APIs](https://docs.victoriametrics.com/victorialogs/querying/#http-api) and [documentation](https://docs.victoriametrics.com/victorialogs/).\nIt 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.\n\n## Features\n\nThis MCP server allows you to use almost all read-only APIs of VictoriaLogs, i.e. all functions available in [Web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui):\n\n- Querying logs and exploring logs data\n- Showing parameters of your VictoriaLogs instance\n- Listing available streams, fields, field values\n- Query statistics for the logs as metrics\n- UI with setup instructions and tools inspection on the root endpoint (only in Streamable HTTP mode)\n \nIn addition, the MCP server contains embedded up-to-date documentation and is able to search it without online access.\n\n![image](./ui.png)\n\nMore details about the exact available tools and prompts can be found in the [Usage](#usage) section.\n\nYou can combine functionality of tools, docs search in your prompts and invent great usage scenarios for your VictoriaLogs instance.\nAnd 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.\n\nYou can also combine the MCP server with other observability or doc search related MCP Servers and get even more powerful results.\n\n## Try without installation\n\nThere is a publicly available instance of the VictoriaMetrics MCP Server that you can use to test the features without installing it: \n\n```\nhttps://play-vmlogs-mcp.victoriametrics.com/mcp\n```\n\n**Attention!** This URL is not supposed to be opened in a browser, it is intended to be used in MCP clients.\n\nIt's available in [Streamable HTTP Mode](#modes) mode and configured to work with [Public VictoriaLogs Playground](https://play-vmlogs.victoriametrics.com).\n\nHere is example of configuration for [Claude Desktop](https://claude.ai/download):\n\n![image](https://github.com/user-attachments/assets/938d9eb9-f188-42f1-8377-a283be454ac7)\n\n## Requirements\n\n- [VictoriaLogs](https://docs.victoriametrics.com/victorialogs/) instance: ([single-node](https://docs.victoriametrics.com/victorialogs/) or [cluster](https://docs.victoriametrics.com/victorialogs/cluster/))\n- Go 1.26 or higher (if you want to build from source)\n\n## Installation\n\n### Go\n\n```bash\ngo install github.com/VictoriaMetrics/mcp-victorialogs/cmd/mcp-victorialogs@latest\n```\n\n### Binaries\n\nJust download the latest release from [Releases](https://github.com/VictoriaMetrics/mcp-victorialogs/releases) page and put it to your PATH.\n\nExample for Linux x86_64 (note that other architectures and platforms are also available):\n\n```bash\nlatest=$(curl -s https://api.github.com/repos/VictoriaMetrics/mcp-victorialogs/releases/latest | grep 'tag_name' | cut -d\\\" -f4)\nwget https://github.com/VictoriaMetrics/mcp-victorialogs/releases/download/$latest/mcp-victorialogs_Linux_x86_64.tar.gz\ntar axvf mcp-victorialogs_Linux_x86_64.tar.gz\n```\n\n### Docker\n\nYou can run VictoriaLogs MCP Server using Docker.\n\nThis is the easiest way to get started without needing to install Go or build from source.\n\n```bash\ndocker run -d --name mcp-victorialogs \\\n  -e VL_INSTANCE_ENTRYPOINT=https://play-vmlogs.victoriametrics.com \\\n  -e MCP_SERVER_MODE=http \\\n  -e MCP_LISTEN_ADDR=:8081 \\\n  -p 8081:8081 \\\n  ghcr.io/victoriametrics/mcp-victorialogs\n```\n\nYou should replace environment variables with your own parameters.\n\nNote that the `MCP_SERVER_MODE=http` flag is used to enable Streamable HTTP mode. \nMore details about server modes can be found in the [Configuration](#configuration) section.\n\nSee available docker images in [github registry](https://github.com/orgs/VictoriaMetrics/packages/container/package/mcp-victorialogs).\n\nAlso see [Using Docker instead of binary](#using-docker-instead-of-binary) section for more details about using Docker with MCP server with clients in stdio mode.\n\n\n### Source Code\n\nFor building binary from source code you can use the following approach:\n\n- Clone repo:\n\n  ```bash\n  git clone https://github.com/VictoriaMetrics/mcp-victorialogs.git\n  cd mcp-victorialogs\n  ```\n- Build binary from cloned source code:\n\n  ```bash\n  make build\n  # after that you can find binary mcp-victorialogs and copy this file to your PATH or run inplace\n  ```\n- Build image from cloned source code:\n\n  ```bash\n  docker build -t mcp-victorialogs .\n  # after that you can use docker image mcp-victorialogs for running or pushing\n  ```\n\n### Helm\n\nCheck out [VictoriaLogs MCP Server Helm chart](https://docs.victoriametrics.com/helm/victoria-logs-mcp/) documentation for more details about installation using Helm.\n\n## Configuration\n\nMCP Server for VictoriaLogs is configured via environment variables:\n\n| Variable                   | Description                                                                                                                                                                                                                                                         | Required | Default          | Allowed values                   |\n|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|------------------|----------------------------------|\n| `VL_INSTANCE_ENTRYPOINT`   | URL to VictoriaLogs instance                                                                                                                                                                                                                                        | Yes      | -                | -                                |\n| `VL_INSTANCE_BEARER_TOKEN` | Authentication token for VictoriaLogs API                                                                                                                                                                                                                           | No       | -                | -                                |\n| `VL_INSTANCE_HEADERS`      | Custom HTTP headers to send with requests (comma-separated key=value pairs)                                                                                                                                                                                         | No       | -                | -                                |\n| `MCP_PASSTHROUGH_HEADERS`  | HTTP 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       | -                | -                                |\n| `VL_DEFAULT_TENANT_ID`     | Default tenant ID used when tenant is not specified in requests (format: `AccountID:ProjectID` or `AccountID`)                                                                                                                                                      | No       | `0:0`            | -                                |\n| `MCP_SERVER_MODE`          | Server operation mode. See [Modes](#modes) for details.                                                                                                                                                                                                             | No       | `stdio`          | `stdio`, `sse`, `http`           |\n| `MCP_LISTEN_ADDR`          | Address for SSE or HTTP server to listen on                                                                                                                                                                                                                         | No       | `localhost:8081` | -                                |\n| `MCP_DISABLED_TOOLS`       | Comma-separated list of tools to disable                                                                                                                                                                                                                            | No       | -                | -                                |\n| `MCP_HEARTBEAT_INTERVAL`   | Defines 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) | No       | `30s`            | -                                |\n| `MCP_LOG_FORMAT`           | Log output format                                                                                                                                                                                                                                                   | No       | `text`           | `text`, `json`                   |\n| `MCP_LOG_LEVEL`            | Minimum log level                                                                                                                                                                                                                                                   | No       | `info`           | `debug`, `info`, `warn`, `error` |\n\n### Modes\n\nMCP Server supports the following modes of operation (transports):\n\n- `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.\n- `sse` - Server-Sent Events. Server will expose the `/sse` and `/message` endpoints for SSE connections.\n- `http` - Streamable HTTP. Server will expose the `/mcp` endpoint for HTTP connections.\n\nMore info about transports you can find in MCP docs:\n\n- [Core concepts -> Transports](https://modelcontextprotocol.io/docs/concepts/transports)\n- [Specifications -> Transports](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports)\n\n### Сonfiguration examples\n\n```bash\n# For a public playground\nexport VL_INSTANCE_ENTRYPOINT=\"https://play-vmlogs.victoriametrics.com\"\n\n# Custom headers for authentication (e.g., behind a reverse proxy)\n# Expected syntax is key=value separated by commas\nexport VL_INSTANCE_HEADERS=\"<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>\"\n\n# Forward specific headers from incoming MCP requests to VictoriaLogs\nexport MCP_PASSTHROUGH_HEADERS=\"X-Token,X-Access-Key\"\n\n# Server mode\nexport MCP_SERVER_MODE=\"sse\"\nexport MCP_SSE_ADDR=\"0.0.0.0:8081\"\nexport MCP_DISABLED_TOOLS=\"hits,facets\"\n```\n\n## Endpoints\n\nIn SSE and HTTP modes the MCP server provides the following endpoints:\n\n| Endpoint            | Description                                                                                      |\n|---------------------|--------------------------------------------------------------------------------------------------|\n| `/`                 | Landing page with setup help and tool inspection (HTTP mode only)                                |\n| `/sse` + `/message` | Endpoints for messages in SSE mode (for MCP clients that support SSE)                            |\n| `/mcp`              | HTTP endpoint for streaming messages in HTTP mode (for MCP clients that support Streamable HTTP) |\n| `/metrics`          | Metrics in Prometheus format for monitoring the MCP server                                       |\n| `/health/liveness`  | Liveness check endpoint to ensure the server is running                                          |\n| `/health/readiness` | Readiness check endpoint to ensure the server is ready to accept requests                        |\n\n## Setup in clients\n\n### Cursor\n\nGo to: `Settings` -> `Cursor Settings` -> `MCP` -> `Add new global MCP server` and paste the following configuration into your Cursor `~/.cursor/mcp.json` file:\n\n```json\n{\n  \"mcpServers\": {\n    \"victorialogs\": {\n      \"command\": \"/path/to/mcp-victorialogs\",\n      \"env\": {\n        \"VL_INSTANCE_ENTRYPOINT\": \"<YOUR_VL_INSTANCE>\",\n        \"VL_INSTANCE_BEARER_TOKEN\": \"<YOUR_VL_BEARER_TOKEN>\",\n        \"VL_INSTANCE_HEADERS\": \"<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>\"\n      }\n    }\n  }\n}\n```\n\nSee [Cursor MCP docs](https://docs.cursor.com/context/model-context-protocol) for more info.\n\n### Claude Desktop\n\nAdd this to your Claude Desktop `claude_desktop_config.json` file (you can find it if open `Settings` -> `Developer` -> `Edit config`):\n\n```json\n{\n  \"mcpServers\": {\n    \"victorialogs\": {\n      \"command\": \"/path/to/mcp-victorialogs\",\n      \"env\": {\n        \"VL_INSTANCE_ENTRYPOINT\": \"<YOUR_VL_INSTANCE>\",\n        \"VL_INSTANCE_BEARER_TOKEN\": \"<YOUR_VL_BEARER_TOKEN>\",\n        \"VL_INSTANCE_HEADERS\": \"<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>\"\n      }\n    }\n  }\n}\n```\n\nSee [Claude Desktop MCP docs](https://modelcontextprotocol.io/quickstart/user) for more info.\n\n### Claude Code\n\nRun the command:\n\n```sh\nclaude mcp add victorialogs -- /path/to/mcp-victorialogs \\\n  -e VL_INSTANCE_ENTRYPOINT=<YOUR_VL_INSTANCE> \\\n  -e VL_INSTANCE_BEARER_TOKEN=<YOUR_VL_BEARER_TOKEN> \\\n  -e VL_INSTANCE_HEADERS=\"<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>\"\n```\n\nSee [Claude Code MCP docs](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#set-up-model-context-protocol-mcp) for more info.\n\n### Codex\n\nCodex CLI and the IDE extension use the same MCP configuration file: `~/.codex/config.toml`\n(or `.codex/config.toml` in a trusted project).\n\nRun the command:\n\n```sh\ncodex mcp add victorialogs \\\n  --env VL_INSTANCE_ENTRYPOINT=<YOUR_VL_INSTANCE> \\\n  --env VL_INSTANCE_BEARER_TOKEN=<YOUR_VL_BEARER_TOKEN> \\\n  --env VL_INSTANCE_HEADERS=\"<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>\" \\\n  -- /path/to/mcp-victorialogs\n```\n\nOr add the following to your Codex `~/.codex/config.toml` file:\n\n```toml\n[mcp_servers.victorialogs]\ncommand = \"/path/to/mcp-victorialogs\"\n\n[mcp_servers.victorialogs.env]\nVL_INSTANCE_ENTRYPOINT = \"<YOUR_VL_INSTANCE>\"\nVL_INSTANCE_BEARER_TOKEN = \"<YOUR_VL_BEARER_TOKEN>\"\nVL_INSTANCE_HEADERS = \"<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>\"\n```\n\nIf you run the server in Streamable HTTP mode, you can register it with:\n\n```sh\ncodex mcp add victorialogs --url http://localhost:8081/mcp\n```\n\nSee [Codex MCP docs](https://developers.openai.com/codex/mcp) for more info.\n\n### Visual Studio Code\n\nAdd this to your VS Code MCP config file:\n\n```json\n{\n  \"servers\": {\n    \"victorialogs\": {\n      \"type\": \"stdio\",\n      \"command\": \"/path/to/mcp-victorialogs\",\n      \"env\": {\n        \"VL_INSTANCE_ENTRYPOINT\": \"<YOUR_VL_INSTANCE>\",\n        \"VL_INSTANCE_BEARER_TOKEN\": \"<YOUR_VL_BEARER_TOKEN>\",\n        \"VL_INSTANCE_HEADERS\": \"<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>\"\n      }\n    }\n  }\n}\n```\n\nSee [VS Code MCP docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more info.\n\n### Zed\n\nAdd the following to your Zed config file:\n\n```json\n  \"context_servers\": {\n    \"victorialogs\": {\n      \"command\": {\n        \"path\": \"/path/to/mcp-victorialogs\",\n        \"args\": [],\n        \"env\": {\n                  \"VL_INSTANCE_ENTRYPOINT\": \"<YOUR_VL_INSTANCE>\",\n        \"VL_INSTANCE_BEARER_TOKEN\": \"<YOUR_VL_BEARER_TOKEN>\",\n        \"VL_INSTANCE_HEADERS\": \"<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>\"\n      }\n      },\n      \"settings\": {}\n    }\n  }\n}\n```\n\nSee [Zed MCP docs](https://zed.dev/docs/ai/mcp) for more info.\n\n### JetBrains IDEs\n\n- Open `Settings` -> `Tools` -> `AI Assistant` -> `Model Context Protocol (MCP)`.\n- Click `Add (+)`\n- Select `As JSON`\n- Put the following to the input field:\n\n```json\n{\n  \"mcpServers\": {\n    \"victorialogs\": {\n      \"command\": \"/path/to/mcp-victorialogs\",\n      \"env\": {\n        \"VL_INSTANCE_ENTRYPOINT\": \"<YOUR_VL_INSTANCE>\",\n        \"VL_INSTANCE_BEARER_TOKEN\": \"<YOUR_VL_BEARER_TOKEN>\",\n        \"VL_INSTANCE_HEADERS\": \"<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>\"\n      }\n    }\n  }\n}\n```\n\n### Windsurf\n\nAdd the following to your Windsurf MCP config file.\n\n```json\n{\n  \"mcpServers\": {\n    \"victorialogs\": {\n      \"command\": \"/path/to/mcp-victorialogs\",\n      \"env\": {\n        \"VL_INSTANCE_ENTRYPOINT\": \"<YOUR_VL_INSTANCE>\",\n        \"VL_INSTANCE_BEARER_TOKEN\": \"<YOUR_VL_BEARER_TOKEN>\",\n        \"VL_INSTANCE_HEADERS\": \"<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>\"\n      }\n    }\n  }\n}\n```\n\nSee [Windsurf MCP docs](https://docs.windsurf.com/windsurf/mcp) for more info.\n\n### Using Docker instead of binary\n\nYou can run VictoriaLogs MCP Server using Docker instead of local binary.\n\nYou should replace run command in configuration examples above in the following way:\n\n```\n{\n  \"mcpServers\": {\n    \"victorialogs\": {\n      \"command\": \"docker\",\n        \"args\": [\n          \"run\",\n          \"-i\", \"--rm\",\n          \"-e\", \"VL_INSTANCE_ENTRYPOINT\",\n          \"-e\", \"VL_INSTANCE_BEARER_TOKEN\",\n          \"-e\", \"VL_INSTANCE_HEADERS\",\n          \"ghcr.io/victoriametrics/mcp-victorialogs\",\n        ],\n      \"env\": {\n        \"VL_INSTANCE_ENTRYPOINT\": \"<YOUR_VL_INSTANCE>\",\n        \"VL_INSTANCE_BEARER_TOKEN\": \"<YOUR_VL_BEARER_TOKEN>\",\n        \"VL_INSTANCE_HEADERS\": \"<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>\"\n      }\n    }\n  }\n}\n```\n\n## Usage\n\nAfter [installing](#installation) and [configuring](#setup-in-clients) the MCP server, you can start using it with your favorite MCP client.\n\nYou can start dialog with AI assistant from the phrase:\n\n```\nUse MCP VictoriaLogs in the following answers\n```\n\nBut it's not required, you can just start asking questions and the assistant will automatically use the tools and documentation to provide you with the best answers.\n\n### Toolset\n\nMCP VictoriaLogs provides numerous tools for interacting with your VictoriaLogs instance.\n\nHere's a list of available tools:\n\n| Tool                 | Description                                           |\n|----------------------|-------------------------------------------------------|\n| `documentation`      | Search in embedded VictoriaLogs documentation         |\n| `facets`             | Most frequent values per each log field               |\n| `field_names`        | List of field names for the query                     |\n| `field_values`       | List of field values for the query                    |\n| `flags`              | View non-default flags of the VictoriaLogs instance   |\n| `hits`               | The number of matching log entries grouped by buckets |\n| `query`              | Execute LogsQL queries                                |\n| `stats_query`        | Querying log stats for the given time                 |\n| `stats_query_range`  | Querying log stats on the given time range            |\n| `stream_field_names` | List of stream fields for the query                   |\n| `stream_field_values` | List of stream field values for the query             |\n| `stream_ids`         | List of stream IDs for the query                      |\n| `streams`            | List of streams for the query                         |\n\n### Prompts\n\nThe server includes pre-defined prompts for common tasks.\n\nThese are just examples at the moment, the prompt library will be added to in the future:\n\n| Prompt | Description                                           |\n|--------|-------------------------------------------------------|\n| `documentation` | Search VictoriaLogs documentation for specific topics |\n\n## FAQ\n\n### Why is the MCP server using more resources than I would expect from a simple API proxy?\n\nThe server contains an embedded vector database with VictoriaMetrics documentation and blog posts for the `documentation` tool.\nIt helps to answer complex questions about VictoriaLogs without providing all data to LLM.  \nThis is the main source of resource usage. To reduce it, add `documentation` to `MCP_DISABLED_TOOLS` environment variable to completely disable the vector database loading.\n\n### How to use one MCP server instance for several VictoriaMetrics instances?\n\nYou can use `MCP_PASSTHROUGH_HEADERS` parameter in the MCP Server together with [Header-based routing in vmauth](https://docs.victoriametrics.com/victoriametrics/vmauth/#routing-by-header) to route MCP calls between instances based on HTTP header values from your MCP client config.\n\n## Roadmap\n\n- [ ] Support \"Explain query\" tool\n- [ ] Support optional integration with [VictoriaMetrics Cloud](https://victoriametrics.com/products/cloud/)  \n- [ ] Add some extra knowledge to server in addition to current documentation tool:\n  - [x] [VictoriaMetrics blog](https://victoriametrics.com/blog/) posts\n  - [ ] Github issues\n  - [ ] Public slack chat history\n  - [ ] CRD schemas\n- [ ] Implement multitenant version of MCP (that will support several deployments)\n- [ ] Add flags/configs validation tool\n- [x] Enabling/disabling tools via configuration\n\n## Disclaimer\n\nAI services and agents along with MCP servers like this cannot guarantee the accuracy, completeness and reliability of results.\nYou should double check the results obtained with AI.\n\nThe 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.\n\n## Contributing\n\nContributions to the MCP VictoriaLogs project are welcome! \n\nPlease feel free to submit issues, feature requests, or pull requests.\n",
  "bytes": 22741,
  "sha": "bb66760ebb80a8304748af32ccfb54759ca76d9a96e4ec77d98802d97172a259",
  "repo_slug": "victoriametrics/mcp-victorialogs",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_victoriametrics_mcp_victorialo_91f65a60/readme"
}