/mars-curiosity:mars-new-projectfrom MARS-Curiosity
Scaffolds a new REST server project using MARS-Curiosity (Delphi REST library). Guides through creating project files, ignition unit, and resource units with JAX-RS style annotations. Supports console, VCL/FMX GUI, Windows service, ISAPI, Apache module, FastCGI, and Linux daemon hosts.
Ships in MARS-Curiosity. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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:
TMARShttpServerIndy) bound to the engine.Server.Ignition.pas — creates the singleton IMARSEngine (TServerEngine.Default), loads configuration, and registers applications with AddApplication(AName, ABasePath, AResourceMasks).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.
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:
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.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.*').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).
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):
| Template | Target file |
|---|---|
assets/ConsoleServer.dpr.template | {{PROJECT_NAME}}Server.dpr |
assets/Server.Ignition.pas.template | Server.Ignition.pas |
assets/Server.Resources.HelloWorld.pas.template | Server.Resources.HelloWorld.pas |
assets/Server.Resources.Token.pas.template | Server.Resources.Token.pas |
assets/ServerConfig.ini.template | bin\{{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.
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.
[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.MARS.mORMotJWT.Token (Windows and Linux) or MARS.JOSEJWT.Token (all platforms) must be in the ignition uses clause. The template handles this with {$IF Defined(MSWINDOWS) or Defined(LINUX)} (mORMot there, JOSE elsewhere); projects created before 2.1.1 have {$IFDEF MSWINDOWS}, that is JOSE on Linux, and work as they are.MARS.inc stops the build). Packages per IDE version are in [MARS]\Packages\.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).
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.
.dproj).http://localhost:8080/rest/default/helloworld — expect Hello World! as text/plain.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 and works in DEBUG builds only (a RELEASE build raises, asking to override it). Override it before any real use.assets/ConsoleServer.dpr.template (opens in a new tab)assets/Server.Ignition.pas.template (opens in a new tab)assets/Server.Resources.HelloWorld.pas.template (opens in a new tab)assets/Server.Resources.Token.pas.template (opens in a new tab)assets/ServerConfig.ini.template (opens in a new tab)references/deployment.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub andrea-magni/mars --plugin mars-curiosity3 skills in this plugin
/mars-developmentDevelop REST APIs with MARS-Curiosity (Delphi REST library) - writing resources (the primary, JAX-RS style model) and, as an additional option, route-based endpoints (Express style, MARS.Core.Routes, middlewares), REST attributes, parameter binding, JWT authentication and roles, dataset publishing with FireDAC or Devart UniDAC/MyDAC/IBDAC, server-sent events (SSE), WebStencils HTML templating, client components, configuration, serialization, code generated from OpenAPI documents or JSON samples (MARSgen). Use this skill whenever the user is working in a Delphi project that uses MARS (units named MARS.*, Server.Ignition, Server.Resources.*, Server.Routes*), asks how to add or modify REST endpoints, secure endpoints with tokens/roles, expose datasets, push events to clients, render server-side HTML, consume a MARS server from a client, handle errors, or configure a MARS server - even if they don't mention MARS by name but the code clearly uses it./mars-mcp-serverBuild MCP (Model Context Protocol) servers in Delphi with MARS-Curiosity, so AI agents (Claude, ChatGPT, Open WebUI/Ollama, MCP Inspector) can discover and call Delphi code as tools, read MCP resources, use MCP prompts and show interactive views (MCP Apps). Use this skill whenever the user wants to expose Delphi/MARS functionality to an AI agent or LLM, mentions MCP, MCP server, MCP tools, resources, prompts, tool calling, function calling, AI agents, connectors, or wants Claude/ChatGPT/a local model to query their Delphi application or database; also when working with MARS.MCP.* units, TMCPResource, [MCPTool], [MCPResource], [MCPPrompt], [MCPToolUI], [MCPAppResource], TMCPOAuthServer, MCP Apps / interactive UIs rendered by Claude next to a tool result, or debugging an MCP client that cannot connect or authenticate to a MARS server.Other plugins' skills for the same job