A Model Context Protocol server providing tools to access ECL(Elastic Cloud Log) for usage by LLMs
Project description
ECL MCP Server
This project integrates China Mobile Cloud Logging (ECL) with MCP (Model Context Protocol), providing tool capabilities for log querying, log overview, log group management, log topic management, alarm management, dashboards, and data processing.
Tools
| Module | Tool Name | Description |
|---|---|---|
| default | get_current_datetime | Get current datetime |
| get_log | Query raw log content | |
| query_alarm_product_topn | Query top 5 alarm resource types | |
| query_alarm_trend | Query 7-day alarm trends | |
| query_alarm_log_group_topn | Query top 5 alarm log topics | |
| group | create_log_group | Create new log group |
| update_log_group | Edit log group | |
| delete_log_group | Delete log group | |
| query_log_group_list | Query log group list | |
| theme | create_index_set | Create new log topic |
| update_index_set | Edit log topic | |
| delete_index_set | Delete log topic | |
| query_log_theme_list | Query log topic list | |
| alarm | query_alarm_policy_detail | Query alarm policy details |
| query_alarm_policy_list | Query alarm policy list | |
| query_alarm_record_list | Query real-time alarm records | |
| query_alarm_record_list_history | Query historical alarm records | |
| confirm_alarm_record | Acknowledge real-time alarms | |
| delete_alarm_policy | Delete alarm policy | |
| dashboard | query_dashboard_statistics | Query dashboard list |
| create_dashboard | Create new dashboard | |
| delete_dashboard | Delete dashboard | |
| query_dashboard_chart | Query charts under dashboard | |
| edit_dashboard | Edit chart | |
| delete_dashboard_chart | Delete chart | |
| query_chart_data | Query chart data | |
| etl | list_log_fn | Query data processing rules list |
| query_log_fn | Query data processing rule details | |
| delete_log_fn | Delete data processing rule | |
| update_log_fn_status | Modify data processing rule enable/disable status |
Installation
Using uv (recommended)
When using uv no specific installation is needed. We will
use uvx to directly run ecl-mcp-server.
uvx ecl-mcp-server
Using PIP
Alternatively you can install ecl-mcp-server via pip:
pip install ecl-mcp-server
After installation, you can run it as a script using:
python -m ecl-mcp-server
Configuration
Configure for Cursor.app
One-Click Installation
Manual Configuration
Configure the MCP Server in Cursor.app's settings page,
Using uvx
{
"mcpServers": {
"ecl-journal": {
"command": "uvx",
"args": [
"ecl-mcp-server",
"your_access_key",
"your_secret_key"
]
}
}
}
Using pip Installation
{
"mcpServers": {
"ecl-journal": {
"command": "python",
"args": [
"-m",
"ecl-mcp-server",
"your_access_key",
"your_secret_key"
]
}
}
}
Other MCP Client
- Cline. Click configuring-mcp-servers to learn how to configure.
- Cherry Studio. Click mcp-config to learn how to configure.
Customization - Launching ecl-mcp-server with Custom Arguments
ecl-mcp-server supports custom launch arguments or reading parameters from environment variables.
Usage: ecl-mcp-server [OPTIONS] ACCESS_KEY SECRET_KEY
Available arguments:
| Argument | Required | Env Variable Key | Description | Default |
|---|---|---|---|---|
| access_key | Yes | ECLOUD_JOURNAL_ACCESS_KEY | AccessKey required for China Mobile Cloud API gateway. See: https://ecloud.10086.cn/op-help-center/doc/article/42472 Recommended to pass via environment variable. |
/ |
| secret_key | Yes | ECLOUD_JOURNAL_SECRET_KEY | SecretKey required for China Mobile Cloud API gateway. See: https://ecloud.10086.cn/op-help-center/doc/article/42472 Recommended to pass via environment variable. |
/ |
| --port | No | / | Port number for ecl-mcp-server. | 8000 |
| --transport | No | / | Transport protocol. Options: [stdio, sse, streamable-http] | stdio |
| --log-level | No | / | Logging level. Options: [DEBUG, INFO, WARNING, ERROR, CRITICAL] | INFO |
| --preferred-pool-id | No | ECLOUD_JOURNAL_PREFERRED_POOL_ID | Default resource pool ID when accessing ecl-mcp-server. Some requests require explicit pool ID specification, otherwise needs to be specified in conversation. | None |
| --module -m | No | / | Only load tools from specified modules. Options: [default, group, theme, alarm, dashboard, etl, all]. Options' meanings, please see Available Tools. Can be specified multiple times: --module group --module theme |
default |
| --timezone -tz | No | / | Set timezone. Can be float for offset (e.g. 8 or -5.5) or timezone name (e.g. Asia/Shanghai) | 8 |
For more usage help, you can view the help documentation using the --help parameter: uvx ecl-mcp-server --help
Interaction Examples
-
How many log themes do I have?
-
Query original logs for a specific theme
Dependencies
This project relies on the following open source components. Many thanks to the open source community for their contributions! All dependencies follow their official licenses (see License Section).
- fastmcp
- mcp[cli]
- pydantic
- python-dateutil
- pytz
- typer
License
- This project is licensed under Apache-2.0. See LICENSE file for details.
- Licenses for dependencies: All dependencies follow their respective official licenses. See dependencies-licenses for details. Also refer to the project's licenses directory, which is included in the distribution package.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ecl_mcp_server-0.1.4-py3-none-any.whl.
File metadata
- Download URL: ecl_mcp_server-0.1.4-py3-none-any.whl
- Upload date:
- Size: 79.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07a7718e7ba60bca43bd4d7c9b46482ae6a8e53452458098a67adc9c31e2ebc7
|
|
| MD5 |
94921d3a5d8b5279bfc68ec2bc76aa6b
|
|
| BLAKE2b-256 |
c12bb2c76093c35fed482ddbf35280e226ed5b0cdf8ea64749ad9f46ceb2fee5
|