Wednesday, June 18, 2025

Maybe don't think of MCP servers as an alternative to your API

Yesterday, I posted on LinkedIn about how I created an MCP server to return details from an experimental XAML analysis tool.

I've since been experimenting with it a bit more.

Without my tool, initially, Copilot told me that the file I was using for testing was great. (Sadly, I didn't get a screenshot of that.) But after running my tool a few times and then asking Copilot the same question without my MCP server, it started to suggest the possibility of improvements.

There is some duplication in animation and style usage, which could be refactored for maintainability. The file is well-structured for a modern WinUI 3 application.

Overall, the file is functional and adheres to good practices, but refactoring and optimization could improve maintainability and performance. Let me know if you'd like to implement any of these improvements!

With a bit more pushing, it even started to be able to suggest things comparable to what my tool was providing:

Duplications to Reduce in HomePage.xaml: 1. Animation Sets (ShowTransitions and HideTransitions): •	Both animation sets (ShowTransitions and HideTransitions) use similar structures with OffsetAnimation and OpacityAnimation. The only difference is the direction and duration values. •	Improvement: Create a parameterized or reusable animation resource to avoid duplication. 2. Repeated Styles for Controls: •	SelectorBarItem: Both instances use Style="{StaticResource TokenViewSelectorBarItemStyle}". •	GridView: All three GridView controls share the following properties: •	ItemTemplate="{StaticResource ControlItemTemplate}" •	IsItemClickEnabled="True" •	ItemClick="OnItemGridViewItemClick" •	ContainerContentChanging="OnItemGridViewContainerContentChanging" •	IsSwipeEnabled="False" •	Loaded="OnItemGridViewLoaded" •	SelectionMode="None" •	Improvement: Define a default style or template for GridView and SelectorBarItem in the resource dictionary.
The formatting it applied was even better than my simple string output.

But then I started asking about other files and it went back to giving generic feedback.


This whole experience has made me think about MCP servers in a new way.

If I have a tool or API that performs some specific task then I'll call that directly. Why further complicate things by getting an agent/AI/LLM involved?
If I have an API or tool that provides some data or information that it might be appropriate for the agent to use, then that might be appropriate as an MCP server (or other tool that an agent/AI) can use.

If I'm using an agent it might be appropriate to say "run this tool and make changes based on what it returns." In doing this the actions of the agent may not always be the same. Such is the nature of a non-deterministic system like an LLM based AI. Adjusting to the change from highly-deterministic systems to those that include a level of random variation may just be the hardest part of understanding "AI-based" computing.

If I know I want consistent results that are always presented/formatted the same way and don't have any random variations then I'll use a specific tool directly. If I want to make additional information available to the agent, or allow it to trigger external tasks, then an MCP server is highly appropriate.

I suspect this has some parallels with some businesses that are threatened by an Agent with an MCP wrapper to an API making them redundant. If all you're doing is providing data then where's the business? If you're creating/collating/gathering the data then that could be useful. If you're value comes from analysing or formatting data then AI could become a threat when it can do that analysis or formatting itself....



0 comments:

Post a Comment

I get a lot of comment spam :( - moderation may take a while.