
Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Apex Log MCP Server - AI-powered Salesforce Apex debug log analysis. Find performance bottlenecks, slow methods, SOQL bottlenecks, and governor limit issues.
Обзор
Instead of scrolling thousands of log lines, ask what's slow and why. Uses the same parser as the Apex Log Analyzer VS Code extension. Requires Node.js 22 or later. Add this to your MCP client config (claude_desktop_config.json, VS Code mcp.json, and so on): Then ask your assistant to analyze a log. apexlog_execute_anonymous also needs an org authenticated with the Salesforce CLI. - "Give me a summary of this debug log" - "Show me the 5 slowest methods in the default namespace" - "Are we approaching any governor limits in this transaction?" - "Run this Apex against my scratch org and analyze the performance" Keeping the server connected costs ~1,232 tokens, 0.6% of a 200K context. See Token Cost. The analysis tools take an absolute path to a .log file. Every tool returns one flat table, encoded as TOON. Nothing is repeated, and nothing is dropped to save space. A 0 means none, not "not measured". Only what did not happen is left out: fatal errors, lost log content, query plans.
README
Показан фрагмент оригинального README. Открыть оригинал.
Apex Log MCP Server
MCP Server to Analyze Salesforce Apex debug logs from your AI assistant. Finds slow methods, governor limit risks, and where a transaction spent its time. In your org, runs anonymous Apex, fetches logs, and sets trace flags.
Instead of scrolling thousands of log lines, ask what’s slow and why. Uses the same Apex log parser as the Apex Log Analyzer VS Code extension.
Quick Start
Requires Node.js 22 or later. Add this to your MCP client config (claude_desktop_config.json, VS Code mcp.json, and so on):
{
"mcpServers": {
"apex-log-mcp": {
"command": "npx",
"args": ["-y", "@certinia/apex-log-mcp"]
}
}
}
In VS Code mcp.json, use "servers" in place of "mcpServers".
Then ask your assistant to analyze a log. The org tools - apexlog_execute_anonymous, apexlog_list_org_logs, apexlog_get_org_logs and apexlog_create_trace_flag - also need an org authenticated with the Salesforce CLI.
Example Prompts
- “Give me a summary of this debug log”
- “Show me the 5 slowest methods in the default namespace”
- “Are we approaching any governor limits in this transaction?”
- “What did my System.debug calls print?”
- “Run this Apex against my scratch org and analyze the performance”
- “Run it again with database logging at FINEST”
- “Find the latest debug log for [email protected] and summarize it”
- “Why are there no logs for this user?”
Keeping the server connected costs ~2,445 tokens, 1.2% of a 200K context. See Token Cost.
Tools Reference
Установка
npx -y @certinia/apex-log-mcpКонфигурация
{
"mcpServers": {
"apex-log-mcp": {
"command": "npx",
"args": ["-y", "@certinia/apex-log-mcp"]
}
}
}