UNPKG

@inso_web/els-mcp

Version:

MCP-сервер поверх INSO Error Logs Service. Read-only tools (search, analytics, fingerprinting, correlations) для подключения Claude Desktop/Code и ChatGPT к логам ошибок. Streamable HTTP transport + stdio для npx-запуска.

32 lines 1.6 kB
/** * Общие типы для cache-слоя. * * `RequestContext` — DTO, который HTTP transport прокидывает в каждый tool * handler и (через декорированный) ElsClient. Содержит tenant-идентификаторы * (appSlug / keyPrefix) — это **обязательное** условие tenant-isolation в * cache key. * * В stdio-режиме контекст можно собрать "вручную" из ELS_API_KEY (см. helper * `deriveContextFromKey`) — fallback для случая, когда один процесс = один * tenant. */ export interface RequestContext { /** Slug приложения (если известен). Может быть null для master-key. */ appSlug: string | null; /** Первые 16 символов ELS API-ключа — для key-isolation между разными ключами одного app. */ keyPrefix: string; /** Уникальный id запроса (для логов и трейсов). */ requestId?: string; /** id MCP-сессии. */ sessionId?: string; /** Имя tool'а (для метрик / логов). */ tool?: string; } /** * Хелпер: builds a fallback context из API-key, когда нет HTTP layer. * keyPrefix = sha256(apiKey).slice(0,16), appSlug = null. * * Используется stdio-транспортом и тестами. */ export declare function deriveContextFromKey(apiKey: string, appSlug?: string | null): RequestContext; //# sourceMappingURL=types.d.ts.map