Skip to main content
Glama

VictoriaLogs MCP 服务器

最新版本 铁匠徽章 执照松弛十Reddit

VictoriaLogs模型上下文协议 (MCP)服务器的实现。

这可以访问您的 VictoriaLogs 实例,并与VictoriaLogs API文档无缝集成。它可以为您提供与 VictoriaLogs 实例相关的日志、可观察性和调试任务的全面界面,并为工程师和工具提供高级自动化和交互功能。

特征

此 MCP 服务器允许您使用 VictoriaLogs 的几乎所有只读 API,即Web UI中可用的所有功能:

  • 查询日志和探索日志数据

  • 显示您的 VictoriaLogs 实例的参数

  • 列出可用的流、字段、字段值

  • 查询日志的统计数据作为指标

此外,MCP 服务器包含嵌入式最新文档,无需在线访问即可搜索。

有关确切可用工具和提示的更多详细信息,请参阅使用部分。

您可以将工具和文档搜索功能组合到您的提示中,为您的 VictoriaLogs 实例创建出色的使用场景。请注意,MCP 服务器及其响应的质量在很大程度上取决于您的客户端功能以及您所使用的模型的质量。

您还可以将 MCP 服务器与其他可观察性或文档搜索相关的 MCP 服务器相结合,以获得更强大的结果。

Related MCP server: Vectara MCP server

要求

安装

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

源代码

git clone https://github.com/VictoriaMetrics-Community/mcp-victorialogs.git cd mcp-victorialogs go build -o bin/mcp-victorialogs ./cmd/mcp-victorialogs/main.go # after that add bin/mcp-victorialogs file to your PATH

二进制文件

只需从发布页面下载最新版本并将其放入您的 PATH 即可。

Docker

即将推出...

锻造工艺

要通过Smithery自动为您的客户端安装 VictoriaLogs MCP 服务器,您可以使用以下命令:

# Get the list of supported MCP clients npx -y @smithery/cli list clients #Available clients: # claude # cline # windsurf # roocode # witsy # enconvo # cursor # vscode # vscode-insiders # boltai # amazon-bedrock # Install VictoriaLogs MCP server for your client npx -y @smithery/cli install @VictoriaMetrics-Community/mcp-victorialogs --client <YOUR-CLIENT-NAME> # and follow the instructions

配置

VictoriaLogs 的 MCP 服务器通过环境变量进行配置:

多变的

描述

必需的

默认

允许值

VL_INSTANCE_ENTRYPOINT

VictoriaLogs 实例的 URL

是的

-

-

VL_INSTANCE_BEARER_TOKEN

VictoriaLogs API 的身份验证令牌

-

-

MCP_SERVER_MODE

服务器运行模式

stdio

stdio

sse

MCP_SSE_ADDR

SSE 服务器监听的地址

:8081

-

配置示例

# For a public playground export VL_INSTANCE_ENTRYPOINT="https://play-vmlogs.victoriametrics.com" # Server mode export MCP_SERVER_MODE="sse" export MCP_SSE_ADDR="0.0.0.0:8081"

在客户端中设置

光标

前往: Settings -> Cursor Settings -> MCP -> Add new global MCP server ,并将以下配置粘贴到您的 Cursor ~/.cursor/mcp.json文件中:

{ "mcpServers": { "victorialogs": { "command": "/path/to/mcp-victorialogs", "env": { "VL_INSTANCE_ENTRYPOINT": "<YOUR_VL_INSTANCE>", "VL_INSTANCE_BEARER_TOKEN": "<YOUR_VL_BEARER_TOKEN>" } } } }

请参阅Cursor MCP 文档以了解更多信息。

克劳德桌面

将其添加到您的 Claude Desktop claude_desktop_config.json文件中(打开Settings -> Developer -> Edit config即可找到它):

{ "mcpServers": { "victorialogs": { "command": "/path/to/mcp-victorialogs", "env": { "VL_INSTANCE_ENTRYPOINT": "<YOUR_VL_INSTANCE>", "VL_INSTANCE_BEARER_TOKEN": "<YOUR_VL_BEARER_TOKEN>" } } } }

请参阅Claude Desktop MCP 文档以了解更多信息。

克劳德·科德

运行以下命令:

claude mcp add victorialogs -- /path/to/mcp-victorialogs \ -e VL_INSTANCE_ENTRYPOINT=<YOUR_VL_INSTANCE> \ -e VL_INSTANCE_BEARER_TOKEN=<YOUR_VL_BEARER_TOKEN>

请参阅Claude Code MCP 文档以了解更多信息。

Visual Studio 代码

将其添加到您的 VS Code MCP 配置文件中:

{ "servers": { "victorialogs": { "type": "stdio", "command": "/path/to/mcp-victorialogs", "env": { "VL_INSTANCE_ENTRYPOINT": "<YOUR_VL_INSTANCE>", "VL_INSTANCE_BEARER_TOKEN": "<YOUR_VL_BEARER_TOKEN>" } } } }

有关详细信息,请参阅VS Code MCP 文档

泽德

将以下内容添加到您的 Zed 配置文件:

"context_servers": { "victorialogs": { "command": { "path": "/path/to/mcp-victorialogs", "args": [], "env": { "VL_INSTANCE_ENTRYPOINT": "<YOUR_VL_INSTANCE>", "VL_INSTANCE_BEARER_TOKEN": "<YOUR_VL_BEARER_TOKEN>" } }, "settings": {} } } }

请参阅Zed MCP 文档以了解更多信息。

JetBrains IDE

  • 打开Settings -> Tools -> AI Assistant -> Model Context Protocol (MCP)

  • 单击Add (+)

  • 选择As JSON

  • 将以下内容输入到输入字段中:

{ "mcpServers": { "victorialogs": { "command": "/path/to/mcp-victorialogs", "env": { "VL_INSTANCE_ENTRYPOINT": "<YOUR_VL_INSTANCE>", "VL_INSTANCE_BEARER_TOKEN": "<YOUR_VL_BEARER_TOKEN>" } } } }

风帆冲浪

将以下内容添加到您的 Windsurf MCP 配置文件。

{ "mcpServers": { "victorialogs": { "command": "/path/to/mcp-victorialogs", "env": { "VL_INSTANCE_ENTRYPOINT": "<YOUR_VL_INSTANCE>", "VL_INSTANCE_BEARER_TOKEN": "<YOUR_VL_BEARER_TOKEN>" } } } }

请参阅Windsurf MCP 文档以了解更多信息。

亚马逊基岩

即将推出....

使用 Docker 代替二进制文件

即将推出...

用法

安装配置MCP 服务器后,您可以开始与您最喜欢的 MCP 客户端一起使用它。

您可以从以下短语开始与AI助手对话:

Use MCP VictoriaLogs in the following answers

但这不是必需的,您可以开始提问,助手会自动使用工具和文档为您提供最佳答案。

工具集

MCP VictoriaLogs 提供了许多与您的 VictoriaLogs 实例交互的工具。

以下是可用工具的列表:

工具

描述

documentation

在嵌入式 VictoriaLogs 文档中搜索

facets

每个日志字段中最常见的值

field_names

查询的字段名称列表

field_values

查询的字段值列表

flags

查看 VictoriaLogs 实例的非默认标志

hits

按存储桶分组的匹配日志条目数

query

执行 LogsQL 查询

stats_query

查询给定时间的日志统计信息

stats_query_range

查询给定时间范围内的日志统计信息

stream_field_names

查询的流字段列表

stream_field_names

查询的流字段值列表

stream_ids

查询的流 ID 列表

streams

查询的流列表

提示

该服务器包括常见任务的预定义提示。

这些只是目前的示例,将来会添加到提示库中:

迅速的

描述

documentation

在 VictoriaLogs 文档中搜索特定主题

免责声明

此类人工智能服务和代理以及 MCP 服务器无法保证结果的准确性、完整性和可靠性。您应该仔细检查使用人工智能获得的结果。MCP 服务器及其响应的质量在很大程度上取决于客户端的功能以及您所使用的模型的质量。

贡献

欢迎为 MCP VictoriaLogs 项目做出贡献!欢迎提交问题、功能请求或拉取请求。

-
security - not tested
A
license - permissive license
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/VictoriaMetrics-Community/mcp-victorialogs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server