andrea-magni avatar

mars-curiosity

Agent Skills for MARS-Curiosity, the Delphi REST library: scaffold new MARS server projects (also from OpenAPI documents, with MARSgen), develop REST APIs (resources and, as an addition, routes, attributes, JWT, datasets with FireDAC and Devart UniDAC/MyDAC/IBDAC, SSE, WebStencils, client, deployment) and build MCP servers exposing Delphi tools to AI agents.

GitHub stars
401

Install

/plugin install mars-curiosity@mars

Run it inside Claude Code after adding the marketplace with /plugin marketplace add andrea-magni/MARS.

Contents

Discovered from source

Skills 3

Developing with MARS-Curiosity

MARS (https://github.com/andrea-magni/MARS) maps HTTP requests onto plain Delphi classes via attributes and RTTI. Runtime model:

  • Engine (IMARSEngine, usually TServerEngine.Default in Server.Ignition.pas): owns HTTP-level config (port, base path /rest, CORS, compression) and one or more Applications added with AddApplication('DefaultApp', '/default', ['Server.Resources.*']) — the third argument is a list of unit-name masks selecting which registered resources belong to the app.
  • Resources: classes annotated with [Path('...')], registered via MARSRegister(TMyResource) (or MARSRegister([TResA, TResB]), or TMARSResourceRegistry.Instance.RegisterResource<TMyResource>) in the unit initialization. A new instance is created per request and freed afterwards.
  • Activation (IMARSActivation): per-request context (request, response, token, URL...). Injectable anywhere with [Context].
  • URL = engine BasePath + app path + resource [Path] + method [Path]: /rest/default/customers/123.
  • Routes (additional style, MARS.Core.Routes, since 1.9.0): endpoints defined in code with MARSRoutes(...) modules and R.Get<T>('path', function (const C: TMARSRouteContext): T ...), added with IMARSApplication.AddRoutes; same activation, serialization, roles and OpenAPI as resources. See references/routes.md.

Resources first, routes as an option

Resource classes with attributes (JAX-RS style) are the primary MARS model and stay fully supported: routes are an addition, not a replacement. Both styles live in the same application, on the same engine, base path, token and OpenAPI document.

  • Write resources by default: new endpoints, examples, answers to "how do I add an endpoint".
  • Use routes when the user asks for them (Express / Minimal API / endpoints in code, middlewares around endpoints) or when the project already uses them (Server.Routes* units, MARS.Core.Routes, AddRoutes, MARSRoutes); follow the style of the code around.
  • Never convert existing resources to routes (or routes to resources) unless the user asks. Login (TMARSTokenResource), OpenAPI, static files and MCP (TMCPResource) are resources in every project, route-based ones included.

Minimal resource

unit Server.Resources.Customers;

interface

uses
  SysUtils, Classes
, MARS.Core.Attributes, MARS.Core.MediaType, MARS.Core.JSON;

type
  TCustomer = record
    Id: Integer;
    Name: string;
  end;

  [Path('customers'), Produces(TMediaType.APPLICATION_JSON)]
  TCustomersResource = class
  public
    [GET]
    function List([QueryParam] search: string): TArray<TCustomer>;

    [GET, Path('{id}')]
    function GetById([PathParam] id: Integer): TCustomer;

    [POST, Consumes(TMediaType.APPLICATION_JSON)]
    function Add([BodyParam] ACustomer: TCustomer): TCustomer;
  end;

implementation

uses
  MARS.Core.Registry;

// ... method bodies ...

initialization
  MARSRegister(TCustomersResource);

end.

Records, arrays of records, objects, TJSONObject/TJSONArray, strings, numbers, streams and datasets are serialized automatically by the MessageBodyWriter registry; same in reverse for [BodyParam] via MessageBodyReaders. No manual JSON code needed for plain data.

Returned objects (class instances) are freed by MARS after writing the response. Mark the method [IsReference] when returning a shared/long-lived instance that must NOT be freed.

Raise EMARSHttpException.Create('Not found', 404) for error statuses; raise EMARSWithResponseException to return a structured (JSON) error body. Both are in MARS.Core.Exceptions. Exceptions raised while binding parameters (custom MessageBodyReaders included) keep their status if they are EMARSHttpException, otherwise they become a 500: the built-in JSON readers use this to answer 400 when the request body is missing or malformed.

Reference files — read the one matching the task

  • references/routes.md — route-based endpoints (Express / Minimal API style): MARSRoutes modules, TMARSRouter (Get<T>, Post<TBody,TResult>, groups, constraints {id:int}), TMARSRouteContext, declarations, middlewares (Use), OpenAPI. Read when the user wants endpoints defined in code, middlewares, or works on Server.Routes* units.
  • references/attributes.md — complete attribute catalog (HTTP methods, Path, Produces/Consumes, all *Param binding attributes, Context, config params, authorization, invocation events, response shaping). Read when writing or reviewing resource declarations.
  • references/authentication.md — JWT tokens, TMARSTokenResource login endpoint, Authenticate override, [RolesAllowed]/[PermitAll]/[DenyAll], [Context] Token: TMARSToken, JWT ini parameters. Read for anything auth/security related.
  • references/firedac.md — publishing datasets with TMARSFDDatasetResource + [SQLStatement], ad-hoc queries with [Context] FD: TMARSFireDAC, connection defs from ini, macro/param injection, applying deltas. Read for database endpoints.
  • references/devart.md — the same with Devart UniDAC, MyDAC, IBDAC (TMARSUniDAC/TMARSMyDAC/TMARSIBDAC, connect strings from ini, whole datasets instead of deltas, TMARS<Lib>Resource clients). Read when the project uses a Devart library.
  • references/client.md — consuming a MARS server: TMARSNetClient/TMARSIndyClient, TMARSClientApplication, typed client resources, TMARSClientToken, sync/async calls, EMARSClientHttpException. Read when writing Delphi client code.
  • references/configuration.md — ini file structure, engine/application parameters (port, CORS, compression, SSL, JWT, OpenAPI info, FireDAC), reading params in code, [EngineParam]/[ApplicationParam] injection.
  • references/sse.md — server-sent events: TMARSServerSideEvent endpoints with worker procs, text/event-stream, client-side TMARSClientResourceSSE. Read for push/streaming/live-update endpoints.
  • references/marsgen.md — MARSgen: Delphi types (records or classes) from OpenAPI documents and JSON samples, MARS resources generated from a document (Server.Resources.<Name>.Base generated, Server.Resources.<Name> the user's), importing a changed document again (MARSgen update), conformance of a server (MARSgen compare). Read when the project has *.marsgen.json or *.Base.pas units, or the user has an OpenAPI document or JSON samples to turn into code.
  • references/webstencils.md — server-side HTML with WebStencils (Delphi 12.2+): [Context] TMARSWebStencils, ContentFromFile, AddVarValue/AddDataVar, template folders. Read for HTML-rendering endpoints (also htmx-style apps).

For hosting/deployment (Windows service, ISAPI, Apache, FastCGI, Linux daemon, HTTPS) see references/deployment.md in the companion skill mars-new-project.

Conventions worth keeping

  • One resource per unit, unit named Server.Resources.<Topic>, so the standard 'Server.Resources.*' mask finds it; remember to add new units to the .dpr uses clause, otherwise the unit's initialization never runs and the resource is silently missing.
  • Prefer attribute-driven binding over reading IMARSRequest manually; inject what you need with [Context].
  • Working demos for most features live in Demos/ in the MARS repo: MARSTemplate (baseline), TokenRenew (JWT+roles), OTPDemo (FireDAC+auth), ErrorObjects (structured errors), FireDACDemo/UniDACDemo/MyDACDemo/IBDACDemo (the same customers app with each data access library), SSEDemo (server-sent events), RoutesDemo (route-based endpoints and middlewares), HtmxDemo, WebStencilsDemo. When unsure about an API, check the corresponding demo or the source unit in Source/ — it is the ground truth.

Build an MCP server with MARS-Curiosity

MARS ships native MCP support (units MARS.MCP.* in Source/): derive a resource from TMCPResource, mark methods with [MCPTool], and any MARS server becomes an MCP server speaking the Streamable HTTP transport (single endpoint, JSON-RPC 2.0 over POST). Tool list and JSON Schema are generated from RTTI — no protocol code to write.

The complete working example is Demos/MCPServer in the MARS repository (public tools + FireDAC-backed authenticated tools + OAuth).

MCP servers are built on resources (TMCPResource), also in projects that define their REST endpoints as routes (MARS.Core.Routes, MARSTemplateRoutes): routes are an addition to resources, and an MCP resource lives next to them in the same application. Add it to the application's resources ('Server.Resources.*' mask) as shown below.

Minimal MCP server

unit Server.Resources.MCP;

interface

uses
  SysUtils, Classes
, MARS.Core.Attributes, MARS.Core.MediaType
, MARS.MCP.Resource, MARS.MCP.Attributes;

type
  TCalculationResult = record
    operation: string;
    value: Double;
  end;

  [Path('mcp')
  , MCPServerInfo('My MCP Server', '1.0.0'
    , 'Optional instructions the AI agent reads on connection.')]
  TMyMCPResource = class(TMCPResource)
  public
    [MCPTool('say_hello', 'Returns a friendly greeting for the given name')]
    function SayHello(
      [MCPParam('name', 'Name of the person to greet')] const AName: string): string;

    [MCPTool('add_numbers', 'Adds two numbers and returns a structured result')]
    function AddNumbers(
      [MCPParam('a', 'First operand')] const A: Double;
      [MCPParam('b', 'Second operand')] const B: Double): TCalculationResult;
  end;

implementation

uses
  MARS.Core.Registry;

function TMyMCPResource.SayHello(const AName: string): string;
begin
  Result := 'Hello, ' + AName + '!';
end;

function TMyMCPResource.AddNumbers(const A, B: Double): TCalculationResult;
begin
  Result.operation := 'add';
  Result.value := A + B;
end;

initialization
  MARSRegister([TMyMCPResource]);

end.

This is a regular MARS resource: register the unit mask in Server.Ignition.pas as usual (AddApplication('DefaultApp', '/default', ['Server.Resources.*'])). The MCP endpoint is the composed URL, e.g. http://localhost:8080/rest/default/mcp. Everything the mars-development skill says about resources, [Context] injection and configuration applies here too.

A complete starting unit is available in assets/Server.Resources.MCP.pas.template.

What the attributes do

AttributeWhereEffect
MCPServerInfo(name, version, instructions)resource classidentity returned by initialize; instructions are read by the agent
MCPTool(description) / MCPTool(name, description)public methodexposes the method as a tool (name defaults to the method name)
MCPParam(description) / MCPParam(name, description)parameterdocuments and optionally renames the parameter in the JSON Schema (rename it: Delphi convention names like AValue leak otherwise)
MCPDefault('<JSON literal>')tool parametermakes the parameter optional, with that default value
MCPResource(uri, [name,] description [, mimeType])public methodexposes readable content by URI; {param} placeholders make it a template — see references/resources-prompts.md
MCPPrompt([name,] description)public methodexposes a reusable prompt template; parameters become the prompt arguments — see references/resources-prompts.md
RolesAllowed('...') / DenyAlltool methodper-tool authorization — see references/authorization.md
MCPOAuthresource class401 + OAuth discovery for unauthenticated requests — see references/authorization.md
MCPToolUI(uri [, visibility])tool methodMCP Apps: links the tool to an interactive ui:// view — see references/mcp-apps.md
MCPAppResource(uri, [name,] description), MCPAppCSP(...), MCPAppBorder(...)public methodMCP Apps: the HTML view (text/html;profile=mcp-app) and its CSP/border settings — see references/mcp-apps.md
MCPMeta('<JSON object>')tool/resource methodfree-form _meta, merged with the MCP Apps attributes

Tool results: a string becomes a text content block; records (and arrays, numbers...) are serialized with the MARS JSON serializer and records also become structuredContent. Exceptions raised inside a tool are reported as tool execution errors (isError: true), not protocol errors. TDataSet results need TMCPDataResource — see references/database-tools.md.

Parameter/field types map to JSON Schema automatically: strings → string, integers → integer, floats → number, Boolean → boolean, enums → string + enum values, TDateTime → string/date-time, TDate → string/date ("2026-10-19"), dynamic arrays → array, records → nested object. Parameters are listed as required, except those marked [MCPDefault('<JSON literal>')]: they are left out of required, the schema advertises the value as default, and a missing or null argument is bound to it ([MCPDefault('true')], ('7'), ('"value_date"'), ('""'), ('[]') — the literal is converted like any argument).

Protocol facts worth knowing

  • Supported JSON-RPC methods: initialize (protocol versions 2025-06-18, 2025-03-26, 2024-11-05), ping, tools/list, tools/call, resources/list, resources/templates/list, resources/read, prompts/list, prompts/get. Notifications answer 202 with no body; GET/DELETE answer 405 (stateless server, allowed by spec). The resources/prompts capabilities are advertised only when the class declares any. Extend TMCPDispatcher.DispatchRequest for additional methods.
  • Tool discovery is cached per resource class (thread-safe, RTTI scanned once). The authorization filter is evaluated per request, so caching never leaks role-protected tools.
  • The dispatcher class is pluggable: override GetDispatcherClass on the resource (that is how TMCPDataResource adds dataset support).
  • A local server on stdio, without HTTP: TMCPStdioServer.Serve(TMyTools.Create, 'name', '1.0.0') in a console program (MARS.MCP.Stdio; JSON-RPC a line each on stdin/stdout, UTF-8; log only to stderr), registered with claude mcp add name -- path\to\exe.

When to read the references

  • Any authentication requirement — Bearer tokens, roles, hiding tools per user, OAuth login window for Claude/ChatGPT/Open WebUI: read references/authorization.md first, it also lists client-specific pitfalls that look like server bugs.
  • Tools that query a database (FireDAC, TFDQuery, TMARSFireDAC, or Devart UniDAC/MyDAC/IBDAC with TMARSUniDAC/TMARSMyDAC/TMARSIBDAC): read references/database-tools.md — dataset ownership rules matter.
  • MCP resources or prompts (attachable content like DB schemas, URI templates, reusable prompt templates): read references/resources-prompts.md.
  • Interactive UIs / MCP Apps (a chart, form or dashboard rendered by Claude or another host next to a tool result, ui:// resources): read references/mcp-apps.md.

Verify the server

With curl (initialize / list / call):

curl -X POST http://localhost:8080/rest/default/mcp -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

curl -X POST http://localhost:8080/rest/default/mcp -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"add_numbers","arguments":{"a":2,"b":3}}}'

With the official MCP Inspector (needs Node.js), which performs a real client handshake:

npx @modelcontextprotocol/inspector --cli http://localhost:8080/rest/default/mcp --transport http --method tools/list

Connect real clients: claude mcp add --transport http my-server http://localhost:8080/rest/default/mcp, or in Open WebUI add an External Tools connection of type MCP (Streamable HTTP) (requires Open WebUI ≥ 0.6.31). Remember: from another machine/container, use the server's LAN IP, not localhost.

Troubleshooting quick table

SymptomLikely cause
Client says no tools / "no such tool"tools not enabled for the chat/model on the client side; or tool hidden by a role filter (by design it answers "Unknown tool")
404 on the endpointwrong composed URL — check engine BasePath (/rest), app path, resource [Path]
403 instead of OAuth loginclass-level [RolesAllowed] fires before MCP: use [MCPOAuth] for OAuth-protected endpoints (see references/authorization.md)
Client aborts during OAuth discoverya /.well-known/* probe returns 500/garbage — wire TMCPOAuthMetadata.HandleWellKnownRequest in BeforeHandleRequest (it also answers clean 404s and serves the openid-configuration alias)
Works with curl, not from Docker/other hostserver bound/reached via localhost only — use the LAN IP; verify with curl from the client's network

Create a new MARS server project

MARS-Curiosity (https://github.com/andrea-magni/MARS) is a REST library for Delphi. A MARS server has three moving parts, regardless of host type:

  1. A project file (.dpr) — the host: console app, VCL/FMX form, Windows service, ISAPI dll, Apache module, or Linux daemon. The host creates an HTTP server (typically TMARShttpServerIndy) bound to the engine.
  2. Server.Ignition.pas — creates the singleton IMARSEngine (TServerEngine.Default), loads configuration, and registers applications with AddApplication(AName, ABasePath, AResourceMasks).
  3. Resource units (Server.Resources.*.pas) — plain classes annotated with attributes ([Path], [GET], [Produces], ...) and registered in their initialization section via MARSRegister(...). This JAX-RS style is the primary MARS model. As an addition (not a replacement), endpoints can also be defined as routes in code (Server.Routes*.pas, MARS.Core.Routes, Express style), next to the resources.

Endpoint URLs compose as: engine base path (/rest by default) + application base path (/default) + resource [Path] + method [Path]. So the HelloWorld template answers at http://localhost:8080/rest/default/helloworld.

Two ways to scaffold

Option A — copy the official template (recommended for full projects)

Demos/MARSTemplate/ in the MARS repository is the canonical project group: console host, VCL form host, FMX host, Windows service, ISAPI, Apache module, FCGI, Linux daemon, tests, and an FMX client — all sharing the same Server.Ignition.pas and resource units. To scaffold:

  1. Copy the whole Demos/MARSTemplate folder to the target location, outside the MARS folder (the setup's uninstaller deletes the MARS folder; MARSCmd uses Documents\MARS Projects\<name>). The .dproj search paths and the RootFolder of Server.Resources.OpenAPI.pas refer to the MARS folder as ..\..\ ({bin}\..\..\..\): outside Demos\ rewrite them as $(MARSDIR)\ (IDE environment variable set by the setup) and drop the ..\..\Source in clause/DCCReference of MARS.Linux.Daemon, as MARSCmd does.
  2. Rename files and rename the MARSTemplate prefix inside .dpr/.dproj/.groupproj files to the new project name (keep Server.*.pas unit names as they are — the engine registers resources by unit name mask 'Server.Resources.*').
  3. Delete the host flavors the user does not need.
  4. Rename the ini file in bin/ to match the new executable name.

Pick the template:

  • Demos/MARSTemplate/ (default): Indy, endpoints as resource classes;
  • Demos/MARSTemplateDCS/: the same on Delphi Cross Socket, if the user asks for the DCS transport;
  • Demos/MARSTemplateRoutes/: the same as MARSTemplate, with its sample endpoints defined as routes in code (Server.Routes.pas, MARS.Core.Routes, Express style), only if the user asks for route-based / Express-style endpoints. Routes are in addition to resources: token (login) and OpenAPI stay resources there too, and resource units can be added to that project as to any other ('Server.Resources.*').

MARSCmd (Utils\Bin\Win32\MARScmd_VCL.exe) lists the three templates and does all the steps above. From the command line (prefer it when you can run programs: it does steps 1, 2 and 4 exactly as the tool, with a random JWT.Secret), use Utils\Bin\Win32\MARScmd.exe:

MARScmd <ProjectName> [--template MARSTemplate|MARSTemplateDCS|MARSTemplateRoutes|<folder>] [--dest <folder>]
MARScmd --list-templates

Default destination: Documents\MARS Projects\<ProjectName>; a destination inside the MARS folder needs --allow-inside; exit code 0 = created, 1 = error (i.e. destination not empty), 2 = wrong command line. Then delete the host flavors the user does not need (step 3).

Option B — generate a minimal project from bundled templates

For a lean, from-scratch server (one console host, HelloWorld + Token resources, ini config), generate the files from assets/ in this skill directory, replacing every occurrence of {{PROJECT_NAME}} with the project name (a valid Delphi identifier):

TemplateTarget file
assets/ConsoleServer.dpr.template{{PROJECT_NAME}}Server.dpr
assets/Server.Ignition.pas.templateServer.Ignition.pas
assets/Server.Resources.HelloWorld.pas.templateServer.Resources.HelloWorld.pas
assets/Server.Resources.Token.pas.templateServer.Resources.Token.pas
assets/ServerConfig.ini.templatebin\{{PROJECT_NAME}}Server.ini (next to the executable)

Then create a .dproj for it (or let the user open the .dpr in the IDE and save). Set the output directory to bin\ so the executable sits next to its ini file.

Option C — from an OpenAPI document (MARSgen)

When the API is described by an OpenAPI 3.0/3.1 document (JSON or YAML, file or URL), generate the project with Utils\Bin\Win32\MARSgen.exe: it runs MARSCmd (same templates, same options) and adds the resources of every operation, the Delphi types of the schemas, and the links (Server.<Api> in the uses of Server.Ignition, the base path of the document as engine/application paths, title/version in Server.ini):

MARSgen openapi <document> --project <ProjectName> [--template MARSTemplate|MARSTemplateDCS|MARSTemplateRoutes] [--dest <folder>]

Every operation answers 501 until implemented: override its Do<Operation> method in Server.Resources.<Name>.pas (the user's unit; *.Base.pas units are generated, never edit them). Keep <Api>.marsgen.json with the sources: MARSgen update <folder> imports the document again after it changes, never touching the user's units. See the mars-development skill, references/marsgen.md.

Project requirements (all options)

  • Library paths: the project must see the MARS sources. Either the user installed MARS (Library Path already contains them) or add to the project search path: [MARS]\Source, [MARS]\ThirdParty\delphi-jose-jwt\Source\Common, [MARS]\ThirdParty\delphi-jose-jwt\Source\JOSE (a git submodule: clone MARS with --recurse-submodules), [MARS]\ThirdParty\mORMot2\src\core, [MARS]\ThirdParty\mORMot2\src\crypt, [MARS]\ThirdParty\mORMot2\src\lib, [MARS]\ThirdParty\Neslib.Yaml, [MARS]\ThirdParty\Neslib.Yaml\Neslib.
  • {$I MARS.inc} must compile — it lives in [MARS]\Source, so that path is required even for the .dpr.
  • JWT backend: exactly one of MARS.mORMotJWT.Token (Windows) or MARS.JOSEJWT.Token (all platforms) must be in the ignition uses clause. The template handles this with {$IFDEF MSWINDOWS}.
  • Delphi compatibility: 10.4 Sydney through 13 Florence; earlier versions are not supported (MARS.inc stops the build). Packages per IDE version are in [MARS]\Packages\.

Configuration defaults

The engine defaults (from TMARSEngine.Create): Port=8080, PortSSL=0, ThreadPoolSize=75, BasePath=/rest. FEngine.Parameters.LoadFromIniFile overrides them from an ini named like the executable (or passed with the -configFileName <file> command-line switch), section [DefaultEngine]. See the ini template for the commented catalog of common settings (JWT, CORS, compression, SSL, OpenAPI info, FireDAC connection defs).

Adding more pieces

  • New resource: create Server.Resources.<Name>.pas with an attributed class, register it with MARSRegister(TMyResource) in initialization, and add the unit to the .dpr uses. No engine change needed — the 'Server.Resources.*' mask picks it up.

  • New route module (projects using routes, or when the user asks for them): create Server.Routes.<Name>.pas registering a module with MARSRoutes('Server.Routes.<Name>', '<path>', procedure (const R: TMARSRouter) ...) in initialization, add the unit to the .dpr uses, and make sure the ignition calls LApplication.AddRoutes('Server.Routes.*') (already there in MARSTemplateRoutes). See the mars-development skill, references/routes.md.

  • Token/login endpoint: already included (Server.Resources.Token.pas subclasses TMARSTokenResource). Override Authenticate to plug real credential checks.

  • OpenAPI/Swagger endpoint: see Demos/MARSTemplate/Server.Resources.OpenAPI.pas (TOpenAPIResource + MARS.OpenAPI.v3.InjectionService in the ignition uses) and the OpenAPI.info.* ini parameters; the documentation pages are Swagger UI (<app>/www/) and Stoplight Elements (<app>/docs, TOpenAPIElementsResource of MARS.OpenAPI.Elements).

  • FireDAC: uncomment the FireDAC.<DefName>.* entries in the ini; the ignition template already calls TMARSFireDAC.LoadConnectionDefs(FEngine.Parameters, 'FireDAC') under {$IFDEF MARS_FIREDAC}.

  • Devart UniDAC, MyDAC or IBDAC instead of FireDAC: define MARS_UNIDAC/MARS_MYDAC/MARS_IBDAC in the projects (or in MARS.inc), load the connection defs with TMARS<Lib>.LoadConnectionDefs(FEngine.Parameters, '<Lib>') and add <Lib>.<DefName>.* entries to the ini. See the mars-development skill, references/devart.md, and the demos Demos/UniDACDemo, MyDACDemo, IBDACDemo (Demos/FireDACDemo for FireDAC).

  • Deployment (Windows service install, ISAPI on IIS, Apache module, FastCGI, Linux daemon, HTTPS/SSL, reverse proxy): read references/deployment.md in this skill.

For everything about writing resources (attributes, parameter binding, auth, FireDAC and Devart datasets, SSE, WebStencils, clients), consult the companion skill mars-development.

Verify the result

  1. Compile (IDE or MSBuild against the .dproj).
  2. Run the server and hit http://localhost:8080/rest/default/helloworld — expect Hello World! as text/plain.
  3. Login check: POST http://localhost:8080/rest/default/token with form fields username and password returns a JSON token. Note: the sample Authenticate in TMARSTokenResource accepts the current hour (0-23) as password (SameText(APassword, IntToStr(HourOf(Now)))) and grants role standard (plus admin for username admin) — it exists only to make demos runnable. Override it before any real use.

Sponsors

Details

Marketplace
andrea-magni/MARS
Category
Community