vcf-automation-mcp 0.0.0-stage → 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 imtrinity94
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,152 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # vcf-automation-mcp
2
+
3
+ ![vcf-automation-mcp](.github/social-preview.png)
4
+
5
+ MCP server for **VCF Automation 9** (VM Apps organization). Every REST operation in the VCF Automation API set becomes one MCP tool: **696 operation tools** across 16 services, generated straight from the OpenAPI specs that VCF Automation serves at `https://<vcfa>/tenant/<org>/api-docs`.
6
+
7
+ Sister project of [vcf-orchestrator-mcp](https://github.com/imtrinity94/vcf-orchestrator-mcp).
8
+
9
+ ## Services and tools
10
+
11
+ | Service key | Tools | API |
12
+ |---|---:|---|
13
+ | `abx` | 33 | ABX: actions, versions, secrets, action runs, flows |
14
+ | `approvals` | 11 | Approvals and work items |
15
+ | `metrics` | 5 | Deployment Metric (aggregator) and deployment limits |
16
+ | `blueprint` | 40 | Blueprint / cloud templates: create, validate, version, release, provision |
17
+ | `catalog` | 45 | Catalog items, sources, content sharing, requests, icons, notifications, pricing |
18
+ | `deployment` | 38 | Deployments, resources, day-2 actions, requests |
19
+ | `policy` | 9 | Policies and policy types |
20
+ | `form` | 42 | Custom Forms |
21
+ | `content` | 11 | Content Gateway (content sources, source control) |
22
+ | `eventbroker` | 7 | Event Broker: events, topics, audit, subscriptions |
23
+ | `iaas` | 265 | Provisioning Service (IaaS): cloud accounts, zones, mappings, networks, storage, machines |
24
+ | `identity` | 53 | Identity Service (`/csp/gateway/am/api`) |
25
+ | `onboarding` | 27 | Onboarding (relocation) plans, resources, deployments |
26
+ | `vro` | 8 | Orchestrator Gateway: workflows and runs |
27
+ | `project` | 11 | Project Service |
28
+ | `provider` | 91 | Provider Management / Access Control (`/cloudapi`) |
29
+
30
+ Tool names follow `<service>_<operation>`, for example `deployment_get_deployments`, `catalog_request_catalog_item`, `iaas_create_machine`, `abx_post_action_runs`, `vro_run_workflow`, `provider_query_users`. Run `npx vcf-automation-mcp --list-tools` to see them all.
31
+
32
+ There are also two helper tools:
33
+
34
+ - `vcfa_connection_status`: shows the host, org, auth mode in use, token expiry and tool counts. Pass `test: true` to log in now and call `GET /iaas/api/about`.
35
+ - `vcfa_describe_operation`: returns the full nested request-body schema for any tool. Tool input schemas are summarised past three levels of nesting to keep `tools/list` small.
36
+
37
+ > **About 700 tools is a lot.** Some MCP clients cap or slow down with that many. Use `VCFA_SERVICES` to load only what you need, for example `VCFA_SERVICES=catalog,deployment,blueprint,abx,vro`.
38
+
39
+ ## Quick start
40
+
41
+ Login works the same way as [vcf-orchestrator-mcp](https://github.com/imtrinity94/vcf-orchestrator-mcp). A one-time `setup` creates a VCF Automation **service account** and stores its refresh token on your machine. After that the server keeps its own login alive, so no token or password goes into your MCP config.
42
+
43
+ ### 1. Run setup once
44
+
45
+ ```bash
46
+ npm i -g vcf-automation-mcp
47
+ vcf-automation-mcp setup --url "https://auto.vmw.lab" --org "vmapps-org" --user "<local-admin>" --name "Lab-VCFA-MCP" --role "Organization Owner" --insecure
48
+ ```
49
+
50
+ Setup asks for the password with a masked prompt. It uses it once to log in and never stores it. Then it:
51
+
52
+ 1. Logs in as `user@org` at `/cloudapi/1.0.0/sessions`.
53
+ 2. Registers the service account at `/oauth/tenant/{org}/register`.
54
+ 3. Requests device authorization.
55
+ 4. Grants the request as you.
56
+ 5. Exchanges the device code for an access token and a refresh token.
57
+
58
+ It saves the refresh token to `~/.vcf-automation-mcp/tokens.json` (on Windows, `C:\Users\<you>\.vcf-automation-mcp\tokens.json`), checks which automation APIs the service account's role can reach, and prints the MCP config to paste.
59
+
60
+ | Option | Meaning |
61
+ |---|---|
62
+ | `--url` | VCF Automation URL |
63
+ | `--org` | Organization **name**, from the tenant URL `https://<fqdn>/tenant/<name>` |
64
+ | `--user` | **Local** org user, typed without `@org` |
65
+ | `--name` | Service account display name (under Access Control > Service Accounts) |
66
+ | `--role` | Comma-separated role names. Default: the role of the user you log in with |
67
+ | `--password` | Skips the prompt (the password then ends up in your shell history) |
68
+ | `--client-id` | Uses a service account created in the UI instead; you approve the access request there. Use this for SSO-only orgs |
69
+ | `--insecure` | Accepts self-signed lab certificates |
70
+
71
+ > If the access check shows **403** for an API, the service account's role doesn't cover it. Give it a broader role (e.g. Organization Owner), then restart your MCP client.
72
+
73
+ ### 2. Add it to your MCP client
74
+
75
+ ```json
76
+ {
77
+ "mcpServers": {
78
+ "vcf-automation": {
79
+ "command": "vcf-automation-mcp",
80
+ "env": {
81
+ "VCFA_HOST": "https://auto.vmw.lab",
82
+ "VCFA_AUTH_MODE": "api-token",
83
+ "VCFA_ORG": "vmapps-org",
84
+ "VCFA_INSECURE": "true",
85
+ "VCFA_SERVICES": "catalog,deployment,blueprint,project,abx,vro,eventbroker"
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ The config file is at `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS and `%APPDATA%\Claude\claude_desktop_config.json` on Windows.
93
+
94
+ ## Configuration
95
+
96
+ | Variable | Default | Description |
97
+ |---|---|---|
98
+ | `VCFA_HOST` | required | VCF Automation URL, e.g. `https://auto.vmw.lab` |
99
+ | `VCFA_ORG` | `System` | VM Apps organization **name**, e.g. `vmapps-org` (`System` means provider) |
100
+ | `VCFA_AUTH_MODE` | `auto` | `api-token`, `token`, `vcfa-cloudapi`, `vcfa` (see below) |
101
+ | `VCFA_API_TOKEN` | | Seeds a refresh-token chain yourself instead of running setup |
102
+ | `VCFA_CLIENT_ID` | | Service account client ID, if you seed a token yourself |
103
+ | `VCFA_TOKEN` | | Static access token; it expires and isn't renewed |
104
+ | `VCFA_USERNAME` / `VCFA_PASSWORD` | | For `vcfa-cloudapi` / `vcfa` |
105
+ | `VCFA_DOMAIN` | | Identity domain for `vcfa` (CSP) login |
106
+ | `VCFA_TOKEN_FILE` | `~/.vcf-automation-mcp/tokens.json` | Where rotated refresh tokens are kept |
107
+ | `VCFA_INSECURE` | `false` | Skip TLS verification (self-signed lab certificates) |
108
+ | `VCFA_READ_ONLY` | `false` | Load only GET operations; writes are also blocked at call time |
109
+ | `VCFA_SERVICES` | all | Comma-separated service keys to load |
110
+ | `VCFA_EXCLUDE_SERVICES` | | Comma-separated service keys to skip |
111
+ | `VCFA_TOOL_FILTER` | | Regex; load only tools whose name matches |
112
+ | `VCFA_CLOUDAPI_VERSION` | `9.1.0` | `Accept: application/json;version=` for `/cloudapi` calls |
113
+ | `VCFA_MAX_RESPONSE_CHARS` | `100000` | Responses longer than this are truncated |
114
+ | `VCFA_TIMEOUT_MS` | `120000` | Per-request timeout |
115
+
116
+ ### Auth modes
117
+
118
+ The names and behaviour match vcf-orchestrator-mcp.
119
+
120
+ | Mode | How it logs in |
121
+ |---|---|
122
+ | `api-token` | Refresh token, plus client ID when known, posted to `/oauth/tenant/{org}/token` (falls back to `/tm/oauth/...`). VCF Automation **rotates** the refresh token on every use, so the server writes each new one to the token file before carrying on. Restarts keep working with no new setup |
123
+ | `token` | `VCFA_TOKEN` used as-is |
124
+ | `vcfa-cloudapi` | `POST /cloudapi/1.0.0/sessions` (then `/tm/cloudapi`) with Basic `user@org`, trying Accept versions 9.1.0 / 9.0.0 / 40.0. It stops at the first 401, so a wrong password counts only once towards the account lockout |
125
+ | `vcfa` | 8.x-style `/csp/gateway/am/api/login` then `/iaas/api/login`, for VM Apps orgs upgraded from Aria Automation 8 |
126
+ | `auto` | `api-token` if a token is set or stored, else `token`, else `vcfa-cloudapi` then `vcfa` |
127
+
128
+ Access tokens are renewed a minute before they expire, and once more after a `401`. There's no background timer: an idle server refreshes on its next call.
129
+
130
+ **One token chain per machine, per server.** Don't copy `tokens.json` between machines, and don't run two copies of this server against the same org at the same time (for example Claude Desktop and Claude Code). Whichever refreshes first invalidates the other's token, and the other gets `invalid_grant`; running `setup` again fixes it. This server keeps its own token file, separate from vcf-orchestrator-mcp's, so the two never break each other. Give each one its own service account.
131
+
132
+ ## Calling conventions
133
+
134
+ - Path, query and header parameters are top-level arguments.
135
+ - Request bodies go in `body`: a JSON object, or a string for YAML/text endpoints.
136
+ - OData parameters drop the `$` because MCP clients reject `$` in argument names: `$top` becomes `top`, and likewise `skip`, `filter`, `select`, `orderby`, `count`.
137
+ - Many automation endpoints take an optional `apiVersion` query parameter.
138
+
139
+ ## Development
140
+
141
+ ```bash
142
+ npm install
143
+ npm run generate # specs/*.json|yaml -> data/operations.json
144
+ npm run build
145
+ npm test # mock VCFA server + real MCP client over stdio
146
+ ```
147
+
148
+ To refresh the specs, download each one from `https://<vcfa>/tenant/<org>/api-docs`, drop it into `specs/`, then run `npm run generate`. The file-to-service mapping lives at the top of `scripts/generate.mjs`.
149
+
150
+ ## License
151
+
152
+ MIT