Skip to main content

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

Using uvx:Install MCP Server

Using pip Installation:Install MCP Server

Manual Configuration

Configure the MCP Server in Cursor.app's settings page,

cursor_setting.png

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

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

  1. How many log themes do I have?

    question_how_many_log_themes_do_I_have.png

  2. Query original logs for a specific theme

    question_get_log.png

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ecl_mcp_server-0.1.5-py3-none-any.whl (79.2 kB view details)

Uploaded Python 3

File details

Details for the file ecl_mcp_server-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: ecl_mcp_server-0.1.5-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

Hashes for ecl_mcp_server-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0c6c6094f5cb42f4552898c4579b7c2e9d810b74fec41e0e84536beb19150cda
MD5 5b272eacf5e0b1794f4d92edda5556ad
BLAKE2b-256 0b79ddca75a1e0f33eb7e21b8f861544e408b54828428efacded4dbfb2a0fa0a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page