@cmdforge/gen-apic-mp
v0.0.5
Published
Generate a marketplace.zip containing the contents of an expected marketplace.git repository for the given Azure API Center portal.
Readme
gen-apic-mp
Generate marketplace repository contents from an Azure API Center workspace.
This tool reads plugin and MCP assets from API Center, translates legacy v0/servers/{name} data into MCP server entries, and emits the repository structure expected by marketplace-style plugin catalogs.
What it generates
For a workspace, gen-apic-mp produces:
.github/plugin/marketplace.json
.claude-plugin/marketplace.json
.agents/plugins/marketplace.json
plugins/{pluginName}/plugin.json
plugins/{pluginName}/.codex-plugin/plugin.json
plugins/{pluginName}/.mcp.json
plugins/{pluginName}/.codex.mcp.jsonThe generated .mcp.json only contains normal MCP server launch configuration:
- stdio servers:
transport,command,args,env,cwd - remote servers:
transport,url,headers
Codex-specific output uses the paths described by the Codex plugin docs and the @typeforged/codex-plugin-marketplace schema package:
- repo marketplace:
.agents/plugins/marketplace.json - plugin manifest:
plugins/{pluginName}/.codex-plugin/plugin.json - plugin MCP config:
plugins/{pluginName}/.codex.mcp.json
Claude/Copilot-style output is aligned to the @typeforged/claude-plugin-marketplaces schema package:
- marketplace catalog:
.claude-plugin/marketplace.json - plugin manifest:
plugins/{pluginName}/plugin.json - plugin MCP config:
plugins/{pluginName}/.mcp.json
Install
npm install
npm run buildTo use the CLI directly from the repo during development:
node dist/server/cli.js --helpCLI
gen-apic-mp <serviceName> <region> <workspaceName> [--unpack [directory]] [--mcp-meta <key>]Arguments:
serviceName: region-unique Azure API Center service nameregion: Azure region, likeeastusworkspaceName: API Center workspace to export
Option:
--unpack [directory]: write the generated marketplace tree directly into a directory instead of creating a zip--mcp-meta <key>: include a specific_metakey fromv0/servers/{name}in generated.mcp.jsonserver entries
If --unpack is provided without a value, it defaults to the current working directory, but only if that directory contains a package.json.
Examples
Create a zip in the current directory:
gen-apic-mp my-api-center eastus marketplaceUnpack directly into the current repo:
gen-apic-mp my-api-center eastus marketplace --unpackUnpack into a specific directory:
gen-apic-mp my-api-center eastus marketplace --unpack /path/to/marketplace-repoInclude OAuth-related _meta in generated .mcp.json:
gen-apic-mp my-api-center eastus marketplace --mcp-meta oauth-client-providerInclude multiple _meta keys:
gen-apic-mp my-api-center eastus marketplace --mcp-meta oauth-client-provider --mcp-meta x-ms-idOutput behavior
Without --unpack, the CLI writes:
{workspaceName}-marketplace.zipWith --unpack, the CLI does not create a zip. It syncs the generated tree directly into the target directory.
How MCP translation works
For each plugin resource with kind: "mcp", the tool:
- Fetches the MCP asset using the plugin resource
resourceId - Fetches the legacy server entry from
workspaces/{workspaceName}/v0/servers/{mcp.name} - Uses the
server.namefrom that payload as the key in.mcp.json - Translates the server entry into a
types.McpServer
The translator supports:
- direct stdio-style entries with
command,args, andenv - direct remote-style entries with
urland remote transport - nested
server.remotes - nested
server.packagesas fallback whenremotesis empty
If --mcp-meta is used, only the requested _meta keys are copied into each generated MCP server entry.
Current limitations
- Skill directories are not generated yet, so
plugin.jsononly includesskillswhen that support is added - The tool expects the target API Center workspace to expose:
- portal config at
config.json - plugin assets in the workspace API listing
- MCP assets reachable from plugin resource IDs
- legacy server entries at
v0/servers/{name}
- portal config at
Development
Build:
npm run buildTest:
npm test