humio-mcp
A Model Context Protocol (MCP) server implementation for Humio, enabling integration with Humio's logging and analytics platform.
README
Humio MCP Server
A Model Context Protocol (MCP) server implementation for Humio, enabling integration with Humio's logging and analytics platform.
Description
This project implements a server that bridges the Model Context Protocol with Humio's logging capabilities. It allows for seamless integration between applications and Humio's powerful logging and analytics features.
Prerequisites
- Humio token
Installation
- Clone the repository:
git clone [repository-url]
cd humio-mcp
- Install dependencies:
npm install
or
pnpm install
or
yarn install
- Create a
.envfile in the root directory with your Humio configuration (this is only useful for dev/testing as the MCP client will provide the env variables anyway):
HUMIO_API_TOKEN=your_api_token
HUMIO_REQUEST_TIMEOUT_MS=30000
- Create config from the example config file
cp humio-query-config.example.json humio-query-config.json
Usage
Build the server:
npm run build
or
pnpm run build
or
yarn run build
Inspection
After building, you can inspect the server using the MCP Inspector:
npx @modelcontextprotocol/inspector node dist/index.js
Connect to the client. Sample config
"humioMCP": {
"command": "node",
"args": [
"<absolute-path-to-server>/humio-mcp/dist/index.js"
],
"type": "stdio",
"env": {
"HUMIO_API_TOKEN": "<HUMIO_API_TOKEN>",
"HUMIO_REQUEST_TIMEOUT_MS": 3000
}
}
Configuration File Format
The humio-query-config.json file defines the available queries for the server. Each entry in the array should follow the structure below:
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Unique name for the query configuration. |
| description | string | Yes | Human-readable description of what the query does. |
| query | string | Yes | The Humio query string, can include template variables (e.g., {{variableName}}). |
| fields | string[] | Yes | List of fields to extract from the query results. |
| variables | Variable[] | No | List of variables required by the query. See below for the Variable format. |
| outputTemplate | string | Yes | Template for formatting each result. Uses {{fieldName}} for interpolation. |
| joinString | string | Yes | String used to join multiple formatted results. |
Variable Format
Each item in the variables array can be one of the following:
Scalar Variable
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Name of the variable. |
| description | string | Yes | Description of the variable. |
| type | 'string'|'number'|'boolean' | Yes | Type of the variable. |
| required | boolean | Yes | Whether the variable is required. |
Enum Variable
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Name of the variable. |
| description | string | Yes | Description of the variable. |
| type | 'enum' | Yes | Type of the variable (must be 'enum'). |
| required | boolean | Yes | Whether the variable is required. |
| enumOptions | string[] | Yes | Allowed values for the enum variable. |
Example
[
{
"name": "criticalErrors",
"description": "Finds critical errors for the banana team grouped by message and stack trace.",
"query": "k8s.labels.team = banana | (severity = crit ) | groupBy([message, stack_trace])",
"fields": ["message", "stack_trace", "_count"],
"outputTemplate": "Error \"{{message}}\" occurred in total: {{_count}} times. The Stack trace is \n---{{stack_trace}}\n---\n\n",
"joinString": "\n"
},
{
"name": "projectOperationsByState",
"description": "Groups operations by state for a given project in the banana team.",
"query": "k8s.labels.team = banana | projectKey=\"{{projectKey}}\" | groupBy([fields.state])",
"fields": ["fields.state", "_count"],
"variables": [
{
"name": "projectKey",
"description": "The project key to filter by.",
"type": "string",
"required": true
}
],
"outputTemplate": "state: {{fields.state}} - {{_count}} operations",
"joinString": "\n"
}
]
⚠️ Danger: Sensitive Information
Do NOT include any sensitive information in the fields field of your configuration.
The contents of the fields field are returned to the client and may be passed to a Large Language Model (LLM). Any sensitive data (such as API keys, passwords, personal information, or confidential business data) included here could be exposed.
Ensure that only non-sensitive, safe-to-share information is specified in the fields field of your config files.
⚠️ Warning: Timeout and Partial Results
If the configured timeout (HUMIO_REQUEST_TIMEOUT_MS) is reached during a query, the server will return the events collected up to that point. This means the results may be incomplete and might not capture all relevant events.
To reduce the risk of missing data, consider adjusting the timeout value according to your expected query size and network conditions.
Project Structure
humio-mcp/
├── src/
│ ├── humio/ # Humio-specific implementations
│ ├── utils/ # Utility functions
│ └── index.ts # Main server entry point
├── dist/ # Compiled JavaScript files
├── humio-query-config.json # Configurations for available quries
├── package.json # Project dependencies and scripts
└── tsconfig.json # TypeScript configuration
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。