Skip to content

MARS

REST framework for Delphi: JAX-RS style resources and routes, servers and clients, JWT, OpenAPI 3, FireDAC and Devart UniDAC/MyDAC/IBDAC, SSE, MCP servers for AI agents.…

Install

$/plugin marketplace add andrea-magni/MARS

Install command taken from the project's README or registry entry. Always review code before running it.

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](ht

Similar plugs

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

Never stop coding. Free MIT AI gateway: one endpoint, 359 providers (150+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex,…