sumo-logic-mcp

sumo-logic-mcp

MCP server for Sumo Logic — 37 tools for searching logs, managing monitors, alerts, dashboards, collectors, and metrics. Zero hardcoded org-specific values.

Category
访问服务器

README

sumo-logic-mcp

MCP server for Sumo Logic — 37 tools for searching logs, managing monitors, alerts, dashboards, collectors, and metrics.

Zero hardcoded org-specific values. Any team can plug in their own credentials and start querying immediately.

Quick Start

1. Install

pip install sumo-logic-mcp

2. Get Sumo Logic Credentials

Generate an Access Key in the Sumo Logic UI: Preferences > Security > Access Keys.

You need:

  • Access ID — the key identifier
  • Access Key — the secret (shown only once at creation)
  • API Endpoint — depends on your deployment region (see table below)

3. Configure Your MCP Client

Add to your MCP client configuration (e.g., ~/.cursor/mcp.json or equivalent):

{
  "mcpServers": {
    "sumologic": {
      "command": "python3",
      "args": ["-m", "sumo_logic_mcp"],
      "env": {
        "SUMOLOGIC_ACCESS_ID": "<your-access-id>",
        "SUMOLOGIC_ACCESS_KEY": "<your-access-key>",
        "SUMOLOGIC_ENDPOINT": "https://api.sumologic.com"
      }
    }
  }
}

Or run directly:

export SUMOLOGIC_ACCESS_ID="your-access-id"
export SUMOLOGIC_ACCESS_KEY="your-access-key"
export SUMOLOGIC_ENDPOINT="https://api.sumologic.com"
python3 -m sumo_logic_mcp

API Endpoints by Region

Deployment API Endpoint
US1 https://api.sumologic.com
US2 https://api.us2.sumologic.com
EU https://api.eu.sumologic.com
AU https://api.au.sumologic.com
CA https://api.ca.sumologic.com
DE https://api.de.sumologic.com
IN https://api.in.sumologic.com
JP https://api.jp.sumologic.com
KR https://api.kr.sumologic.com
FED https://api.fed.sumologic.com

Determine yours from your Sumo Logic login URL (e.g., service.us2.sumologic.com → US2).

Tool Reference

Search & Analytics (4 tools)

Tool Description Required Params
search_logs Execute a log search (full lifecycle: create job → poll → fetch → cleanup) query
get_search_status Check status of a running search job job_id
get_search_results Fetch messages or records from a search job job_id
cancel_search Cancel a running search job job_id

search_logs optional params: from_time (default -15m), to_time (default now), timezone (default UTC), limit (default 100), by_receipt_time, timeout (default 300s).

Time formats: ISO 8601 (2024-01-15T09:00:00), relative (-15m, -1h, -2d, -1w), epoch ms (1718745600000), or now.

Monitor Management (10 tools)

Tool Description Required Params
list_monitors List all monitors
search_monitors Search by name or status filter query
get_monitor Get full monitor configuration monitor_id
create_monitor Create a new monitor name, query, threshold
update_monitor Update monitor config (read-modify-write) monitor_id, fields_json
delete_monitor Delete a monitor (irreversible) monitor_id
enable_monitor Enable a disabled monitor monitor_id
disable_monitor Disable a monitor monitor_id
get_monitor_status Get current health/triggering state monitor_id
get_monitor_history Get alert history for a monitor monitor_id

Search filter examples: monitorStatus:Critical, monitorStatus:Warning, monitorStatus:AllTriggered.

Alert Management (3 tools)

Tool Description Required Params
get_active_alerts Get all currently firing alerts
get_alert_details Get detailed alert info for a monitor monitor_id
resolve_alert Resolve an alert by disabling its monitor monitor_id

Dashboard Management (5 tools)

Tool Description Required Params
list_dashboards List dashboards with pagination
get_dashboard Get full dashboard config dashboard_id
create_dashboard Create a dashboard with panels and layout title, panels_json, layout_json
update_dashboard Update dashboard config (read-modify-write) dashboard_id, fields_json
delete_dashboard Delete a dashboard (irreversible) dashboard_id

Collector & Source Management (8 tools)

Tool Description Required Params
list_collectors List all collectors
get_collector Get collector configuration collector_id
create_hosted_collector Create a new Hosted collector name
update_collector Update collector config (with ETag locking) collector_id, fields_json
delete_collector Delete a collector and its sources collector_id
list_sources List sources on a collector collector_id
get_source Get source configuration collector_id, source_id
create_http_source Create an HTTP source (returns endpoint URL) collector_id, name

Metrics (4 tools)

Tool Description Required Params
query_metrics Execute a metrics query query
list_metric_definitions Discover available metric names
get_metric_metadata Get dimensions for a metric metric_name
list_metric_namespaces List metric content types

Utility (3 tools)

Tool Description Required Params
check_connection Verify API connectivity and auth
get_account_usage Get account status and ingestion info
validate_query Check if a query is syntactically valid query

Usage Examples

Once configured, just ask your AI assistant naturally:

"Search for 500 errors in the last hour"
→ AI calls search_logs with appropriate query

"Show me all critical alerts"
→ AI calls get_active_alerts with status=Critical

"Create a monitor for high error rates on our API"
→ AI calls create_monitor with query, threshold, and notification params

"List all hosted collectors"
→ AI calls list_collectors with filter_type=hosted

"What CPU metrics are available?"
→ AI calls list_metric_definitions

Development

git clone https://github.com/rajfirke/sumo-logic-mcp.git
cd sumo-logic-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# Lint
ruff check src/ tests/

# Test
pytest -v

# Run locally
export SUMOLOGIC_ACCESS_ID="..."
export SUMOLOGIC_ACCESS_KEY="..."
export SUMOLOGIC_ENDPOINT="https://api.sumologic.com"
python3 -m sumo_logic_mcp

Architecture

src/sumo_logic_mcp/
├── __init__.py          # Exports mcp, triggers tool registration
├── __main__.py          # Entry point: python -m sumo_logic_mcp
├── server.py            # FastMCP instance + lifespan (shared HTTP client)
├── client.py            # Async HTTP client (httpx, Basic Auth, retry, cookies)
├── validation.py        # Time parsing and validation
└── tools/
    ├── __init__.py      # Imports all tool modules
    ├── search.py        # 4 search tools
    ├── monitors.py      # 10 monitor tools
    ├── alerts.py        # 3 alert tools
    ├── dashboards.py    # 5 dashboard tools
    ├── collectors.py    # 8 collector/source tools
    ├── metrics.py       # 4 metrics tools
    └── utils.py         # 3 utility tools

Design Decisions

  • Zero org-specific config — Only 3 env vars needed: access ID, access key, endpoint. No hardcoded indexes, source categories, or query patterns.
  • Cookie persistence — httpx's built-in cookie jar handles Sumo's session routing (requests without cookies get 404/500).
  • Timezone passed through — The timeZone parameter is always sent to the API, defaulting to UTC. The reference implementation silently dropped it.
  • NOT STARTED is valid — Sumo's search API returns "NOT STARTED" as an initial state. We treat it as an intermediate polling state (the reference treated it as fatal).
  • Job cleanup — Search jobs are always deleted in a finally block after fetching results.
  • ETag locking — Collector updates use If-Match headers for optimistic concurrency control.
  • Aware datetimes only — All time operations use datetime.now(timezone.utc), never the deprecated datetime.utcnow().

License

Apache 2.0 — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选