Purpose
mcp-victorialogs is a Model Context Protocol (MCP) server implementation for VictoriaLogs. It provides access to VictoriaLogs instances and integrates seamlessly with the VictoriaLogs API and documentation, offering a comprehensive interface for logging, observability, and debugging tasks, with advanced automation and interaction capabilities for engineers and tools.
Key Capabilities
This MCP server allows using almost all read-only APIs of VictoriaLogs, i.e., all functionality available in the Web UI:
- Query logs and explore log data
- Display the parameters of a VictoriaLogs instance
- List available streams, fields, field values
- Query log statistics as metrics
- Provide a UI with setup instructions and tool checks at the root endpoint (Streamable HTTP mode only)
In addition, the MCP server has the latest documentation built in, allowing searches without an internet connection.
Tool functionality and documentation search can be combined into prompts to design use cases for VictoriaLogs instances. The quality of the MCP server and its responses depends largely on the capabilities of the client used and the quality of the model. This MCP server can also be combined with other MCP servers related to observability or documentation search.
Usage
Try Without Installation
There is a publicly available VictoriaMetrics MCP Server instance that can be used to test functionality without installation. Note: this URL should not be opened in a browser, but used for MCP clients. It is provided in Streamable HTTP mode and is configured to work with the Public VictoriaLogs Playground.
Prerequisites
- A VictoriaLogs instance (single-node or cluster)
- Go 1.26 or later (if building from source)
Installation
Download the latest version from the Releases page and place it in your PATH. Linux x86_64 example (other architectures and platforms are also available).
You can also run the VictoriaLogs MCP Server using Docker, which is the simplest way to avoid installing Go or building from source.You need to replace the environment variables with your own parameters. Note that the MCP_SERVER_MODE=http flag is used to enable Streamable HTTP mode. Available docker images can be found on the github registry.
Build the binary from source:
git clone https://github.com/VictoriaMetrics/mcp-victorialogs.git
cd mcp-victorialogs
make build
After building, you can find the binary file mcp-victorialogs in the directory; copy it to your PATH or run it in place.
Build the image:
docker build -t mcp-victorialogs .
After building, you can run or push using the Docker image mcp-victorialogs.
For more details on installing with Helm, refer to the VictoriaLogs MCP Server Helm chart documentation.
Configuration
MCP Server for VictoriaLogs is configured through environment variables.
The server supports the following operating modes (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. The server will expose the /sse and /message endpoints for SSE connections.
- http: Streamable HTTP. The server will expose the /mcp endpoint for HTTP connections.
In SSE and HTTP modes, the MCP server provides the corresponding endpoints.
Client setup
- Cursor: Settings -> Cursor Settings -> MCP -> Add new global MCP server, paste the configuration into the ~/.cursor/mcp.json file.
- Claude Desktop: Add to the claude_desktop_config.json file (Settings -> Developer -> Edit config).
- Claude Code: Run the corresponding command.
- Codex CLI and IDE extensions use the same MCP configuration file: ~/.codex/config.toml (or .codex/config.toml in a trusted project). If you run the server in Streamable HTTP mode, you can register it.
- Visual Studio Code: Add to the VS Code MCP configuration file.
- Zed: Add to the Zed configuration file.
- Windsurf: Open Settings -> Tools -> AI Assistant -> Model Context Protocol (MCP), put the configuration into the input field, or add it to the Windsurf MCP configuration file.
Usage Docker instead of the binary
In the configuration examples, you can replace the run command with running via Docker.
Getting started
After installing and configuring the MCP server, you can use it in your favorite MCP client. You can start a conversation with the AI assistant from a specific phrase, but it is not required; you can ask questions directly, and the assistant will automatically use tools and documentation to provide the best answer.
MCP VictoriaLogs provides a large number of tools for interacting with VictoriaLogs instances, and the server also includes predefined prompts for common tasks. These are currently just examples, and the prompt library will continue to be expanded in the future.
Use cases
- Log querying and log data exploration
- Observability and debugging of VictoriaLogs instances
- Viewing instance parameters, streams, fields, and field values
- Querying log statistics as metrics
- Offline documentation search combined with built-in documentation
- Use in combination with other observability or documentation search MCP servers
Limitations and considerations
- The server uses the read-only API of VictoriaLogs.
- Regarding resource usage: the server includes a built-in vector database (containing VictoriaMetrics documentation and blog posts) for the documentation tools, which is the main source of resource usage. You can completely disable vector database loading by adding documentation to the MCP_DISABLED_TOOLS environment variable.
- If you want to use one MCP server instance to serve multiple VictoriaMetrics instances, you can use the MCP_PASSTHROUGH_HEADERS parameter in the MCP Server, combined with header-based routing in vmauth, to route MCP calls between instances based on the HTTP header values in the MCP client configuration.
- AI services and agents, as well as such MCP servers, cannot guarantee the accuracy, completeness, and reliability of results; the results obtained by AI should be reviewed.
- The quality of the MCP server and its responses depends largely on the capabilities of the client used and the quality of the model.
Roadmap (mentioned in the materials)
- Support for the "Explain query" tool
- Support for optional VictoriaMetrics Cloud integration
- Add additional knowledge to the server beyond the existing documentation tools: VictoriaMetrics blog posts, Github issues, public Slack chat history, CRD schemas
- Implement a multi-tenant version of MCP (supporting multiple deployments)
- Add flags/configs validation tool
- Enable/disable tools via configuration
Contributing
Contributions to the MCP VictoriaLogs project are welcome, including issues, feature requests, or pull requests.