Beat any MCP server with AI-powered real-time code execution

The MCP ecosystem is very complicated: each implementation relies on MCP clients, MCP servers, and a new standard that’s basically a wrapper for API specifications.

I think that instead, you should be using direct code execution: the LLM can write code, and if it’s given an OpenAPI specification, it can form a highly customized API call to a service in real time. This gets you, the user or the agent, exactly and only the data you need.

Function calling is good for very specific, “routine” LLM requests because they are standardized by design.

In my humble opinion, everything else should go through a real-time code execution loop: the LLM can dynamically use its knowledge to collaborate with a code-execution tool to get the information it needs to satisfy a user request.

Additionally, we should make OpenAPI specifications more LLM-friendly. Not everything within an OpenAPI specification is useful to the tool that has to read it.

Specifically, for agents to work well, we have to do the equivalent of MapReduce over the output of an API call. This is what I call a real-time code execution agent. It’s done before feeding the information to an overseeing LLM that the user interacts with.

The idea is that a real-time code execution agent (B) handles parsing a request from an agent (A) that needs to accomplish something. Agent (B) understands this request, knows which API to call, writes a custom API request to satisfy the need, and also filters the API output to give Agent (A) only the information it needs. This shields it from the verbosity of an API response.

MCP is unoptimized. It’s just a wrapper around function calling with some useless bells and whistles that no one uses yet.

Further Reading

https://github.com/vblagoje/openapi-llm by Vladimir Blagojevic