Skip to main content
Glama
mg-analytics-mcp

mg-analytics-mcp

by mikhan-repo

mg-analytics-mcp

MCP-сервер (Model Context Protocol), оборачивающий публичный HTTP API аналитики MonitoringGroups. Экспонирует 3 инструмента для ИИ-агентов: list_profiles, get_digests, get_group_messages. Транспорт — stdio.

Установка

cd mg-analytics-mcp
uv sync

или через pip:

pip install mcp httpx

Related MCP server: Google Analytics MCP Server

Конфигурация

Переменные окружения:

  • MG_API_BASE_URL — базовый URL API (по умолчанию https://monitor.mikhan-lab.com).

  • MG_API_KEY — Bearer-ключ для авторизации (обязателен; без него инструменты вернут понятную ошибку).

Запуск вручную

MG_API_KEY=your-key uv run main.py

Подключение к Claude Desktop

В claude_desktop_config.json добавь:

{
  "mcpServers": {
    "mg-analytics-mcp": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/mg-analytics-mcp", "run", "main.py"],
      "env": {
        "MG_API_KEY": "your-key"
      }
    }
  }
}

Подключение к Claude Code

claude mcp add mg-analytics-mcp -- uv --directory /absolute/path/to/mg-analytics-mcp run main.py

Не забудь передать MG_API_KEY в окружении процесса (например, через -e или переменные окружения оболочки, если claude mcp add в твоей версии их поддерживает, либо задав env в конфиге MCP-сервера).

Инструменты

list_profiles()

Список аналитических профилей мониторинга. Профиль = тематика анализа (например, «Инвестиции РБ») + набор групп-источников (VK/TG). Вызывается первым, чтобы узнать id профиля (для get_digests) или id группы (для get_group_messages).

get_digests(profile_id, start_date=None, end_date=None, limit=50)

Готовые аналитические сводки (дайджесты) по профилю — markdown-выжимки, сгенерированные LLM.

get_group_messages(group_id, from_=None, to=None, limit=100)

Сырые сообщения группы за период из постоянного архива.

Обработка ошибок

  • 401 → «Неверный API-ключ. Проверь MG_API_KEY.»

  • 429 → «Превышен лимит (60/мин на IP). Подожди и повтори.»

  • 404 → «Не найдено (профиль/группа не существует).»

  • Сетевые ошибки/таймаут → понятное сообщение с причиной.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides LLM clients with market intelligence tools over stdio, including market snapshots, price history, sentiment scoring, evidence search, and research briefs, with saved-run resource access.
      AGPL 3.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to query Google Analytics 4 data—traffic, acquisition, top pages, audiences, events, conversions, and realtime metrics—through natural language. Supports local stdio use for a single user and HTTP multi-tenant OAuth for teams.
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Lets an AI agent read a Pyxis dashboard's analytics — overviews, funnels, devices, acquisition, backend requests, visits and project settings — using a read-only access token created by an admin and revocable at any time. It runs locally over stdio, holds no state, and exposes only GET-style reads of the live Pyxis API.
      18
      210 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Gives AI agents access to the VirusTotal v3 API so they can look up hashes, URLs, IPs, and domains and receive detection reports with relationship pivots like contacted hosts, dropped files, and threat actors. Includes cache-first URL scanning, corpus search, sandbox behaviour summaries, and cursor-paginated relationship traversal over stdio or HTTP streaming transports.
      MIT