LogAnalyze-MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OLLAMA_MODEL | No | The Ollama model to use for LLM-based log analysis (e.g., qwen2.5:7b). Optional; if not set, defaults are used. | |
| OLLAMA_BASE_URL | No | The base URL of the Ollama server. Optional; can be set to customize the Ollama connection. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_log_filesA | 列出指定目录下的所有日志文件(.log/.txt/.out/.err/.trace),含大小与修改时间。 Args: dir_path: 日志目录的绝对路径。 recursive: 是否递归扫描子目录,默认 True。 |
| read_log_tailA | 读取日志文件末尾指定行数(适合查看最新报错,对超大文件同样高效)。 Args: file_path: 日志文件绝对路径。 lines: 要读取的行数,默认 100,最大 5000。 |
| read_log_headA | 读取日志文件开头指定行数(适合查看启动参数与启动阶段日志)。 Args: file_path: 日志文件绝对路径。 lines: 要读取的行数,默认 100,最大 5000。 |
| search_log_keywordB | 在日志中按关键词或正则表达式搜索,返回命中行及其上下文。 Args: file_path: 日志文件绝对路径。 keyword: 关键词;regex 为 True 时视为正则表达式。 regex: 是否按正则匹配,默认 False(普通子串匹配)。 context: 每个命中前后展示的上下文行数,默认 2。 max_results: 最多返回的命中组数,默认 50。 |
| filter_log_by_levelA | 按日志级别筛选记录并统计条数;筛选某级别时会同时包含更严重级别。 Args: file_path: 日志文件绝对路径。 level: 目标级别,可选 FATAL/ERROR/WARN/INFO/DEBUG/TRACE,默认 ERROR。 |
| get_log_statsB | 生成日志统计报告:文件大小、总行数、时间范围、级别分布、高频错误 Top5。 Args: file_path: 日志文件绝对路径。 |
| analyze_logA | 智能分析日志:自动抽取错误,给出根因、证据与修复建议。 优先使用本地 Ollama 大模型;未安装或未启动时自动降级为内置规则引擎。 Args: file_path: 日志文件绝对路径。 max_lines: 送入分析的最大日志行数,0 表示使用配置默认值(400)。 |
| analyze_error_textA | 对用户直接粘贴的一段报错/堆栈文本进行智能根因分析(无需日志文件)。 Args: error_text: 报错信息或异常堆栈原文。 |
| check_llm_statusA | 检查本地 Ollama 服务与模型是否可用;不可用时会提示安装命令与降级状态。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 9 tools
Each tool targets a distinct operation: listing, head/tail reading, keyword search, level filtering, stats, and AI analysis. The main potential overlap is between search_log_keyword and filter_log_by_level, but their descriptions clearly distinguish regex/keyword matching from level-based severity filtering. Boundaries are clear enough that misselection is unlikely.
All tools use snake_case with a consistent verb_noun pattern (list_log_files, read_log_tail, search_log_keyword, filter_log_by_level, get_log_stats, analyze_log, check_llm_status). The convention is predictable and readable throughout.
Nine tools is well-scoped for a log analysis server, with each tool earning its place across the read/search/filter/analyze lifecycle. No redundancy or bloat.
Coverage is strong: discovery, head/tail reads, keyword and level filtering, stats, AI-driven root-cause analysis for both files and pasted text, plus an LLM status check. Minor gaps exist (e.g., no cross-file aggregation or export/report-writing operation), but core log analysis workflows are fully supported.