victorialogs-mcp
Provides read-only tools for querying and investigating VictoriaLogs (VictoriaMetrics' log database) over its LogsQL query API. Capabilities include searching logs by query with pagination, looking up logs by exact ID or stream ID, discovering streams, field names and field values, computing hit/trend histograms over time buckets, and running arbitrary aggregation queries such as stats grouped by field.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@victorialogs-mcp search logs for timeout errors in the last 30 minutes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
victoria-logs-mcp
Read-only VictoriaLogs MCP server for AI log investigation over stdio. Built with TypeScript, the official MCP SDK, Zod and undici.
Requires Node.js >=22.12 and a reachable VictoriaLogs query endpoint.
Package: @alexbuzo/victoria-logs-mcp. Executable: victorialogs-mcp.
Run from source
git clone https://github.com/abuzo/victoria-logs-mcp.git
cd victoria-logs-mcp
npm ci
npm test
node dist/cli.js --victorialogs-url http://localhost:9428The process waits for MCP JSON-RPC on stdin. To see options, use --help.
Configuration can come from CLI flags, environment variables or a local .env
(see .env.example). CLI flags override environment settings.
VICTORIALOGS_URL=https://logs.example.com \
VICTORIALOGS_TOKEN=your-bearer-token \
node dist/cli.jsFor Basic auth, use VICTORIALOGS_USERNAME and VICTORIALOGS_PASSWORD
instead of the token. Anonymous access is supported. Authentication normally
belongs to your vmauth/reverse proxy configuration. AccountID/ProjectID are
VictoriaLogs storage tenants; the normalized tenant_id log field is unrelated.
Related MCP server: Elastic MCP Server
Connect an MCP client
After the first npm release, use this configuration for Cursor or other clients
accepting mcpServers JSON:
{
"mcpServers": {
"victorialogs": {
"command": "npx",
"args": ["-y", "@alexbuzo/victoria-logs-mcp@0.1.0"],
"env": {
"VICTORIALOGS_URL": "https://logs.example.com",
"VICTORIALOGS_TOKEN": "YOUR_BEARER_TOKEN",
"VICTORIALOGS_ACCOUNT_ID": "0",
"VICTORIALOGS_PROJECT_ID": "0"
}
}
}
}Replace the example connection values. For a local build before publishing,
use "command": "node" and "args": ["/absolute/path/to/victoria-logs-mcp/dist/cli.js"].
For Basic auth, replace VICTORIALOGS_TOKEN with VICTORIALOGS_USERNAME and
VICTORIALOGS_PASSWORD. Omit all three for anonymous access.
To install a local package without publishing:
npm pack
npm install -g ./alexbuzo-victoria-logs-mcp-0.1.0.tgz
victorialogs-mcp --url http://localhost:9428Configuration
CLI | Environment variable | Default |
|
| required |
|
| none (Bearer auth) |
|
| none (Basic auth) |
|
| none (Basic auth) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Boolean env settings accept true or false. Basic auth requires both username
and password and cannot be combined with a token. Tenant IDs are uint32 values.
Use the single-node root URL or a vlselect/proxy base URL whose query routes
are under /select/logsql/. Proxy prefixes such as https://host/logs are
preserved. URL credentials, query strings and fragments are rejected.
TLS verification is enabled. For a private CA, use NODE_EXTRA_CA_CERTS.
--ssl-verify=false applies only to this server's HTTP client. Request failures
do not echo upstream response bodies or secrets. Stdout contains only MCP traffic;
startup diagnostics use stderr. Requests are not retried or redirected.
Tools
All names begin with victorialogs. and use LogsQL, not Graylog Lucene or
Loki LogQL. Tools are read-only; there are no ingestion, deletion or admin tools.
Common inputs:
rangeSec: trailing seconds, default3600;search_uuiddefaults to86400.startandend: optional paired ISO-8601 timestamps with timezone. They overriderangeSec; end is exclusive. Input precision is at most milliseconds; finer fractions are rejected explicitly. Returned timestamps are UTC. Use these fixed bounds for pagination. Maximum relative window: 365 days.filter: optional additional LogsQL filter, sent asextra_filtersseparately from the main query, so query pipelines stay intact.
Tool | Inputs in addition to time/filter | Result |
| required | Normalized messages, original |
| required | Exact ID field matches plus phrase search in |
| required | Logs from |
|
|
|
|
|
|
| required |
|
|
|
|
| required | Raw aggregation/query rows with returned |
All results include query_used, start and end. count is the number of
returned rows, not a count of every matching log in storage. Discovery uses a
bounded subset; stream hit counts can be zeroed by the backend when its limit is
reached. Hits allows up to 10000 aligned time buckets; groupsLimit returns top
groups plus an overflow group with fields: {}. Grouped series and all other
responses are additionally constrained by the byte limit and request deadline.
query_stats uses the JSON Lines query API, preserving arbitrary aggregation
columns. It does not expose the Prometheus-compatible stats endpoints.
Examples of MCP arguments:
{"query":"level:=error AND app:=api","rangeSec":3600,"limit":100}{"uuid":"550e8400-e29b-41d4-a716-446655440000","rangeSec":86400}{"query":"level:=error | stats by (app) count() as errors","rangeSec":3600}{"query":"app:=api","stepSec":60,"fields":["level"],"rangeSec":3600}Search result example:
{
"count": 1,
"query_used": "level:=error",
"start": "2026-10-19T09:00:00.000Z",
"end": "2026-10-19T10:00:00.000Z",
"messages": [{
"ts": "2026-10-19T09:30:00Z",
"message": "connection failed",
"level": "error",
"trace_id": "abc",
"fields": {"_time":"2026-10-19T09:30:00Z","_msg":"connection failed","level":"error","traceId":"abc"}
}]
}Aliases normalize common service/container, request/trace/span, HTTP and source
fields. Original fields are retained so Kubernetes/OTel or custom
data is available. Tool failures return isError: true. Narrow the query or lower
limit if the response exceeds the byte cap. Logs are untrusted data and can
contain text resembling instructions.
Development and verification
npm ci
npm run dev -- --url http://localhost:9428
npm test
npm pack --dry-runTests cover HTTP encoding, tenant/auth, NDJSON, bounds, cancellation, errors, MCP discovery/calls and real subprocess stdio. A separate smoke script inserts synthetic logs, so only run it against a disposable test instance:
docker run -d --rm --name victorialogs-mcp-test \
-p 127.0.0.1:19428:9428 victoriametrics/victoria-logs:v1.53.0
npm run build
VICTORIALOGS_SMOKE_URL=http://127.0.0.1:19428 node scripts/smoke.mjs
docker stop victorialogs-mcp-testThe smoke test checks all eight tools through stdio against real VictoriaLogs, including literal ID escaping, stream discovery, aggregation and query errors.
Design and references
The official implementation informed the API selection; no source code was copied or vendored. This project is an independent TypeScript implementation.
Publish to npm
The first release must be published by an npm account with permission to publish
under the @alexbuzo scope:
npm login
npm ci
npm test
npm publish --dry-run
npm publish --access publicprepublishOnly runs the tests and prepack builds the package. The package
allowlist includes compiled runtime files, TypeScript declarations, README and
MIT license; tests, environment files and local configuration are excluded.
Use npm's interactive authentication/OTP prompts as required by your account.
MIT © Aliaksei Buzo.
Available Tools
8 toolsvictorialogs.field_namesBRead-onlyIdempotent
Discover available log field names and hit counts. Results are bounded; use query/filter to narrow scope.
Inputs: end, limit, query, start, +2 more.
victorialogs.field_valuesCRead-onlyIdempotent
Discover values and hit counts for a required field in a bounded time window.
Inputs: field (required), end, limit, query, +3 more.
victorialogs.hitsBRead-onlyIdempotent
Count logs over time with stepSec buckets (default 60s), optionally grouped by fields. groupsLimit (default 20, max 100) returns top groups plus an overflow group. Maximum 10000 time buckets; default window last hour.
Inputs: end, query, start, fields, +4 more.
victorialogs.list_streamsARead-onlyIdempotent
Discover stream IDs and hits. Values are _stream_id strings usable by search_stream. A limited subset can have zeroed hit counts.
Inputs: end, limit, query, start, +2 more.
victorialogs.query_statsARead-onlyIdempotent
Execute a LogsQL aggregation pipeline, e.g. * | stats by (service) count() as errors. Returns original JSON rows without log normalization. Uses /select/logsql/query, not the Prometheus stats API. Default last hour, max 500 rows.
Inputs: query (required), end, limit, start, +3 more.
victorialogs.search_logsARead-onlyIdempotent
Search VictoriaLogs with LogsQL. Default: last hour, 150 latest rows; max 500. Use rangeSec or paired ISO start/end (end exclusive). filter is a separate LogsQL extra_filters constraint. offset paginates the selected window; keep start/end fixed across pages.
Inputs: query (required), end, limit, start, +3 more.
victorialogs.search_streamARead-onlyIdempotent
Search a VictoriaLogs stream by its 48-character hex _stream_id. Discover IDs via list_streams. Default window: last hour.
Inputs: streamId (required), end, limit, start, +2 more.
victorialogs.search_uuidBRead-onlyIdempotent
Find a UUID, trace, request or correlation ID across common exact-value fields plus a phrase in _msg. Default window: last day.
Inputs: uuid (required), end, limit, start, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
The eight tools mostly target distinct outputs: raw log retrieval (search_logs), stream discovery, field discovery, value discovery, time-bucketed counts (hits), aggregation pipelines (query_stats), and a UUID lookup convenience wrapper. However, search_logs, query_stats, hits, and search_uuid all run LogsQL-style queries over logs with overlapping capability, and only the detailed descriptions keep them apart.
All names share the victorialogs. prefix and snake_case, which aids readability. But the internal pattern is mixed: search_stream/search_logs/search_uuid are verb_noun, list_streams is verb_noun, field_names/field_values are noun phrases, and hits/query_stats are bare noun/verb forms, so there is no single predictable convention.
Eight tools is well-scoped for a log-search backend, with each tool covering a distinct capability (search, discovery, aggregation, counting, ID lookup) rather than redundant variants. Nothing feels padded or missing.
The surface covers stream discovery, field/value discovery, raw search, UUID lookup, time-bucketed counting, and aggregation, which is broad lifecycle coverage for querying logs. Minor gaps exist (no explicit schema/field-type or export/tail tool), but agents can work around them via LogsQL.
Maintenance
Related MCP Connectors
A paid remote MCP for AI SDK data query MCP, built to return verdicts, receipts, usage logs, and aud
Read-only Google Analytics 4 MCP server for AI assistants.
Read-only Google Search Console MCP server for AI assistants.
A paid remote MCP for AI SDK MCP gateway registry, built to return verdicts, receipts, usage logs, a
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceA read-only MCP server that exposes Quickwit log search and aggregations to LLM clients, enabling natural language log investigation.Apache 2.0
- AlicenseAqualityDmaintenanceA read-only MCP server that gives AI assistants natural language access to Elasticsearch/Kibana logs for querying and analysis.71MIT

Auralogs MCP Serverofficial
AlicenseNot gradedqualityDmaintenanceA read-only MCP server for the Auralogs logging platform, enabling AI agents to query production logs, search errors, and retrieve AI analyses without write access. It allows you to ask your coding assistant 'what's broken in production right now?' by connecting to your logs via a simple bearer auth key.MIT- AlicenseAqualityDmaintenanceA read-only MCP server for querying Sumo Logic logs, enabling AI assistants to search and investigate application logs with opinionated tools and secure credential handling.517 npm1MIT