Agent skill

Mock REST APIs

by mendixlabs in mendixlabs/mxcli

Stand up an HTTP endpoint you control instead of a live third-party API, and point the Mendix app at it — Prism from an OpenAPI contract, a constant swap, or a forward proxy.

Apache-2.0Auto-check passedBackend & APIs

Install Mock REST APIs

skills CLI
$ npx skills add mendixlabs/mxcli --skill mock-rest-apis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mendixlabs/mxcli mock-rest-apis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mendixlabs/mxcli.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/mendix/mock-rest-apis .claude/skills/mock-rest-apis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mock-rest-apis
GitHub stars
128
Used in
1 other repo
Token cost
~2.5k tokens
SKILL.md length
1,276 words
Files
1
Skills in repo
72
Repo updated
First seen
Licence
Apache-2.0

At a glance

Stand up an HTTP endpoint you control instead of a live third-party API, and point the Mendix app at it — Prism from an OpenAPI contract, a constant swap, or a forward proxy.

  • Works in 3 steps: Point the app at the mock → Prism: serve an OpenAPI contract as a mock → Forward proxy: when the model cannot…
  • Debugging a REST integration without the real API
  • SKILL.md covers When to Use This Skill, Two separate problems, 1. Point the app at the mock and 2. Prism: serve an OpenAPI…, plus 4 more sections
  • Calls curl and npm

What it does

Mock REST APIs is an agent skill from mendixlabs/mxcli. Stand up an HTTP endpoint you control instead of a live third-party API, and point the Mendix app at it — Prism from an OpenAPI contract, a constant swap, or a forward proxy. Use when building or debugging a REST integration without the real API, forcing a 404/500 through an error handler, or running offline or in CI.

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering REST APIs, Third-party API integration and OpenAPI specifications. It works with OpenAPI. The repository describes itself as: Mendix cli tool, a headless way to work with Mendix projects. Enables Mendix projects for use with 3rd party agentic coding tools like Claude Code and Copilot. Includes a… The licence is Apache-2.0.

When your agent uses it

  • Debugging a REST integration without the real API
  • Forcing a 404/500 through an error handler
  • Running offline

Example prompts

  • “/mock-rest-apis”

Requirements

  • Node.js

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Point the app at the mock
  2. Prism: serve an OpenAPI contract as a mock
  3. Forward proxy: when the model cannot change

What it can do on your machine

Read from SKILL.md and the folder at commit 20a6c89. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use curl and npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mock REST APIs loads about 2.5k tokens when it runs. Until then it costs about 84 tokens; SKILL.md has 1,276 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~84
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mendixlabs/mxcli at commit 20a6c89, republished under its Apache-2.0 licence (© mendixlabs). 1,276 words, ~2,484 tokens.

Download SKILL.mdSave it as .claude/skills/mock-rest-apis/SKILL.md (or your agent's skills folder).
name
mock-rest-apis
description
Stand up an HTTP endpoint you control instead of a live third-party API, and point the Mendix app at it — Prism from an OpenAPI contract, a constant swap, or a forward proxy. Use when building or debugging a REST integration without the real API, forcing a 404/500 through an error handler, or running offline or in CI.

Mock REST APIs Skill

Use this skill when a REST integration needs an endpoint you control instead of a live third-party API — while building it, while reproducing a bug, or while verifying the app in a browser or a test run.

Developing against the real API means network, rate limits, credentials, and a payload that can change under you. None of that is where Mendix integration defects live: those are in the mapping, the entity types, the error handler, and the BSON. A mock removes the variables that are not the bug.

When to Use This Skill

  • Building a REST client or REST CALL microflow before (or without) real credentials
  • Reproducing a payload-shaped bug deterministically — a shape small enough to read, that behaves the same on every run
  • Exercising error paths: 404, 500, a timeout, a 401 from missing auth
  • Verifying the app (test-app) or running a suite (test-microflows) offline or in CI
  • Redirecting the outbound calls of an app whose model you must not edit

Two separate problems

Almost every wasted hour here comes from conflating them:

ProblemAnswer
Something must answer the requestA mock server: Prism (from a contract), WireMock, mitmproxy
The app must send the request thereA constant, a BaseUrl, or a forward proxy — see below

A mock server is not an interceptor. Prism serves one contract at one port and answers only clients that address it. Asking it to "catch all calls the app already makes" is a category error — that is the forward-proxy job, further down.

1. Point the app at the mock

Three routes, cheapest first. Pick by how the URL is built.

The URL is built in the microflow — use a constant, change nothing per run

A REST CALL URL is an expression, so it can be assembled from a constant (@Module.Constant is Mendix's constant reference — $Name is a variable):

sql
mdl 1;
create constant MyModule.ApiBaseUrl ( Type: String, DefaultValue: 'https://api.example.com/v1' );

create microflow MyModule.CallApi() returns string
begin
  $response = call rest service get @MyModule.ApiBaseUrl + '/rates' (
    Headers: ('Accept': 'application/json'),
  ) returns string;
  return $response;
end;

Then swap the endpoint per run, with no model change and nothing committed:

bash
# this run only — never written to the project
mxcli run --local -p app.mpr --constant MyModule.ApiBaseUrl=http://127.0.0.1:4020

# a test suite against the mock (--constant needs --local)
mxcli test tests/ -p app.mpr --local --constant MyModule.ApiBaseUrl=http://127.0.0.1:4020

# machine-local default, gitignored: every run picks it up
mxcli constant set MyModule.ApiBaseUrl http://127.0.0.1:4020 -p app.mpr

# flip it on an app that is already running
mxcli constant set MyModule.ApiBaseUrl http://127.0.0.1:4020 -p app.mpr --apply

constant set refuses a name the project does not define, so a typo cannot silently apply to nothing. mxcli constant list -p app.mpr shows the winning value for every constant and which layer set it — read it first whenever a run does not use the endpoint you expected.

The call goes through a REST client document — rewrite BaseUrl

A REST client document's BaseUrl is a literal; it cannot reference a constant. Point it at the mock by re-running the create, which is a one-line diff:

sql
mdl 1;
create or modify consumed rest service MyModule.RatesAPI (
  OpenAPI: 'specs/rates.json',
  BaseUrl: 'http://127.0.0.1:4020'
);

BaseUrl also overrides servers[0].url at import time, so one contract can be imported against the mock and later re-pointed at production.

You cannot edit the model at all — use a forward proxy

See §3. This is the most work and the last resort.

2. Prism: serve an OpenAPI contract as a mock

bash
npm install -g @stoplight/prism-cli      # ~15s
prism mock specs/rates.json --port 4020  # serves the contract's `example` values

Everything below cost real time to find out and is not on Prism's front page:

  • Prism mounts paths at the root and ignores any base path in servers[0].url. Address it as http://127.0.0.1:4020, not http://127.0.0.1:4020/v1 — otherwise every path 404s while the server looks perfectly healthy.
  • Make servers[0].url absolute in the contract you import. mxcli's OpenAPI import only accepts an http:// or https:// URL as BaseUrl; a relative one (/api/v3) is skipped with the warning "server URL … is relative and cannot be used as BaseUrl; set BaseUrl explicitly in CREATE CONSUMED REST SERVICE", and a client with no BaseUrl fails at call time, not at import time.
  • Prefer: code=404 on the request forces any status the contract documents. This is the only practical way to drive a Mendix error handler through a real HTTP response rather than by hand-editing the model.
  • prism mock -d returns schema-generated random data instead of the example values. Run the suite both ways: a mapping that quietly depends on one fixed payload passes under example and fails under -d.
  • Prism enforces the contract's security, so a call with no Authorization header gets a real 401. Useful — but know the ceiling before you design around it: a REST client document's header value may be a literal, a $Variable, or a literal prefix plus a variable ('Bearer ' + $Token), and nothing else. A token that must be computed per call belongs in a REST CALL expression, not in the document.
  • Cut a subset; never point Prism at a vendor's full contract. The official Microsoft Graph spec is 41 MB of YAML: it downloads in seconds and Prism was still printing "Starting Prism…" when killed at a 300-second cap. Importing it would also generate thousands of operations into the module.

A contract small enough to read is the point. Hand-cut one path with one example per response code you care about, and keep it in the project under specs/ next to the .mpr — the same relative path the OpenAPI: clause takes.

Show full SKILL.md (487 more words)Show less

3. Forward proxy: when the model cannot change

For an app whose model you must not touch, redirect the JVM instead. The Mendix runtime honours the standard Java proxy properties, and mxcli run --local passes your environment through to the runtime JVM — including JAVA_TOOL_OPTIONS, which mxcli appends to rather than replaces, so an exported value survives even alongside --trace. No model change, nothing committed:

bash
export JAVA_TOOL_OPTIONS="-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8080"
mxcli run --local -p app.mpr

Two things to know before committing to this route:

  • HTTPS is the real work. The proxy must present a certificate the JVM trusts. WireMock 3.13.2 on Java 21 cannot generate a usable one; use mitmproxy (which ships a CA you install into the JVM truststore) or supply your own keystore. Plain http:// targets need none of this — one more reason to have the mock on loopback HTTP.
  • Loopback is not proxied. 127.0.0.1 sits in the runtime's http.nonProxyHosts, so app→mock traffic on loopback works inside a proxied container without any exemption of your own. It also means a proxy on 127.0.0.1 will not intercept loopback calls — that is not a bug to hunt.

For consumed OData services specifically there is a fourth route that needs no JVM flags: System.ConsumedODataConfiguration carries ProxyConfiguration, ProxyHost and ProxyPort as data (see system-module), so the proxy can be set per service at runtime.

Verify the mock before blaming Mendix

Always prove the endpoint from the shell first. A Mendix error message cannot distinguish "the mock is not running" from "the mapping is wrong".

bash
curl -sS -i http://127.0.0.1:4020/rates          # 200 + the example payload?
curl -sS -i -H 'Prefer: code=404' http://127.0.0.1:4020/rates

Then, and only then, run the microflow and check the payload actually reached it (mxcli oql, or the runtime log under mxcli run --local).

Failure modes, symptoms first

SymptomCauseFix
Every path 404s, server looks fineThe client address includes the contract's base pathAddress Prism at the root: http://127.0.0.1:4020
Import produced a client with no BaseUrlservers[0].url is relative — mxcli warned and skipped itMake it absolute, or pass BaseUrl: explicitly
Prism never finishes startingVendor contract is tens of MBCut the paths you need into a small contract
Mock returns 401The contract declares security; the call sent no credentialsAdd the header, or drop security from your cut contract
Calls still reach the real APIProxy properties not applied, or the target is loopback (never proxied)Check the JVM args; prefer the constant route over a proxy
Endpoint swapped but the app disagreesAn override on a different layer winsmxcli constant list -p app.mpr — it names the layer
Works with example values, fails in CIThe mapping depends on one fixed payloadRun prism mock -d locally and fix the mapping
  • rest-client — the three ways to call a REST API; where the contract goes once you have one
  • rest-call-from-json — JSON structure → entities → import mapping → REST CALL
  • test-app — browser verification; a REST app's prerequisite is a reachable endpoint
  • test-microflows — running a suite; --constant points it at the mock
  • run-local — mxcli run --local, the warm loop the mock plugs into

© mendixlabs, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/mendix/mock-rest-apis of mendixlabs/mxcli.

Open the folder on GitHubat commit 20a6c89

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in mendixlabs/mxcli, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Mock REST APIs next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mock REST APIs compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mock REST APIs this skillmendixlabs/mxcli1281 repos~2.5kAutomated safety check: PassApache-2.0
OpenAPI CLI CallerEvilFreelancer/openapi-to-cli265—~879Automated safety check: PassMIT
Soundcloud API Integrationsoundcloud/api258—~787Automated safety check: PassNone
ToolJet Marketplace Plugin BuilderToolJet/ToolJet41k—~2.1kAutomated safety check: PassAGPL-3.0
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
OpenAPI to MCP Servermcp-use/mcp-use11k—~5.2kAutomated safety check: PassApache-2.0

Similar skills

  • OpenAPI CLI Caller

    EvilFreelancer/openapi-to-cli

    Turns an OpenAPI, Swagger or OpenRPC spec into CLI commands the agent can search and call, with no MCP server or code generation.

    265 GitHub stars~879 tokensUpdated 16 days ago
    Backend & APIsAuto-check passed
  • Integrates applications with the SoundCloud HTTP API using OAuth 2.1, OpenAPI, and developer docs.

    258 GitHub stars~787 tokensUpdated 8 days ago
    Backend & APIsAuto-check passed
  • Turns an API description, such as an OpenAPI file or a Postman collection, into a connector plugin for ToolJet's marketplace and checks it with the repo's validator.

    41k GitHub stars~2.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • OpenAPI to MCP Server

    mcp-use/mcp-use

    Turns an OpenAPI or Swagger spec into an MCP server with the mcp-use TypeScript SDK, mapping each operation to a tool, wiring auth, testing and deploying.

    11k GitHub stars~5.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Use Yaak

    mountain-loop/yaak

    A skill your agent uses when the user mentions Yaak, a Yaak workspace, or the yaak command, or asks to call, hit, or smoke test HTTP/REST endpoints, save or organize API requests for reuse or manual…

    19k GitHub stars~1.9k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from mendixlabs/mxcli

All 72 skills in this repo
  • Mendix Odata Pushdown

    mendixlabs/mxcli

    Push OData query options into the SQL of a Mendix resource served by a read microflow, so $filter, $orderby, $top, $skip, $count and the key lookup reach the database instead of being silently…

    128 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Mendix Vega Charts

    mendixlabs/mxcli

    Chart a Mendix app with Vega-Lite through a pluggable widget that takes the specification and the data as separate properties, so the model emits rows and never assembles a chart payload.

    128 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Agents

    mendixlabs/mxcli

    Author Mendix AI agent documents in MDL — Model, Knowledge Base, Consumed MCP Service and Agent, with variables, tools and multi-line prompts.

    128 GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed
  • Mendix Bulk Oql Dml

    mendixlabs/mxcli

    Run set-based INSERT, UPDATE and DELETE against Mendix entities through OQL statements, which the runtime supports and Studio Pro cannot author.

    128 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Business Events

    mendixlabs/mxcli

    Define event-driven APIs over Kafka with Mendix business event services — publish and subscribe contracts, CREATE/DROP/DESCRIBE.

    128 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Catalog Search

    mendixlabs/mxcli

    Search the Mendix Catalog platform service registry (catalog.mendix.com) from the CLI to find services published across an organisation.

    128 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed

Works with

Categories

Questions about Mock REST APIs

What does Mock REST APIs do?

Stand up an HTTP endpoint you control instead of a live third-party API, and point the Mendix app at it — Prism from an OpenAPI contract, a constant swap, or a forward proxy. Mock REST APIs is an agent skill from mendixlabs/mxcli. Stand up an HTTP endpoint you control instead of a live third-party API, and point the Mendix app at it — Prism from an OpenAPI contract, a constant swap, or a forward proxy.

When should I use Mock REST APIs?

Mock REST APIs fits situations like: debugging a REST integration without the real API; forcing a 404/500 through an error handler; running offline.

How do I install Mock REST APIs in Claude Code?

Run `npx skills add mendixlabs/mxcli --skill mock-rest-apis -a claude-code`. Or copy the skill folder (.claude/skills/mendix/mock-rest-apis in mendixlabs/mxcli) into .claude/skills/mock-rest-apis in your project. Claude Code loads it when a task matches its description.

How do I install Mock REST APIs in Codex?

Run `npx skills add mendixlabs/mxcli --skill mock-rest-apis -a codex`. Or copy the skill folder (.claude/skills/mendix/mock-rest-apis in mendixlabs/mxcli) into .agents/skills/mock-rest-apis in your project. Codex loads it when a task matches its description.

Can I use Mock REST APIs in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mendixlabs/mxcli --skill mock-rest-apis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mock-rest-apis, .gemini/skills/mock-rest-apis, .github/skills/mock-rest-apis and .opencode/skills/mock-rest-apis in your project.

What does Mock REST APIs need to run?

Going by SKILL.md and its folder, Mock REST APIs needs the command-line tools its instructions call (curl and npm). Our summary lists: Node.js.

Does Mock REST APIs access the network?

SKILL.md contains no URLs. Its commands use curl and npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Mock REST APIs safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Mock REST APIs use?

Mock REST APIs is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mock REST APIs use?

About 2.5k tokens (SKILL.md is roughly 9.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Mock REST APIs?

Skills that share tags, products or a category with Mock REST APIs: OpenAPI CLI Caller (EvilFreelancer/openapi-to-cli, 265 stars), Soundcloud API Integration (soundcloud/api, 258 stars), ToolJet Marketplace Plugin Builder (ToolJet/ToolJet, 41k stars) and API Designer (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mock REST APIs?

mendixlabs (a GitHub organization) maintains it in mendixlabs/mxcli, which has 128 GitHub stars. The repository holds 72 skills in this directory. The repository was last updated on October 7, 2026.

Source: mendixlabs/mxcli on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.