We've released Exevalator (an open-source expression-evaluation library) v2.4.0!
We just shipped a major update to v2.3 the other day, which added Python support:
Building on that Python port, v2.4 adds support for the MCP protocol, enabling Exevalator to be used as a calculation tool for AI.
Below, we'll cover the details and show practical examples.
In its original role, Exevalator is a library you embed in your program to evaluate the value of expressions provided as strings. For example:
When expressions like these are supplied dynamically at runtime (e.g., via user input), handling them correctly can be trickier than it looks.
Exevalator provides this capability as a library across multiple programming languages so you can integrate it easily. It currently supports seven languages: Java, Rust, C++, C#, VB.NET, TypeScript, and Python, with more to come.
And in this release, beyond language bindings, we've added support for MCP, a protocol for connecting AI to external tools and data.
MCP is a relatively new protocol, so many readers may not have run into it yet.
First, a quick refresher: what's a protocol?
A protocol is, roughly speaking, an agreed — upon framework for interaction — the rules and assumptions that let systems communicate and control one another.
Whenever two systems need to exchange information or issue commands, a few things have to be true:
The collection of such agreements is the protocol. Systems interoperate — communicate, coordinate, and recover — by following it.
Classic examples include TCP (a transport protocol between sender and receiver on the web) and HTTP (an application protocol layered on top of TCP).
Right now, your PC or smartphone is receiving this page from RINEARN's web server according to those rules.
Thanks to shared protocols, your device can talk to web servers worldwide and render sites consistently.
Here's the key point.
AI has advanced rapidly in recent years, and AI systems are now beginning to use tools on their own and carry out tasks autonomously — the rise of so-called AI agents.
In such setups, an AI-agent system interacts with tools for AI (and other information providers):
That interaction needs to be reliable and efficient for AI. A shared protocol makes this far easier.
One strong candidate is MCP (Model Context Protocol), proposed in 2024 by the AI company Anthropic. It's a very fresh protocol, but momentum is building.
After a bit of background, here's the point: starting with this release, Exevalator supports control via MCP.
As in the earlier diagram, this makes it possible to use Exevalator as a calculation tool for AI:
You might ask:
That's true — if you're willing to let the AI execute arbitrary scripts, you don't need Exevalator at all.
So when does Exevalator help? Precisely when you do not want to grant an AI permission to run arbitrary code.
There are plenty of cases where unrestricted execution is undesirable or outright impossible. For example:
Yet in those same situations, you might still want to allow:
That's where Exevalator shines.
Because of its design, Exevalator lets you compute safely:
So even if someone tries to read secrets or damage the system, it simply can't be done through Exevalator.
Please keep the following in mind:
Consequently, you cannot create values/instances of other types and pass them as arguments to specific functions. Exevalator is for numerical computation.
To wrap up, let's actually connect Exevalator to an AI agent and try it out.
The examples below were run in the following environment:
For installation and MCP connection in the setup above, please see the official README.
First, let's have the agent evaluate an expression that uses some math functions:
The result matches the theoretical value.
Note that the MCP edition of Exevalator comes in two variants:
Here we're using the latter.
In either case, you can edit the source to add more functions, and of course you can implement your own custom functions.
Next, let's declare/read/write variables and perform a small, stepwise calculation:
As shown, you can store values for later use.
As an aside, trying this felt like "natural-language programming" in spirit. It might be fun to build an educational language/runtime that leans in this direction — just a thought!
-
That's a wrap for this release. Personally, this update was exciting to build — the sci-fi future keeps getting closer!
We plan to expand language support further; tentatively, Go is on the radar for the next major update (v2.5), though this is not final yet.
We'll keep posting Exevalator updates here. Stay tuned!
We'd also like to acknowledge the book that kicked off our MCP journey; it's a highly practical resource:
If you already write command-line tools or libraries in Python, a bit of hands-on practice may be all it takes to promote your tool into an AI-ready tool. It'll be exciting to see more tools and libraries become AI-enabled — let's ride the AI-era wave together!