Feature Request: Mendix Catalog Integration
Summary
Add mxcli catalog search command to discover and list services from Mendix Catalog programmatically.
Problem
Mendix Catalog (catalog.mendix.com) is the centralized registry for discovering data sources and services across an organization's landscape. It indexes OData services, REST APIs, SOAP services, and Business Events published by Mendix applications and external systems.
Currently, users must:
- Manually browse the Catalog web portal to discover available services before consuming them
- Copy service URLs and metadata paths into Studio Pro or MDL scripts by hand
- Lack scriptable access for CI/CD pipelines that need to validate service availability or generate reports
This creates friction in development workflows and prevents automation of service discovery in CI/CD pipelines.
Proposed Feature (Phase 1)
mxcli catalog search <query> [flags]
Search for Catalog services with filters.
Examples:
# Authenticate first (one-time)
mxcli auth login
# Basic search
mxcli catalog search "customer"
# Filter by service type
mxcli catalog search "customer" --service-type OData
# Production endpoints only
mxcli catalog search "inventory" --production-only
# JSON output for scripting
mxcli catalog search "order" --json | jq '.[] | {name, uuid, type}'
# Pagination
mxcli catalog search "api" --limit 10 --offset 20
Table Output (7 columns, ~120 chars):
NAME TYPE VERSION APPLICATION ENVIRONMENT PROD UUID
CustomerService OData 1.2.0 CRM Application Production Yes a7f3c2d1
OrderAPI REST 2.0.1 E-commerce Platform Acceptance No b8e4d3e2
InventorySync SOAP 1.0.0 Warehouse System Test No c9f5e4f3
Flags:
--profile <name> - Auth profile (default: "default")
--service-type <OData|REST|SOAP> - Filter by protocol
--production-only - Show only production endpoints
--owned-only - Show only owned services
--limit <n> - Results per page (default: 20, max: 100)
--offset <n> - Pagination offset (default: 0)
--json - Output as JSON array
mxcli catalog show <uuid> [flags]
Display detailed endpoint metadata including entities, actions, and full contract.
Examples:
# Show endpoint details
mxcli catalog show a7f3c2d1-4b5e-6c7f-8d9e-0a1b2c3d4e5f
# JSON output with full metadata
mxcli catalog show a7f3c2d1 --json
Human-readable output:
Name: CustomerService
Type: OData
Version: 1.2.0
Application: CRM Application
Environment: Production (EU)
Description: Manages customer data and relationships
Entities (3):
- Customer (6 attributes, 2 associations)
- Order (5 attributes, 1 association)
- Address (4 attributes)
Actions (2):
- CalculateDiscount
- ValidateCustomer
Flags:
--profile <name> - Auth profile (default: "default")
--json - Output full JSON response including embedded contract
Technical Implementation
API: https://catalog.mendix.com/rest/search/v5/data
OpenAPI Spec: https://docs.mendix.com/openapi-spec/catalog-search_v5.yaml
Auth: Reuses existing internal/auth infrastructure (PAT tokens)
Host whitelisting: catalog.mendix.com already in internal/auth/scheme.go
Files to create:
internal/catalog/types.go - API request/response structs
internal/catalog/client.go - HTTP client for catalog.mendix.com/rest/search/v5
cmd/mxcli/cmd_catalog.go - Cobra command definitions
Architecture Discussion: Future Integration
Before implementing, we need to decide where Catalog integration should live to support future features like:
# Future goal: Create OData client from Catalog entry
mxcli catalog create-odata-client <uuid> --into MyModule -p app.mpr
Key Technical Detail: Two-Step API Workflow
The Catalog API requires two endpoint calls to create an OData client:
Step 1: Discovery - GET /data returns search results with UUIDs:
{
"data": [
{
"uuid": "a7f3c2d1-4b5e-6c7f-8d9e-0a1b2c3d4e5f",
"name": "CustomerService",
"serviceType": "OData",
// ... basic metadata
}
]
}
Step 2: Fetch Contract - GET /endpoints/{uuid} returns the full metadata:
{
"uuid": "a7f3c2d1-4b5e-6c7f-8d9e-0a1b2c3d4e5f",
"serviceVersion": {
"contracts": [
{
"type": "CSDL",
"documents": [
{
"isPrimary": true,
"uri": "metadata.xml",
"contents": "<?xml version=\"1.0\" encoding=\"utf-8\"?><edmx:Edmx>...</edmx:Edmx>"
}
]
}
]
}
}
Key insight: The metadata is embedded in the JSON response (serviceVersion.contracts[0].documents[0].contents), not at a separate URL. This means:
- Users cannot simply copy a URL and paste into MDL (metadata requires auth to fetch)
- Any client creation feature must handle the API call to extract the embedded contract
Current Architecture
Current state:
- CLI commands (
cmd/mxcli/cmd_*.go): Network-aware, auth-aware, can call external APIs
- MDL execution (
mdl/executor/*.go): Pure MPR manipulation, no network, no auth
- Existing MDL syntax:
CREATE EXTERNAL ENTITIES FROM 'http://...' INTO MyModule (requires public URL)
Desired future workflow:
# Step 1: Discovery via CLI
mxcli catalog search "customer"
# Output: CustomerService (uuid: a7f3c2d1...)
# Step 2: Create OData client from catalog UUID
# Option A: Via CLI command?
mxcli catalog create-odata-client a7f3c2d1 --into MyModule -p app.mpr
# Option B: Via MDL syntax?
CREATE EXTERNAL ENTITIES FROM CATALOG 'a7f3c2d1' INTO MyModule;
Core Architectural Question
Phase 1 (this issue) implements CLI-only search: mxcli catalog search "customer"
Phase 2 (future) needs to support: CREATE EXTERNAL ENTITIES FROM CATALOG '<uuid>' INTO MyModule
The question is: Should MDL/REPL/Executor support Catalog integration?
Current State
- MDL/Executor: Pure MPR manipulation, no network, no auth
- CLI commands: Network-aware, auth-aware, can call platform APIs
- Existing pattern:
CREATE EXTERNAL ENTITIES FROM 'http://...' requires a public URL
The Challenge
To create an OData client from Catalog, we need to:
- Authenticate with PAT token
- Call
GET /endpoints/{uuid} (requires auth)
- Extract embedded metadata from JSON response
- Parse and create entities in MPR
Option A: MDL/Executor Integration
- Add
FROM CATALOG '<uuid>' to MDL grammar
- Executor calls Catalog API internally
- Works in REPL, scripts, and CLI
- Trade-off: Executor becomes network-dependent (auth, latency, errors, offline mode breaks)
Option B: CLI-Only
mxcli catalog create-odata-client <uuid> --into MyModule -p app.mpr
- CLI fetches metadata, generates MDL, executes
- Trade-off: Cannot use in REPL/scripts, two ways to create clients
Key Questions
-
Should the executor have network access?
- Currently: Pure MPR manipulation (offline, deterministic, testable)
- Catalog integration would require: HTTP calls, auth, error handling for network failures
- Impact: Testing complexity, offline usage, REPL session reliability
-
Should REPL sessions call external APIs?
- Today: REPL is local-only (reads/writes MPR file)
- Catalog integration: REPL would need credentials, handle auth failures mid-session
- User experience: Is network dependency in REPL acceptable?
-
Should MDL syntax support Catalog UUIDs?
- Yes:
FROM CATALOG '<uuid>' alongside FROM 'http://...' (consistent, powerful)
- No: Keep MDL pure, use CLI commands for Catalog workflows (simpler, explicit)
-
How should credentials flow into executor?
- Executor takes
(reader, ast) parameters today
- Need: Profile name, PAT token, HTTP client
- Options: Pass explicitly, use ambient env vars, or keep executor pure
Recommendation
Phase 1 (this PR): Implement mxcli catalog search only. Defer architecture decision.
Phase 2 (future discussion): Decide based on:
- User feedback on Phase 1 workflows
- Prototype both approaches to compare UX/complexity
- Team consensus on whether executor should be network-aware
This issue focuses on Phase 1. Architecture discussion for Phase 2 can happen in a separate issue/proposal once we have real usage data.
Proposed Acceptance Criteria (Phase 1)
Search command:
Show command:
Quality:
Out of Scope (Future PRs)
- Creating OData clients from discovered services (pending architecture decision in Phase 2)
- Interactive search UI (fzf-style picker)
References
Feature Request: Mendix Catalog Integration
Summary
Add
mxcli catalog searchcommand to discover and list services from Mendix Catalog programmatically.Problem
Mendix Catalog (catalog.mendix.com) is the centralized registry for discovering data sources and services across an organization's landscape. It indexes OData services, REST APIs, SOAP services, and Business Events published by Mendix applications and external systems.
Currently, users must:
This creates friction in development workflows and prevents automation of service discovery in CI/CD pipelines.
Proposed Feature (Phase 1)
mxcli catalog search <query> [flags]Search for Catalog services with filters.
Examples:
Table Output (7 columns, ~120 chars):
Flags:
--profile <name>- Auth profile (default: "default")--service-type <OData|REST|SOAP>- Filter by protocol--production-only- Show only production endpoints--owned-only- Show only owned services--limit <n>- Results per page (default: 20, max: 100)--offset <n>- Pagination offset (default: 0)--json- Output as JSON arraymxcli catalog show <uuid> [flags]Display detailed endpoint metadata including entities, actions, and full contract.
Examples:
Human-readable output:
Flags:
--profile <name>- Auth profile (default: "default")--json- Output full JSON response including embedded contractTechnical Implementation
API:
https://catalog.mendix.com/rest/search/v5/dataOpenAPI Spec: https://docs.mendix.com/openapi-spec/catalog-search_v5.yaml
Auth: Reuses existing
internal/authinfrastructure (PAT tokens)Host whitelisting:
catalog.mendix.comalready ininternal/auth/scheme.goFiles to create:
internal/catalog/types.go- API request/response structsinternal/catalog/client.go- HTTP client for catalog.mendix.com/rest/search/v5cmd/mxcli/cmd_catalog.go- Cobra command definitionsArchitecture Discussion: Future Integration
Before implementing, we need to decide where Catalog integration should live to support future features like:
Key Technical Detail: Two-Step API Workflow
The Catalog API requires two endpoint calls to create an OData client:
Step 1: Discovery -
GET /datareturns search results with UUIDs:{ "data": [ { "uuid": "a7f3c2d1-4b5e-6c7f-8d9e-0a1b2c3d4e5f", "name": "CustomerService", "serviceType": "OData", // ... basic metadata } ] }Step 2: Fetch Contract -
GET /endpoints/{uuid}returns the full metadata:{ "uuid": "a7f3c2d1-4b5e-6c7f-8d9e-0a1b2c3d4e5f", "serviceVersion": { "contracts": [ { "type": "CSDL", "documents": [ { "isPrimary": true, "uri": "metadata.xml", "contents": "<?xml version=\"1.0\" encoding=\"utf-8\"?><edmx:Edmx>...</edmx:Edmx>" } ] } ] } }Key insight: The metadata is embedded in the JSON response (
serviceVersion.contracts[0].documents[0].contents), not at a separate URL. This means:Current Architecture
Current state:
cmd/mxcli/cmd_*.go): Network-aware, auth-aware, can call external APIsmdl/executor/*.go): Pure MPR manipulation, no network, no authCREATE EXTERNAL ENTITIES FROM 'http://...' INTO MyModule(requires public URL)Desired future workflow:
Core Architectural Question
Phase 1 (this issue) implements CLI-only search:
mxcli catalog search "customer"Phase 2 (future) needs to support:
CREATE EXTERNAL ENTITIES FROM CATALOG '<uuid>' INTO MyModuleThe question is: Should MDL/REPL/Executor support Catalog integration?
Current State
CREATE EXTERNAL ENTITIES FROM 'http://...'requires a public URLThe Challenge
To create an OData client from Catalog, we need to:
GET /endpoints/{uuid}(requires auth)Option A: MDL/Executor Integration
FROM CATALOG '<uuid>'to MDL grammarOption B: CLI-Only
mxcli catalog create-odata-client <uuid> --into MyModule -p app.mprKey Questions
Should the executor have network access?
Should REPL sessions call external APIs?
Should MDL syntax support Catalog UUIDs?
FROM CATALOG '<uuid>'alongsideFROM 'http://...'(consistent, powerful)How should credentials flow into executor?
(reader, ast)parameters todayRecommendation
Phase 1 (this PR): Implement
mxcli catalog searchonly. Defer architecture decision.Phase 2 (future discussion): Decide based on:
This issue focuses on Phase 1. Architecture discussion for Phase 2 can happen in a separate issue/proposal once we have real usage data.
Proposed Acceptance Criteria (Phase 1)
Search command:
mxcli catalog search <query>command works with all filter flagsShow command:
mxcli catalog show <uuid>displays detailed endpoint metadataQuality:
Out of Scope (Future PRs)
References
internal/auth/,cmd/mxcli/cmd_auth.go