MARS-Curiosity 2.1.0: MCP 2026-07-28, asymmetric JWT keys, mORMot 2 and Docker-ready projects
MARS-Curiosity 2.1.0 is out, three weeks after 2.0.3. It brings the features that were growing on the development branch: the new revision of the MCP protocol, JWT tokens signed with asymmetric keys, mORMot 2 under the hood, projects that are ready for Docker the moment MARSCmd creates them, and console servers that tell you where they are. Along the way a good number of fixes found their place in it too, several of them about security.
Here is what is new, what was fixed, and what to check before you update.
MCP: the 2026-07-28 revision
MARS has a native MCP server: mark a method with [MCPTool] and an AI agent can call your Delphi code.
[Path('mcp')]
TMyMCPResource = class(TMCPResource)
public
[MCPTool('get_customer', 'Returns a customer by its id')]
function GetCustomer([MCPParam('id', 'The id of the customer')] const AId: Integer): TCustomer;
end;
The protocol moved on. Its 2026-07-28 revision has no initialize handshake any more: every request declares its protocol version, results carry new fields (resultType, ttlMs, cacheScope), and over HTTP the headers must mirror the body. Clients that speak only the new revision, such as Open WebUI 0.13 and the Python mcp SDK 2.x, could not connect to a MARS server.
In 2.1.0 a MARS server is what the specification calls a dual-era server: it serves the 2025 revisions and the 2026 one on the same endpoint, and the request decides which. There is nothing to configure and nothing changes for the clients that still use initialize: the resource above answers Claude, ChatGPT connectors and Open WebUI, old and new.
The Protocol versions section of the documentation has the details, including how to tell a client how long it may cache your tool list.
JWT with asymmetric keys
Until now a MARS token was signed with a shared secret (HS256): every server that verifies tokens can also issue them. Fine for one server, less so when a gateway issues the tokens and ten services only read them.
2.1.0 adds RS256, PS256 and ES256:
DefaultApp.JWT.Algorithm=ES256
DefaultApp.JWT.PrivateKey=keys\jwt-private.pem
DefaultApp.JWT.PublicKey=keys\jwt-public.pem
The private key signs, the public key verifies: give the services only the public one and they cannot issue a token. JWT.PreviousPublicKey covers key rotation, and the algorithm comes from the configuration, never from the header of a token. HS256 stays the default, so existing servers keep working as they are.
With the default backend on Windows there is nothing else to install. The Asymmetric algorithms page explains the keys and what the JOSE backend needs.
mORMot 2
The mORMot JWT backend and MARS.dmustache are now built on mORMot 2 instead of mORMot 1.18. Same behavior and same tokens, on a library that is actively developed; its RSA and ECDSA code is what makes the asymmetric algorithms work without any DLL. ThirdParty\mORMot2 replaces ThirdParty\mORMot in the repository: if a project of yours has the old folder in its search path, the upgrade notes tell you what to change.
Docker-ready projects
Projects created with MARSCmd are ready for Docker from the start. The three templates have a Dockerfile, a docker-compose.yml, a .dockerignore and a docker-build.bat that builds the Linux64 daemon from the command line. No PAServer and no Linux machine: build on Windows, then run this where Docker lives:
docker compose up -d --build
MARSCmd puts the name of your project in those files too, so a new project goes from the template to a running container without editing anything. See Deployment ▸ Docker.
A console that tells you where it is
Console servers got friendlier. On start they write the URL of each application, of its OpenAPI document and of Swagger UI, clickable in most terminals. A new endpoints command lists every endpoint of the server with its HTTP method and path: resources and routes, as the engine sees them. It is in the templates and in the demos; a project created before can copy the few lines from the template (The console server).
Fixes, many of them about security
After 2.0.3 the work also gathered around a set of fixes, and a good part of them make a server safer when it is reachable from outside. The ones to know about:
- Request size: the Indy and Delphi Cross Socket servers refuse bodies over a limit, the new
MaxRequestSizeengine parameter (30 MB by default). - Login: the placeholder
AuthenticateofTMARSTokenResource, the one that makes the templates work out of the box, now works in DEBUG builds only. - MCP OAuth: PKCE is required; the registered clients have a limit; a login lasts 30 days and then the user signs in again.
- Deltas:
ApplyUpdatesaccepts only the columns of the server dataset, so theselectdecides what a client can write. Hostheader: a header with a path in it is refused, it could replace the path of the request.- Rate limit behind a proxy: the client is the address the proxy wrote, not the first one of
X-Forwarded-For.
And a group of plain bug fixes: token times computed in UTC (a login could fail in the hour before the change to daylight saving time), a URL or a cookie that cannot be decoded answered with a 400 or ignored instead of a 500, unsigned integers and nested objects in JSON, dataset values escaped in XML, a + in the path that stays a plus, a memory leak at every POST of a dataset resource, connection parameters such as Password=007 passed to the driver as written.
Every fix has its entry, with the issue it comes from, in the release notes. If your servers are exposed to the Internet, this alone is a good reason to update.
Before you update
Some of the fixes change behavior. The upgrade notes list every case; these are the ones most likely to touch a real application:
- Uploads over 30 MB: set
MaxRequestSizein the ini (bytes,0for no limit). - Login: if you relied on the built-in
Authenticate, override it: in RELEASE it no longer accepts anything. - Deltas: a client that sends columns the server dataset does not have gets a
400. Select them on the server, or stop sending them. - Rate limit behind two or more proxies: use a header that the first proxy overwrites, such as
X-Real-IP. - mORMot 1 units are no longer shipped: update the search path of the projects that named
ThirdParty\mORMot. - Removed units:
MARS.Core.Reflection,MARS.Core.Token.InjectionServiceandMARS.Messaging.*, which nothing used.
Get it
- Download the setup from the GitHub release, or
tms install andreamagni.marswith TMS Smart Setup. - Read the upgrade notes.
- Rebuild your servers and run your tests.
The documentation pages for what is new:
- MCP ▸ Protocol versions;
- Authentication ▸ Asymmetric algorithms;
- Deployment ▸ Docker and The console server;
- Engine ▸ Request size limit and Rate limiting.
MARS-Curiosity is open source and free. Thanks to everyone who reported a problem, sent a pull request or told me what they build with it. Feedback, issues and ideas are welcome on GitHub.
Stay tuned for more news!
Andrea