Sitecore MCP Server: Logging Tool

Anton Tishchenko
Anton Tishchenko
Cover Image for Sitecore MCP Server: Logging Tool

No one is ideal. Developers make mistakes in code, content editors make mistakes in the content. Some people make more mistakes, some make fewer, but everyone makes mistakes. If you say that you write code without mistakes, I would not believe you. These mistakes cause bugs, and fixing bugs is a part of the work.

And what is the first thing that you do when you troubleshoot a bug in a Sitecore project? I open Sitecore logs and look for the error message. The second thing could be different, and will depend on what I find in the logs. But the first is almost always the same. Open logs and look for the error.

What if we give access to logs to AI Agents? Will they be able to understand the problem better and fix it?

Logging Sitecore MCP tool

I have added a new tool to the Sitecore MCP server. It reads Sitecore log files and provides output to the AI Agents. It can read any Sitecore log file: default, PowerShell, Crawling, Publishing, Search, Indexing, etc. It can filter by log level, as context window size is important, and we don’t want to add a lot of meaningless information to it.

AI Agent with logging tool in action

Let’s try it in action! I will break something in Sitecore and ask the AI Agent to fix it. I will use the recently released Cursor 1.0.0. and recently released Anthropic Claude 4 Sonnet. This is the best option in June 2025. But MCP servers are client-agnostic and agent-agnostic. It will be about the same with all top-edge AI instruments.

The first thing that we will try is to break the Experience Editor. We will set Server side rendering engine endpoint URL to some wrong value. That is not a fictional bug. You may change it for switching between Docker and local rendering host instances, or you may want to use some remote rendering host, trying to reproduce the issue. And you may forget about this change. Or your colleague may commit this change to the source code by mistake, and you may not notice the change.

Set wrong rendering host

Now, the Experience Editor is broken, and we see Unable to connect to the remote server message. If you are an experienced Sitecore Developer, you know where and how to fix it. No need help of an AI Agent. But let’s pretend you are a frontend dev who was just onboarded to a Sitecore project, and you are an expert in Next.js and React. Let’s ask the AI Agent for help!

I can not open Sitecore Experience Editor. I see an error "Unable to connect to the remote server". Can you check the Sitecore logs and fix the issue with the Sitecore configuration?

Check Sitecore logs

Fix Sitecore configuration

Our website is up and running in Docker. That is why we prefer to locate and update the Sitecore configuration

Locate and update Sitecore configuration

Locate and update Sitecore configuration

We don’t want to run it locally, we want to configure it in Docker.

Update the endpoint

Update the endpoint

Here, the third step is extra, it doesn’t break anything, it is just not needed, and will waste time. We want to sync items.

Sync Sitecore items

Sync Sitecore items

And now, Experience Editor works! AI Agent was able to read logs, find the log entry related to the current problem, and step-by-step fix it.


The AI Agent had access to the Sitecore serialization and preferred to fix using changes in files and pushing the serialization. We will break something else and run it without the serialization context.

I changed the datasource to be the wrong one.

Check Sitecore logs

That is not a fictional bug. The datasource could be broken for many different reasons: bad merge, renaming items, changing standard values, misprint, etc. Will the AI Agent be able to find the reason for the content absence on the page and fix it?

I don't see the part of the content on the Personal page of the Financial website. "Bank with ease..." Can you check the Sitecore logs, why it is absent, and fix it?

Fix Sitecore page

That was easy! The AI Agent has read Sitecore logs, figured out the problem, found the right items, and corrected the datasource! Everything was done without any clarification.

And it was fast! For humans, only opening the content editor, locating items, checking the presentation, and updating the presentation will take more time. It is a straightforward fix, but it requires time. Meanwhile, you can ask the AI agent to do this work for you. If it fails, it is only one minute wasted. If it succeeds, then you will save ten minutes of your time. What will you choose?

Conclusion

AI tools evolve, AI models evolve, and it becomes impossible to stay outside. The Cursor, together with Anthropic Claude 4 Sonnet AI Agent, strengthened by Sitecore MCP Server, could be a very helpful assistant in your day-to-day Sitecore work. Previously, it was a completely different experience without the Sitecore MCP server. You felt like a slave of the AI Agent. It said what you should do: get logs, get Sitecore item, update Sitecore item, etc. Now, the AI Agent can do it by itself, which shifts the Sitecore development experience with AI Agents to a different level!

Sitecore logging is another powerful tool for the Sitecore MCP Server. It allows AI Agents to get additional context for fixing issues. Try it, and become more productive, spending time on interesting and challenging tasks, leaving chore work for AI agents!