Skip to content
FunCoding

MARS

REST framework for Delphi: JAX-RS style servers and clients, JWT, OpenAPI 3, FireDAC, SSE, MCP servers for AI agents. Windows, Linux, Docker.

Star
400
Category
Cloud & ops
License
MPL-2.0
Last commit
Dec 1, 2026

GitHub release GitHub commits since latest release License Delphi Platforms

MARS-curiosity logo

MARS-Curiosity: REST library for Delphi

MARS-Curiosity is an open source (MPL 2.0) library to build REST servers and REST clients with Embarcadero Delphi. Endpoints are plain Delphi classes with attributes (JAX-RS style): MARS does routing, parameter binding, JSON serialization, JWT authentication, OpenAPI 3 and hosting, on Windows and Linux.

📖 Documentation: andrea-magni.github.io/MARS · Why MARS? · FAQ · Release notes

type
  TPerson = record
    Name: string;
    Age: Integer;
  end;

  [Path('people'), RolesAllowed('standard')]
  TPeopleResource = class
  public
    [GET, Path('{id}'), Produces(TMediaType.APPLICATION_JSON)]
    function GetPerson([PathParam] id: Integer): TPerson;
  end;
curl -H "Authorization: Bearer $TOKEN" http://localhost:8080/rest/default/people/1
# {"Name":"Andrea","Age":42}

Features

  • Declarative REST resources: [Path], [GET]/[POST]/[PUT]/[PATCH]/[DELETE]/[QUERY], [Produces], [Consumes], path/query/header/cookie/form/body parameters, dependency injection with [Context].
  • Or routes in code (Express style): R.Get<TPerson>('people/{id:int}', ...), with path constraints, groups, middlewares and OpenAPI, next to the resources.
  • JSON to and from records, objects, arrays and datasets, with options per application; YAML and XML writers too.
  • Security: JWT authentication (Bearer header or cookie, key rotation, token renewal), role based authorization ([RolesAllowed], [Authenticated], [PermitAll], [DenyAll]).
  • OpenAPI 3 generated from your code, Swagger UI included; and the other way round, MARSgen: Delphi types and MARS servers (or whole projects) from OpenAPI 3.0/3.1 documents, types from JSON samples, a conformance check of a server against its document.
  • Data access with FireDAC and Devart UniDAC, MyDAC, IBDAC: return datasets as JSON, XML or native formats, parameters from the request, transactions, connections from the configuration; FireDAC clients send back deltas.
  • MCP servers for AI agents: expose Delphi methods and data as Model Context Protocol tools, resources and prompts (Claude, ChatGPT, Copilot, local models), with roles and OAuth 2.1.
  • Server-sent events, HTML and templates (WebStencils, htmx), static files.
  • Logging: JSON request/response logs for Grafana/Loki; client side logging of every request.
  • Client library: RAD components to call MARS and any other REST API, typed records, tokens, async calls, dataset sync with FireDAC, UniDAC, MyDAC and IBDAC.
  • Hosting: console, VCL/FMX, Windows service, Linux daemon (systemd, Docker), IIS ISAPI, Apache module, FastCGI; Indy or Delphi Cross Socket with HTTPS. See Deployment.
  • Tooling: setup with IDE integration, TMS Smart Setup, the MARSCmd project bootstrapper (also from the command line), Agent Skills for AI coding agents.

Delphi 10.4 Sydney to Delphi 13 Florence.

Installation

  1. Run the setup of the latest release
  2. Or use TMS Smart Setup (Delphi 10.4 and newer): tms server-enable community true, then tms install andreamagni.mars
  3. More info at documentation page

Get started

Bootstrap with MARSCmd

Run MARSCmd, pick a template (MARSTemplate with Indy, MARSTemplateDCS with Delphi Cross Socket, MARSTemplateRoutes with Indy and routes in code) and a name: you get a ready project group with the server in several flavors, a client and a test project. Then follow Your First Server.

AI Agent Skills

MARS ships Agent Skills for Claude Code and other AI coding agents: scaffold a new server or develop REST APIs (resources, JWT, FireDAC and Devart datasets, SSE, MCP, ...) with an AI assistant that knows MARS. From Claude Code:

/plugin marketplace add andrea-magni/MARS
/plugin install mars-curiosity@mars

See the Skills folder or the documentation page for manual installation and usage examples.

Documentation

The documentation site is built with VitePress from the docs/ folder and is published automatically to GitHub Pages on every change.

Forum

Official MARS Curiosity forum at Delphi-Praxis International

Contribution

It would be great if you would like to support this project. It's quite easy, and you can become better at Git, too.

Thanks

Most of the code has been written by the author (Andrea Magni) with some significant contributions by Nando Dessena, Stefan Glienke and Davide Rossi. Some of my customers actually act as beta testers and early adopters. I want to thank them all for the trust and effort.

Embarcadero Delphi is a modern, powerful and effective language and development tool. Learn more about it at the following links:

Copyrights

  • The Delphi stylized helmet icon is trademark of Embarcadero Technologies.

Similar MCP servers

Netdata

Real-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.

NEnetdata/netdata82k100 new stars in the last 7 days

Oh My Posh Validator

Validate oh-my-posh configurations and segment snippets against the official schema.

JAJanDeDobbeleer/oh-my-posh24k24 new stars in the last 7 days

Coder

Manage Coder workspaces, templates, and cloud development environments

COcoder/coder18k54 new stars in the last 7 days

docker-android

Android in docker solution with noVNC supported, video recording, mcp server and AI-agent

BUbudtmo/docker-android16k29 new stars in the last 7 days

Featured

Windows-MCP

Control Windows apps, navigate files, interact with UI, and run QA tests.

CUCursorTouch/Windows-MCP12k288 new stars in the last 7 days

pal-mcp-server

The power of Claude Code / GeminiCLI / CodexCLI + [Gemini / OpenAI / OpenRouter / Azure / Grok / Ollama / Custom Model / All Of The Above] working as one.

BEBeehiveInnovations/pal-mcp-server12k22 new stars in the last 7 days