@sfdxy/anypoint-connect 0.9.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  <p align="center">
2
- <img src="assets/logo.svg" alt="Anypoint Connect Banner" width="600" />
2
+ <img src="docs/assets/logo.svg" alt="Anypoint Connect Banner" width="600" />
3
3
  </p>
4
4
 
5
5
  <p align="center">
6
6
  <a href="https://www.npmjs.com/package/@sfdxy/anypoint-connect"><img src="https://img.shields.io/npm/v/@sfdxy/anypoint-connect?style=flat-square&color=34d399" alt="npm version" /></a>
7
7
  <a href="https://github.com/Avinava/anypoint-connect/actions"><img src="https://img.shields.io/github/actions/workflow/status/Avinava/anypoint-connect/ci.yml?style=flat-square&color=38bdf8" alt="CI" /></a>
8
- <a href="https://github.com/Avinava/anypoint-connect/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/@sfdxy/anypoint-connect?style=flat-square&color=818cf8" alt="License" /></a>
8
+ <a href="https://github.com/Avinava/anypoint-connect/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@sfdxy/anypoint-connect?style=flat-square&color=818cf8" alt="License" /></a>
9
9
  <a href="https://www.npmjs.com/package/@sfdxy/anypoint-connect"><img src="https://img.shields.io/npm/dm/@sfdxy/anypoint-connect?style=flat-square&color=fbbf24" alt="Downloads" /></a>
10
10
  </p>
11
11
 
@@ -14,13 +14,16 @@
14
14
  </p>
15
15
 
16
16
  <p align="center">
17
- <a href="#architecture">Architecture</a> •
18
- <a href="#setup">Setup</a> •
19
- <a href="#cli-reference">CLI Reference</a> •
20
- <a href="#mcp-server">MCP Server</a> •
21
- <a href="#programmatic-usage">Library</a>
17
+ <a href="https://avinava.github.io/anypoint-connect/">Documentation</a> •
18
+ <a href="#quick-start">Quick Start</a> •
19
+ <a href="#what-it-does">Capabilities</a> •
20
+ <a href="#mcp-server">MCP</a> •
21
+ <a href="#safety">Safety</a> •
22
+ <a href="#ecosystem">Ecosystem</a>
22
23
  </p>
23
24
 
25
+ ---
26
+
24
27
  ## Quick Start
25
28
 
26
29
  ```bash
@@ -37,601 +40,103 @@ anc auth login
37
40
  anc auth status
38
41
  ```
39
42
 
40
- > **Don't have a Client ID yet?** See [Create a Connected App](#2-create-a-connected-app-in-anypoint-platform) below.
41
-
42
- ---
43
-
44
- ## Setup
45
-
46
- ### 1. Install
47
-
48
- ```bash
49
- # Global install from npm (recommended)
50
- npm install -g @sfdxy/anypoint-connect
51
- ```
52
-
53
- <details>
54
- <summary>Install from source</summary>
55
-
56
- ```bash
57
- git clone https://github.com/Avinava/anypoint-connect.git
58
- cd anypoint-connect
59
- npm install && npm run build
60
- npm link # makes "anc" available globally
61
- ```
62
-
63
- </details>
64
-
65
- Verify the install:
66
-
67
- ```bash
68
- anc --version
69
- ```
70
-
71
- ### 2. Create a Connected App in Anypoint Platform
72
-
73
- You need a **Connected App** in Anypoint to authenticate. Here's how to create one:
74
-
75
- 1. Log in to [Anypoint Platform](https://anypoint.mulesoft.com)
76
- 2. Go to **Access Management → Connected Apps**
77
- 3. Click **Create app**, choose **App that acts on a user's behalf**
78
- 4. Set the **Redirect URI** to:
79
- ```
80
- http://localhost:3000/api/callback
81
- ```
82
- 5. Grant these scopes:
83
-
84
- | Scope Category | Permissions |
85
- |---------------|-------------|
86
- | **General** | View Organization, View Environment |
87
- | **Runtime Manager** | Read Applications, Create/Modify Applications |
88
- | **CloudHub** | Read Applications, Manage Applications |
89
- | **Monitoring** | Read Metrics |
90
- | **Design Center** | Read/Write Designer |
91
- | **Exchange** | Exchange Contributor |
92
- | **Audit Logs** | View Audit Logs *(optional)* |
93
-
94
- 6. Copy the **Client ID** and **Client Secret** — you'll need them in the next step.
95
-
96
- ### 3. Configure Credentials
97
-
98
- Run the interactive setup and paste your Client ID and Secret when prompted:
99
-
100
- ```bash
101
- anc config init
102
- ```
103
-
104
- ```
105
- Anypoint Connect Setup — Profile: default
106
- Credentials saved to: ~/.anypoint-connect/profiles/default/config.json
107
- Tokens saved to: ~/.anypoint-connect/profiles/default/tokens.enc (AES-256-GCM)
108
-
109
- Client ID: <paste your Client ID>
110
- Client Secret: <paste your Client Secret>
111
- Callback URL: (http://localhost:3000/api/callback)
112
- Base URL: (https://anypoint.mulesoft.com)
113
- ```
114
-
115
- Verify your config:
116
-
117
- ```bash
118
- anc config show
119
- ```
120
-
121
- ### 4. Authenticate
122
-
123
- This opens your browser for OAuth login and stores encrypted tokens locally:
124
-
125
- ```bash
126
- anc auth login
127
- ```
128
-
129
- Check your auth status anytime:
130
-
131
- ```bash
132
- anc auth status
133
- ```
134
-
135
- ### 5. You're Ready!
43
+ No Connected App yet? The four-step setup, including the exact scopes to grant, is in
44
+ [Getting started](https://avinava.github.io/anypoint-connect/getting-started/). Requires Node.js
45
+ `>=20.0.0`.
136
46
 
137
47
  ```bash
138
- # List apps in an environment
139
48
  anc apps list --env Sandbox
140
-
141
- # Tail logs
142
49
  anc logs tail my-api --env Sandbox
143
-
144
- # Check deployment metrics
145
50
  anc monitor view --env Production
146
51
  ```
147
52
 
148
- ---
149
-
150
- ## Multi-Org / Multi-Profile Setup
151
-
152
- If you work across multiple Anypoint organizations, use **named profiles**:
153
-
154
- ```bash
155
- # Create separate profiles
156
- anc config init --profile org-a
157
- anc config init --profile org-b
158
-
159
- # Authenticate each
160
- anc auth login --profile org-a
161
- anc auth login --profile org-b
162
-
163
- # Bind a project directory to a profile
164
- cd ~/projects/org-a-integrations
165
- anc config use org-a
166
- # Creates .anypoint-connect.json → { "profile": "org-a" }
167
- # All commands in this folder now auto-use "org-a"
168
- ```
169
-
170
- ### Managing Config
171
-
172
- ```bash
173
- anc config show # Show config (secrets masked)
174
- anc config show --profile org-a # Show specific profile
175
- anc config set defaultEnv Production # Update a value
176
- anc config profiles # List all profiles
177
-
178
- # Override per-session
179
- ANYPOINT_PROFILE=org-b anc apps list --env Sandbox
180
- ```
181
-
182
- ### Config Resolution
183
-
184
- Config uses **named profiles** for multi-org support. A profile is first resolved, then credentials within that profile:
185
-
186
- **Profile resolution** (highest priority wins):
187
-
188
- | Priority | Source | Example |
189
- |----------|--------|---------|
190
- | **1** | `--profile` CLI flag | `anc apps list --profile org-a --env Sandbox` |
191
- | **2** | `ANYPOINT_PROFILE` env var | `export ANYPOINT_PROFILE=org-a` |
192
- | **3** | `.anypoint-connect.json` in project | `{ "profile": "org-a" }` (walks up from cwd) |
193
- | **4** | Fallback | `"default"` |
194
-
195
- **Credential resolution** within a profile (highest priority wins):
196
-
197
- | Priority | Source | When to use |
198
- |----------|--------|-------------|
199
- | **1 (highest)** | Environment variables | CI/CD pipelines, Docker, per-session overrides |
200
- | **2** | Profile config.json | Day-to-day development — persists per profile |
201
- | **3 (lowest)** | `.env` in cwd | Legacy/project-local fallback |
202
-
203
- Storage layout:
204
-
205
- ```
206
- ~/.anypoint-connect/
207
- └── profiles/
208
- ├── default/
209
- │ ├── config.json OAuth credentials (chmod 600)
210
- │ └── tokens.enc AES-256-GCM encrypted tokens
211
- └── org-a/
212
- ├── config.json
213
- └── tokens.enc
214
- ```
215
-
216
- ---
217
-
218
- ## Architecture
219
-
220
- ```mermaid
221
- graph LR
222
- CLI["CLI — anc"] --> AC["AnypointClient"]
223
- MCP["MCP Server"] --> AC
224
- LIB["Library"] --> AC
225
-
226
- AC --> HTTP["HttpClient"]
227
- HTTP --> AP["Anypoint Platform API"]
228
-
229
- AC --> CH2["CloudHub2"]
230
- AC --> MON["Monitoring"]
231
- AC --> LOGS["Logs"]
232
- AC --> EX["Exchange"]
233
- AC --> APIM["API Manager"]
234
- AC --> DC["Design Center"]
235
- AC --> AUDIT["Audit Log"]
236
- AC --> MQ["Anypoint MQ"]
237
- AC --> OS["Object Store"]
238
- ```
239
-
240
- <details>
241
- <summary>Source tree</summary>
242
-
243
- ```
244
- src/
245
- ├── auth/ OAuth2 + encrypted token storage
246
- │ ├── OAuthFlow.ts Browser callback at /api/callback
247
- │ ├── TokenManager.ts Auto-refresh with 5-min buffer
248
- │ ├── FileStore.ts AES-256-GCM encrypted tokens
249
- │ └── TokenStore.ts Storage interface
250
- ├── client/ HTTP + facade
251
- │ ├── AnypointClient.ts Main facade (single entry point)
252
- │ ├── HttpClient.ts Axios with Bearer injection
253
- │ ├── RateLimiter.ts Token bucket throttling
254
- │ └── Cache.ts TTL in-memory cache with observability
255
- ├── api/ Domain API clients
256
- │ ├── CloudHub2Api.ts Deploy, redeploy, restart, scale, poll
257
- │ ├── LogsApi.ts Tail, download (CH2 native)
258
- │ ├── MonitoringApi.ts AMQL queries (request + JVM metrics), JSON/CSV export
259
- │ ├── ExchangeApi.ts Search assets, download specs
260
- │ ├── ApiManagerApi.ts API instances, policies, SLA tiers
261
- │ ├── DesignCenterApi.ts Projects, files, lock/save, publish
262
- │ ├── AuditLogApi.ts Platform audit events (who changed what)
263
- │ ├── AnypointMQApi.ts Queue/exchange management, message browsing
264
- │ ├── ObjectStoreApi.ts Object Store v2 — stores, keys, values
265
- │ └── AccessManagementApi.ts User, environments, org entitlements
266
- ├── analysis/ Log analysis pipeline
267
- │ ├── LogAnalyzer.ts Pipeline orchestrator
268
- │ ├── parser.ts Multi-line joiner + JSON Logger parser
269
- │ ├── error-context.ts Error context windows (before/after)
270
- │ ├── error-grouper.ts Clusters similar errors
271
- │ ├── pattern-detector.ts Recurring message templates
272
- │ ├── stats.ts Level distribution, error spikes
273
- │ ├── types.ts Shared type definitions
274
- │ └── utils.ts Noise detection, templatization
275
- ├── commands/ CLI commands
276
- │ ├── config.ts init | show | set | path | profiles | use
277
- │ ├── auth.ts login | logout | status (--profile)
278
- │ ├── apps.ts list | status | restart | scale
279
- │ ├── deploy.ts deploy with prod safety net
280
- │ ├── logs.ts tail | download
281
- │ ├── monitor.ts view | perf | trend | workers | memory | memory-trend | compare | download
282
- │ ├── exchange.ts search | info | download-spec
283
- │ ├── api.ts list | policies | sla-tiers
284
- │ └── design-center.ts list | files | pull | push | publish
285
- ├── safety/ Production guards
286
- │ └── guards.ts Env detection, JAR validation, confirmation
287
- ├── utils/
288
- │ └── config.ts Profile-based config resolution
289
- ├── cli.ts CLI entry point (bin: anc)
290
- ├── mcp.ts MCP server entry point
291
- └── index.ts Library barrel export
292
- ```
293
-
294
- </details>
295
-
296
- ---
297
-
298
- ## CLI Reference
299
-
300
- ### Applications
301
-
302
- ```bash
303
- anc apps list --env Sandbox
304
- anc apps status my-api --env Sandbox
305
- anc apps restart my-api --env Production # prod confirmation prompt
306
- anc apps scale my-api --env Sandbox --replicas 2
307
- anc apps scale my-api --env Production --replicas 3 --force # skip confirmation
308
- ```
309
-
310
- ### Deploy
311
-
312
- ```bash
313
- # Standard deploy
314
- anc deploy target/my-api-1.2.0-mule-application.jar \
315
- --app my-api --env Sandbox --runtime 4.8.0
316
-
317
- # Production deploy — triggers safety confirmation
318
- anc deploy target/my-api.jar --app my-api --env Production
319
- # ⚠️ PRODUCTION DEPLOYMENT
320
- # App: my-api
321
- # Environment: Production
322
- # Current: v1.1.0 (APPLIED, 2 replicas)
323
- # New Version: v1.2.0
324
- # Type 'deploy to production' to confirm: _
325
-
326
- # CI/CD (skip confirmation)
327
- anc deploy app.jar --app my-api --env Production --force
328
- ```
329
-
330
- ### Logs
331
-
332
- ```bash
333
- # Stream logs in real-time
334
- anc logs tail my-api --env Sandbox
335
- anc logs tail my-api --env Sandbox --level ERROR --search "NullPointerException"
336
-
337
- # Download logs
338
- anc logs download my-api --env Sandbox --from 24h
339
- anc logs download my-api --env Production --from 7d --level ERROR
340
- anc logs download my-api --env Production \
341
- --from "2026-02-01T00:00:00Z" --to "2026-02-14T00:00:00Z" --output prod-logs.log
342
- ```
343
-
344
- ### Monitoring
345
-
346
- ```bash
347
- # View metrics table (default: last 24h)
348
- anc monitor view --env Sandbox
349
- anc monitor view --env Production --app my-api --from 7d
350
-
351
- # Performance percentiles
352
- anc monitor perf --env Production
353
-
354
- # JVM memory usage
355
- anc monitor memory --env Production
356
- anc monitor memory --env Production --app my-api
357
-
358
- # Memory trend over time
359
- anc monitor memory-trend --env Production --app my-api --granularity 1h
360
-
361
- # Worker/replica metrics
362
- anc monitor workers --env Production --app my-api
363
-
364
- # Cross-environment comparison
365
- anc monitor compare
366
-
367
- # Export
368
- anc monitor download --env Production --from 30d --format json
369
- anc monitor download --env Sandbox --from 7d --format csv --output metrics.csv
370
- ```
371
-
372
- ### Exchange
373
-
374
- ```bash
375
- anc exchange search "order" --type rest-api --limit 10
376
- anc exchange info my-api-spec
377
- anc exchange info org-id/my-api-spec --version 1.2.0
378
- anc exchange download-spec my-api-spec -o spec.json
379
- ```
380
-
381
- ### API Manager
382
-
383
- ```bash
384
- anc api list --env Production
385
- anc api policies "order-api" --env Production
386
- anc api policies 18888853 --env Production
387
- anc api sla-tiers "order-api" --env Production
388
- ```
389
-
390
- ### Design Center
391
-
392
- ```bash
393
- # List projects & files
394
- anc dc list
395
- anc dc files my-api-spec --branch develop
396
-
397
- # Pull a spec file (auto-decodes JSON-encoded content)
398
- anc dc pull my-api-spec api.raml -o local-spec.raml
399
-
400
- # Push (smart path resolution: auto-matches local filename to remote)
401
- anc dc push my-api-spec local-spec.raml --message "Add new endpoint"
402
-
403
- # Push with explicit remote path
404
- anc dc push my-api-spec local-spec.raml --path api.raml
405
-
406
- # Publish to Exchange
407
- anc dc publish my-api-spec --version 1.2.0 --classifier raml
408
- anc dc publish my-api-spec --version 2.0.0 --classifier oas3 --api-version v2
409
- ```
410
-
411
- ### Authentication
53
+ Working across several organizations? Use named profiles —
54
+ [Profiles and multiple orgs](https://avinava.github.io/anypoint-connect/profiles/).
412
55
 
413
- ```bash
414
- anc auth login # Default profile
415
- anc auth login --profile client-a # Specific profile
416
- anc auth status # Check current auth
417
- anc auth logout # Clear stored tokens
418
- ```
56
+ ## What it does
419
57
 
420
- ---
58
+ | Area | Examples |
59
+ | --- | --- |
60
+ | Applications | Status, deployment spec, resources, settings, deploy, redeploy, rollback, restart, scale, stop, start, delete |
61
+ | Logs | Tail, download, error clustering with context windows, recurring patterns, statistical health |
62
+ | Monitoring | Request metrics, percentiles, time series, per-replica, JVM memory and GC, freeform AMQL |
63
+ | Exchange | Search, asset detail, spec download, JAR publication, environment comparison |
64
+ | API Manager | Instances, policies, SLA tiers, alerts |
65
+ | Design Center | Projects, files, read, update, publish |
66
+ | Platform | Environments, entitlements, audit log |
67
+ | Anypoint MQ | Queues, depth and throughput, dead-letter browsing, test publishing |
68
+ | Object Store v2 | Stores, keys, values |
421
69
 
422
- ## MCP Server
70
+ Every command is documented in the
71
+ [CLI reference](https://avinava.github.io/anypoint-connect/cli-reference/).
423
72
 
424
- The MCP server exposes all Anypoint operations as tools for AI assistants (Claude, Cursor, etc.).
73
+ ## MCP server
425
74
 
426
- ### Prerequisites
75
+ 56 tools for AI agents. Set up credentials first — the server has nothing to offer an unauthenticated
76
+ session.
427
77
 
428
78
  ```bash
429
- anc config init # one-time setup (or --profile <name> for multi-org)
430
- anc auth login # get tokens
79
+ anc config init
80
+ anc auth login
431
81
  ```
432
82
 
433
- ### Configuration
83
+ Every host runs the same command; only the file and the wrapping key differ.
434
84
 
435
- Add to your MCP client config (Claude Desktop, Gemini, Cursor, etc.):
85
+ | Host | Where it goes | Wrapping key |
86
+ | --- | --- | --- |
87
+ | Claude Code | `.mcp.json`, or `claude mcp add` | `mcpServers` |
88
+ | Claude Desktop | `claude_desktop_config.json` | `mcpServers` |
89
+ | Codex | `.codex/config.toml`, or `codex mcp add` | `[mcp_servers.anypoint-connect]` |
90
+ | VS Code, Copilot Chat | `.vscode/mcp.json` | `servers`, plus `"type": "stdio"` |
91
+ | Copilot CLI, Gemini, other MCP clients | `.mcp.json` | `mcpServers` |
436
92
 
437
93
  ```json
438
94
  {
439
95
  "mcpServers": {
440
96
  "anypoint-connect": {
441
97
  "command": "npx",
442
- "args": ["-y", "@sfdxy/anypoint-connect", "mcp"]
443
- }
444
- }
445
- }
446
- ```
447
-
448
- Or if installed globally, use the CLI directly:
449
-
450
- ```json
451
- {
452
- "mcpServers": {
453
- "anypoint-connect": {
454
- "command": "anc",
455
- "args": ["mcp"]
98
+ "args": ["-y", "@sfdxy/anypoint-connect@0.11.0", "mcp"]
456
99
  }
457
100
  }
458
101
  }
459
102
  ```
460
103
 
461
- The MCP server auto-detects the active profile from the project's `.anypoint-connect.json` (or falls back to `default`). No `env` block needed.
462
-
463
- ### MCP Tools
464
-
465
- > **Deploy safety.** The mutating deploy tools (`deploy_app`, `update_app_artifact`, `rollback_app`, `publish_app_jar`, `deploy_jar`) are **dry-run by default**: called without `confirm: true` they return a preview of exactly what would change and modify nothing. Re-call with `confirm: true` to apply. Redeploys of an existing app change **only** the artifact reference — runtime, target/space, replicas, and settings are always preserved.
466
-
467
- | Tool | Description |
468
- |------|-------------|
469
- | **Identity & Org** | |
470
- | `whoami` | Get authenticated user & org info |
471
- | `list_environments` | List all environments in the org |
472
- | `get_entitlements` | Get org license: vCores, MQ, Object Store, API quotas, subscription |
473
- | **Applications** | |
474
- | `list_apps` | List deployed apps with status, version, vCores, and replica count |
475
- | `get_app_status` | Detailed deployment status: resources (CPU/memory), autoscaling, JVM, replicas |
476
- | `get_deployment_spec` | Full deployment spec (ref, runtime, target kind, vCores, replica states) — look before you leap |
477
- | `get_app_resources` | Consolidated resource allocation view for all apps in an environment |
478
- | `get_app_settings` | Read application properties and secure property keys |
479
- | `deploy_app` | ⚠️ Create a new deployment, or safely redeploy an existing one (artifact ref only). For an existing app, prefer `update_app_artifact` |
480
- | `update_app_artifact` | ⚠️ Safe production redeploy — change only the artifact version, preserving runtime/target/replicas/settings |
481
- | `rollback_app` | ⚠️ Roll an app back to the newest distinct historical artifact, or a requested version |
482
- | `update_app_settings` | ⚠️ Merge application properties while preserving protected values and deployment infrastructure |
483
- | `restart_app` | ⚠️ Rolling restart of an application |
484
- | `scale_app` | ⚠️ Scale application replicas (1–8) |
485
- | `stop_app` | ⚠️ Stop an application without deleting the deployment |
486
- | `start_app` | Start a previously stopped application |
487
- | **Logs & Analysis** | |
488
- | `get_logs` | Fetch recent log entries with optional keyword search |
489
- | `download_logs` | Download logs for a time range |
490
- | `analyze_errors` | Clustered error groups with before/after context windows |
491
- | `get_log_patterns` | Top recurring message templates with counts |
492
- | `get_log_stats` | Statistical health summary: error rate, spikes, noise % |
493
- | **Monitoring (AMQL)** | |
494
- | `get_metrics` | Inbound/outbound request count and response time |
495
- | `get_performance_metrics` | Percentile-based performance metrics (p50/p95/p99) |
496
- | `get_metrics_timeseries` | Time-series metrics for trending analysis |
497
- | `get_worker_metrics` | Per-worker/replica performance metrics |
498
- | `get_memory_metrics` | JVM memory usage: heap, GC stats, thread counts |
499
- | `get_memory_timeseries` | JVM memory time-series for leak detection and trending |
500
- | `compare_env_performance` | Compare performance across all environments |
501
- | `raw_amql_query` | Execute freeform AMQL queries for ad-hoc analysis |
502
- | **Exchange** | |
503
- | `search_exchange` | Search assets in Exchange |
504
- | `get_exchange_asset` | Get detailed asset info: versions, dependencies, instances, files |
505
- | `download_api_spec` | Download RAML/OAS spec from Exchange |
506
- | `publish_app_jar` | ⚠️ Upload a locally built application JAR to Exchange as a deployable asset |
507
- | `deploy_jar` | ⚠️ Publish a JAR and deploy it in one call (create new app, or safe artifact update) |
508
- | **API Manager** | |
509
- | `list_api_instances` | List managed API instances with governance info |
510
- | `get_api_policies` | Get policies and SLA tiers for an API |
511
- | `get_api_alerts` | View configured alerts for an API instance |
512
- | **Design Center** | |
513
- | `list_design_center_projects` | List all API spec projects |
514
- | `get_design_center_files` | List files in a Design Center project |
515
- | `read_design_center_file` | Read file content with smart path resolution |
516
- | `update_design_center_file` | ⚠️ Push updated file (lock/save/unlock) |
517
- | `publish_to_exchange` | ⚠️ Publish Design Center project to Exchange |
518
- | **Audit Log** | |
519
- | `get_audit_log` | Query platform changes: who did what, when |
520
- | **Anypoint MQ** | |
521
- | `list_queues` | List MQ destinations (queues/exchanges) in a region |
522
- | `get_queue_stats` | Queue depth, in-flight, and throughput stats |
523
- | `get_dlq_messages` | Browse dead-letter queue messages without consuming |
524
- | `publish_mq_message` | Publish a message to an MQ queue (test, replay, seed data) |
525
- | **Object Store v2** | |
526
- | `list_stores` | List Object Stores in an environment |
527
- | `get_store_keys` | List keys in an Object Store with pagination |
528
- | `get_store_value` | Retrieve and auto-format a value by key |
529
- | `put_store_value` | ⚠️ Write or update a value by key |
530
- | `delete_store_value` | ⚠️ Delete a key and its value |
531
- | **Profile** | |
532
- | `get_project_profile` | Show active profile, resolution source, and available profiles |
533
- | `set_project_profile` | Bind project directory to a named profile |
534
-
535
- ### MCP Prompts
536
-
537
- | Prompt | Description |
538
- |--------|-------------|
539
- | `pre-deploy-check` | Readiness check before promoting an app between environments |
540
- | `troubleshoot-app` | Systematic diagnosis: replica health, error patterns, metrics anomalies |
541
- | `api-governance-audit` | Review policies, SLA tiers, and security gaps across all APIs |
542
- | `environment-overview` | Full health report: app status, error rates, performance rankings |
543
- | `improve-api-spec` | Guided pull→analyze→improve→push workflow for API spec quality |
544
-
545
- ### MCP Resource
546
-
547
- | Resource | URI |
548
- |----------|-----|
549
- | Environments | `anypoint://environments` |
550
- | Cache Diagnostics | `anypoint://diagnostics/cache` |
551
-
552
- ### Example Interactions
553
-
554
- - *"What apps are running in Sandbox?"*
555
- - *"Show me the resource allocation across all Production apps"*
556
- - *"Show me the last 50 error logs for my-api in Production"*
557
- - *"Analyze the errors in my-api in Production — what's failing and why?"*
558
- - *"What are the top log patterns for billing-api in Development?"*
559
- - *"Give me a health summary of external-sapi in Production"*
560
- - *"Compare Development and Production environments"*
561
- - *"What policies are applied to the Order API?"*
562
- - *"Show me the RAML spec for the order-api project"*
563
- - *"Improve the API descriptions for order-api"*
564
- - *"Scale order-service to 3 replicas in Production"*
565
- - *"Show me the JVM memory usage for all apps in Production"*
566
- - *"Is my-api leaking memory? Show me the heap trend over the past week"*
567
- - *"What changed in the platform in the last 24 hours?"*
568
- - *"Check our org entitlements — do we have MQ provisioned?"*
569
- - *"Show me the app settings for billing-api in Production"*
570
- - *"Run this AMQL query: SELECT COUNT(requests) FROM mulesoft.app.inbound..."*
571
- - *"What's in the dead-letter queue for order-events?"*
572
- - *"Search the logs for correlation ID abc-123"*
573
- - *"Deploy order-api v1.3.0 to Sandbox with 2 replicas"*
574
- - *"Publish target/example-api-1.0.0-mule-application.jar and deploy it to Sandbox"*
575
- - *"Bump example-api in Production to v1.4.12 (artifact only)"*
576
- - *"Roll example-api back to its newest distinct historical artifact"*
577
- - *"Redeploy billing-service to Production with the latest version from Exchange"*
578
- - *"Update the db.url property for order-api in Sandbox"*
579
- - *"Stop the test-processor app in Development"*
580
- - *"Start the test-processor app back up"*
581
- - *"What versions of order-management-api are in Exchange?"*
582
- - *"Are there any alerts configured for the Order API?"*
583
- - *"Write a watermark value to the default Object Store in Sandbox"*
584
- - *"Delete the stale cache key from Object Store"*
585
- - *"Publish a test message to the order-events queue"*
586
-
587
- ---
104
+ Installed globally, use `"command": "anc", "args": ["mcp"]` and skip the download. No `env` block is
105
+ needed: the active profile resolves from the project's `.anypoint-connect.json`, falling back to
106
+ `default`. Credentials never pass through the protocol — the server holds the session, the agent calls
107
+ tools.
588
108
 
589
- ## Deploying a JAR (build → publish → deploy → roll back)
109
+ Per-host examples, prompts, and resources are in the
110
+ [MCP guide](https://avinava.github.io/anypoint-connect/mcp/); the full tool table is in the
111
+ [catalog](https://avinava.github.io/anypoint-connect/tools/).
590
112
 
591
- A locally built Mule application JAR goes to CloudHub 2.0 in two steps — publish the artifact to
592
- Exchange, then deploy it — or in a single `deploy_jar` call. Every mutating step is **dry-run by
593
- default**; add `confirm: true` to apply.
113
+ ## Safety
594
114
 
595
- **One call (recommended).** Publish and deploy together:
115
+ Every mutating operation is **dry-run by default**: without `confirm: true` it returns a preview and
116
+ changes nothing. Redeploying an existing app changes **only** the artifact reference, so runtime, target,
117
+ replicas, and settings are preserved and a version bump cannot silently downgrade a runtime or halve
118
+ capacity. `update_app_settings` PATCHes only application properties, merging protected values rather than
119
+ blanking them. Deletion requires a deployment-ID-bound confirmation — plus a separate acknowledgement in
120
+ production — so it fails closed if the deployment changed since you looked.
596
121
 
597
122
  ```jsonc
598
- // dry run — shows what would happen, changes nothing
123
+ // preview
599
124
  deploy_jar({ "jarPath": "target/example-api-1.0.0-mule-application.jar", "appName": "example-api", "environment": "Sandbox" })
600
125
  // apply
601
126
  deploy_jar({ "jarPath": "target/example-api-1.0.0-mule-application.jar", "appName": "example-api", "environment": "Sandbox", "confirm": true })
602
127
  ```
603
128
 
604
- **Step by step**, for more control:
605
-
606
- ```jsonc
607
- // 1. publish the built jar to Exchange
608
- publish_app_jar({ "jarPath": "target/example-api-1.0.0-mule-application.jar", "confirm": true })
609
-
610
- // 2. see exactly what is running before you touch it
611
- get_deployment_spec({ "appName": "example-api", "environment": "Production" })
612
-
613
- // 3. safe production bump — changes only the artifact ref, waits for it to settle
614
- update_app_artifact({ "appName": "example-api", "environment": "Production", "version": "1.0.0", "wait": true, "confirm": true })
615
-
616
- // 4. something wrong? roll back to the newest distinct historical artifact
617
- rollback_app({ "appName": "example-api", "environment": "Production", "confirm": true })
618
- ```
619
-
620
- For an **existing** app, `deploy_jar`, `deploy_app`, and `update_app_artifact` all change **only** the
621
- artifact reference — the runtime, target/space, replicas, and settings are preserved, so a redeploy
622
- can never silently downgrade the runtime or relocate the app. Infrastructure changes on an existing
623
- app are rejected; create a new deployment or use the dedicated settings/scale tools instead.
129
+ Full model in [Safety](https://avinava.github.io/anypoint-connect/safety/); the build, publish, deploy,
130
+ and rollback path in [Deploying a JAR](https://avinava.github.io/anypoint-connect/deployment-tools/).
624
131
 
625
- `update_app_settings` follows the same narrow-update rule: it PATCHes only the application-properties
626
- configuration. Existing plain properties and protected-property placeholders are merged into the
627
- request, while artifact coordinates, desired state, runtime, target, replicas, and other
628
- configuration services are left untouched.
132
+ ## When something fails
629
133
 
630
- The same flow is available from the CLI: `anc deploy <jarPath> --app <name> --env <env>`.
134
+ Access problems come in six distinct states — not configured, not authenticated, environment not visible,
135
+ not permitted, transient, and ready — and they have different fixes. The error text names which one you
136
+ are in. See [Access readiness](https://avinava.github.io/anypoint-connect/readiness/) and
137
+ [Troubleshooting](https://avinava.github.io/anypoint-connect/troubleshooting/).
631
138
 
632
- ---
633
-
634
- ## Programmatic Usage
139
+ ## Library
635
140
 
636
141
  ```typescript
637
142
  import { AnypointClient } from '@sfdxy/anypoint-connect';
@@ -641,60 +146,58 @@ const client = new AnypointClient({
641
146
  clientSecret: process.env.ANYPOINT_CLIENT_SECRET!,
642
147
  });
643
148
 
644
- // Get user info
645
149
  const me = await client.whoami();
646
- console.log(me.organization.name);
150
+ const envs = await client.accessManagement.getEnvironments(me.organization.id);
151
+ ```
647
152
 
648
- // List environments
649
- const orgId = me.organization.id;
650
- const envs = await client.accessManagement.getEnvironments(orgId);
153
+ The API clients give you token refresh, rate limiting, and caching, but not the confirmation gates — those
154
+ live in the CLI and MCP layers. More in the
155
+ [library guide](https://avinava.github.io/anypoint-connect/library/).
651
156
 
652
- // List apps in sandbox
653
- const sandbox = envs.find(e => e.name === 'Sandbox')!;
654
- const apps = await client.cloudHub2.getDeployments(orgId, sandbox.id);
157
+ ## Documentation
655
158
 
656
- // Tail logs
657
- for await (const entries of client.logs.tailLogs(orgId, sandbox.id, 'my-api')) {
658
- entries.forEach(e => console.log(`[${e.priority}] ${e.message}`));
659
- }
159
+ Published at **<https://avinava.github.io/anypoint-connect/>** with search.
660
160
 
661
- // Get metrics
662
- const metrics = await client.monitoring.getAppMetrics(
663
- orgId, sandbox.id,
664
- Date.now() - 24 * 60 * 60 * 1000,
665
- Date.now()
666
- );
667
-
668
- // Design Center: pull, edit, push
669
- const projects = await client.designCenter.getProjects(orgId);
670
- const spec = await client.designCenter.getFileContent(orgId, projects[0].id, 'api.raml');
671
- await client.designCenter.updateFile(orgId, projects[0].id, 'api.raml', updatedContent);
672
- await client.designCenter.publishToExchange(orgId, projects[0].id, {
673
- name: 'My API', apiVersion: 'v1', version: '1.0.0', classifier: 'raml'
674
- });
675
- ```
161
+ | Page | Contents |
162
+ | --- | --- |
163
+ | [Getting started](docs/getting-started.md) | Install, Connected App, scopes, credentials, authenticate |
164
+ | [Profiles](docs/profiles.md) | Multiple organizations, resolution order, storage layout |
165
+ | [Access readiness](docs/readiness.md) | The six access states and their fixes |
166
+ | [CLI reference](docs/cli-reference.md) | Every command group |
167
+ | [MCP server](docs/mcp.md) | Host setup, prompts, resources |
168
+ | [Tool catalog](docs/tools.md) | All 56 tools, and how to choose between overlapping ones |
169
+ | [Safety model](docs/safety.md) | Dry runs, narrow updates, bound deletion |
170
+ | [Deploying a JAR](docs/deployment-tools.md) | Build, publish, deploy, roll back |
171
+ | [Library API](docs/library.md) | Programmatic use |
172
+ | [Troubleshooting](docs/troubleshooting.md) | Symptoms and causes |
173
+ | [Architecture](docs/architecture.md) | Layers and design notes |
676
174
 
677
- ---
175
+ ## Ecosystem
678
176
 
679
- ## Release Process
177
+ One of four MuleSoft tools that work together, and the only one that needs credentials.
680
178
 
681
- Releases are automated via GitHub Actions:
179
+ | Project | Role |
180
+ | --- | --- |
181
+ | `anypoint-connect` | Authorized Anypoint evidence and lifecycle operations |
182
+ | [`mule-build`](https://github.com/Avinava/mule-build) | Validate, test, package, run locally, and release |
183
+ | [`mule-lint`](https://github.com/Avinava/mule-lint) | Static analysis of Mule XML, DataWeave, YAML, and project structure |
184
+ | [`mule-skills`](https://github.com/Avinava/mule-skills) | Agent workflows that drive all three |
682
185
 
683
- ```bash
684
- # 1. Bump version in package.json
685
- npm version patch # or minor / major
186
+ A complete release crosses two tools: `mule-build` produces and versions the artifact, this one puts it in
187
+ an environment. Details on the [ecosystem page](docs/ecosystem.md).
686
188
 
687
- # 2. Push the tag
688
- git push --follow-tags
189
+ ## Development
689
190
 
690
- # 3. GitHub Actions will:
691
- # - Run CI (build, test, lint)
692
- # - Publish to npm as @sfdxy/anypoint-connect
693
- # - Create a GitHub Release with auto-generated notes
191
+ ```bash
192
+ npm install
193
+ npm run build
194
+ npm test
195
+ npm run lint
694
196
  ```
695
197
 
696
- ---
198
+ Releases are tag-triggered: bump the version, push the tag with `git push --follow-tags`, and GitHub
199
+ Actions runs CI, publishes to npm with provenance, and creates the release.
697
200
 
698
201
  ## License
699
202
 
700
- MIT
203
+ [MIT](LICENSE)