UNPKG

endgame-mcp

Version:

[![github](https://github.com/user-attachments/assets/72708ed2-ab7e-49b4-8bb4-00c452ab4a44)](https://endgame.dev)

22 lines (20 loc) 662 B
/** * Universal structured logger for the MCP server. * Logs events in the format "context.action_in_past_tense" with structured data. * All logs are JSON objects with an event property and relevant data. */ /** * Logs a structured event with the specified event name and data. * Uses console.error() as required by MCP protocol to avoid interfering with JSON-RPC communication. * * @param {string} event - Event name in format "context.action_in_past_tense" * @param {object} data - Additional data to include in the log entry */ export function log(event, data = {}) { console.error( JSON.stringify({ event, ...data, }) ); }