Max Commander Docs

Get practical guidance for sharing files, opening archives, and managing profiles, or build filesystem and tool plugins with the developer guide and SDK reference.

Explore the guides
Share folders and media on your local network.
Open archives and control learned suggestions.
Build plugins, native actions, and companion integrations.

Max Commander Plugin Architecture & Developer Guide

This guide explains how to design, build, test and package Max Commander plugins. See the SDK Reference tab for the compact API reference.

Philosophy

Max Commander treats external systems as filesystems. A plugin can turn a media server, torrent client, game library, REST API, database, local service, or custom index into a browsable virtual filesystem.

The app keeps ownership of the commander UI: selection, keyboard behavior, panes, sorting, viewers, operations, and thumbnails. Plugins provide data, metadata, thumbnails, commands, settings, and controlled host actions.

Architecture At A Glance

Rendering diagram...

What Plugins Can Do

Plugins can:

  • mount a virtual drive with a custom scheme such as steam://, yts://, or qbit://
  • return folders and files for both panes
  • request thumbnail view by default
  • provide poster/artwork URLs per item
  • add custom columns with localized labels
  • expose rich metadata to Quick View
  • intercept Enter/double-click on virtual items
  • add context-menu actions for virtual items
  • register Command Palette commands
  • expose settings fields under F9 -> Plugins
  • render a simple dashboard from JSON UI blocks
  • render versioned, host-styled Plugin UI v2 blocks for forms, lists, tables, properties, notices, and confirmations
  • show progress/toasts
  • maintain background status rows in the operations popover
  • use worker fetch() for internet APIs when network.http is declared
  • read a public internet resource through the CORS-safe native bridge when network.fetch is declared
  • call allowed localhost services through a native HTTP bridge
  • open local paths or URLs through the OS when granted permission
  • copy text to the clipboard after a user action when granted permission
  • read plain clipboard text once during a direct host-owned action when clipboard.read is declared
  • shallow-merge validated non-secret settings into durable plugin config when plugin.config.write is declared
  • use namespaced secure-vault storage when secure.vault is declared

Plugins cannot:

  • draw arbitrary custom panel renderers
  • override core keyboard, selection, drag/drop, sort, or file operation behavior
  • silently access local files, shell opens, network, localhost services, or execution hooks without declared permissions
  • access global MC secrets; secure-vault APIs are namespaced to the calling plugin
  • package nested development folders with the current packer

Plugin Folder Layout

Plugin source definitions are maintained in the dedicated mc-plugins repository. The Max Commander repository's plugins/ directory is intentionally an ignored runtime install location: it contains only the plugin copies currently installed for local development or a portable build. Do not author or commit plugin source there.

Use this layout:

text
plugins/<plugin-id>/  plugin.json  index.js  README.md  dev/    SPEC.md

dev/SPEC.md and other development notes are intentionally excluded from .mcx packages because the current packer only archives direct files in the plugin folder.

Manifest

Every plugin needs plugin.json.

json
{  "id": "example",  "name": "Example Plugin",  "version": "1.0.0",  "author": "You",  "description": "Browse an external system as a virtual filesystem.",  "type": "filesystem",  "entryPoint": "index.js",  "scheme": "example",  "icon": "database",  "showInToolsMenu": true,  "pluginUiVersion": 2,  "permissions": [    "filesystem.read",    "commands.palette",    "files.execute",    "ui.dialog"  ],  "capabilities": {    "readonly": true,    "preferredViewMode": "thumbnails"  }}

Important fields:

  • id: stable plugin ID and package name
  • type: filesystem or tool
  • entryPoint: usually index.js
  • scheme: required for filesystem plugins
  • icon: built-in icon name used in plugin surfaces
  • iconUrl: optional custom image icon
  • showInToolsMenu: surfaces the plugin in the Tools menu
  • pluginUiVersion: optional host-rendered UI contract version. Use 2 for forms, lists, tables, properties, notices, confirmations, and contextual dialogs.
  • permissions: required host capabilities
  • capabilities.readonly: blocks write operations when true
  • capabilities.preferredViewMode: normal, thumbnails, or branch

If permissions are omitted, the host tries to infer most existing capabilities. For production plugins, declare permissions explicitly so users understand what the plugin can do. plugin.config.write and clipboard.read are stricter: package and draft validation reject source that uses their APIs unless the manifest explicitly declares the matching permission.

Provider Object

index.js runs in a Web Worker. It receives API, config, and id from the host. It should return a provider object or assign it to self.provider.

javascript
const provider = {  name: 'Example',  scheme: 'example',  type: 'filesystem',  icon: 'database',  capabilities: {    readonly: true,    preferredViewMode: 'thumbnails'  },  async readDir(path) {    return [      {        name: 'Movie.mkv',        path: 'example://movie-1',        is_dir: false,        size: 123456,        modified: new Date().toISOString(),        extra: {          thumbnailUrl: 'https://example.com/poster.jpg',          rating: 8.5        }      }    ];  },  async getStat(path) {    return { size: 0, is_dir: true, modified: new Date().toISOString() };  },  async readFile(path) {    return 'Text content for viewers.';  },  async getFolderSize(path) {    return 0;  }};self.provider = provider;return provider;

Virtual Filesystem Design

Use stable, absolute plugin paths. Prefer scheme URLs:

text
example://example://category@1example://category@2example://category@2/item-123

For paged APIs, flatten page roots where parent navigation would otherwise break:

text
yts://most-seeded@1yts://most-seeded@2

This keeps .. deterministic in the file manager. You can expose page navigation as virtual folders/items named Previous Page and Next Page. Use extra.sortPriority to pin navigation items near the top.

File Items

Return panel items in this shape:

javascript
{  name: 'Item Name',  path: 'example://item-1',  is_dir: false,  size: 0,  modified: new Date().toISOString(),  extra: {    thumbnailUrl: 'https://example.com/thumb.jpg',    year: 2026,    rating: 8.5,    sortPriority: -100  }}

Useful conventions:

  • use is_dir, not isDir
  • use extra.thumbnailUrl for remote posters/artwork
  • use extra.streamUrl for playable media URLs
  • keep custom column values in extra
  • keep item paths unique and stable: Max Commander uses path as the selection and operation identity when present, while name remains presentation-only
  • use extra.selectionKey only when a provider needs an identity distinct from its navigable path

Thumbnails

Two thumbnail paths are supported:

  1. Put a URL or asset URL in item.extra.thumbnailUrl.
  2. Implement getThumbnail(path) and return a URL or data URL.

For local images discovered by a plugin, convert local paths first:

javascript
const url = await API.appAPI.toAssetUrl(localImagePath);

For plugin artwork-heavy folders, set:

javascript
capabilities: {  readonly: true,  preferredViewMode: 'thumbnails'}

Custom Columns And i18n

Define columns on the provider:

javascript
customColumns: {  example_rating: { label: 'i18n:columns.example_rating', width: 80, type: 'number' },  example_state: { label: 'i18n:columns.example_state', width: 120, type: 'string' }},i18n: {  en: {    'columns.example_rating': 'Rating',    'columns.example_state': 'State'  },  es: {    'columns.example_rating': 'Puntaje',    'columns.example_state': 'Estado'  }}

Always prefix custom column IDs and translation keys with the plugin ID or scheme.

Settings

Expose settings with getConfigSchema():

javascript
getConfigSchema: () => [  { id: 'serverUrl', type: 'string', label: 'Server URL', required: true },  { id: 'apiKey', type: 'password', label: 'API Key' },  { id: 'liveRefresh', type: 'boolean', label: 'Live Refresh', defaultValue: false },  { id: 'refreshSeconds', type: 'number', label: 'Refresh Seconds', defaultValue: 10 }]

Values arrive in the plugin as config.serverUrl, config.apiKey, etc. Plugins should not create their own settings pages.

Item Execution And Context Actions

Use executeItem() for Enter/double-click.

javascript
async executeItem(item) {  if (item.extra?.streamUrl) {    await API.appAPI.openVideoPlayer(item.extra.streamUrl);    return true;  }  return false;}

Use item actions for context menus:

javascript
getItemActions(item) {  return [    { id: 'open-page', label: 'Open Page', icon: 'external' },    { id: 'metadata', label: 'View Metadata', icon: 'info' },    { id: 'delete', label: 'Delete', icon: 'warning', danger: true }  ];},async executeItemAction(actionId, item) {  if (actionId === 'open-page') {    await API.appAPI.openUrl(item.extra.url);    return true;  }  if (actionId === 'metadata') {    await API.appAPI.showFileMetadata(item);    return true;  }  return false;}

files.execute is required for executeItem, getItemActions, and executeItemAction.

Command Palette

Use getCommands() for global commands:

javascript
getCommands: async () => [  {    id: 'example.open',    label: 'Example: Open',    icon: 'database',    execute: async () => {      await API.appAPI.navigate('example://');    }  }]

commands.palette is required. Command IDs should be namespaced with the plugin ID.

Panel command strip

The host also shows a plugin's published commands in a compact strip when that plugin owns the current panel path. This does not add a new plugin permission or create a plugin-rendered toolbar. Tool-only plugins without a panel continue to use Tools, Command Palette, and optional Feature Bar slots. The host owns strip placement and visibility, including a recoverable per-plugin hide control.

Commands may set showInCommandBar: false to remain in the Command Palette while being omitted from the panel strip (for example, Browse catalog inside an already-open catalog). Omission defaults to visible for existing plugins. shortLabel supplies the compact button label; the full label remains available to the palette and tooltip. This is presentation metadata, not an execution or permission gate.

Existing commands remain available without changes. For panel-aware commands the host passes a serializable context with the owning panel's path, selected items, and focused item to execute(context). A command may optionally define isAvailable(context) and return a boolean or { available, reason? }; commands without it are treated as available. Availability is advisory UI state and is rechecked in the worker immediately before execution. The context never contains the opposite panel's data and only reaches the provider whose scheme owns the panel.

Contextual learning treats plugin commands as semantic actions, keyed by stable plugin and command IDs plus a semantic suggestion version. It retains local usage counts when a plugin is disabled or uninstalled, but suggestions resolve against the current active registry and disappear while the command is unavailable. To appear as a learned suggestion in an ordinary folder, a command must explicitly declare suggestible: true and implement isAvailable(context); invocation frequency alone does not imply relevance. The host passes the active panel context to command entry points, rechecks availability on execution, and stores no command arguments, item names, or content. Use optional suggestionVersion to retain learning across compatible plugin releases; without it, the plugin release version is the boundary. Change the semantic version if a command's meaning changes.

The strip reuses the host Feature Bar's command-button and horizontal-scrolling presentation. It is not an arbitrary plugin UI surface, and changing its visibility does not change the global Function/Feature Bar mode.

Dashboard UI

Tool plugins and filesystem plugins with dashboard views can return JSON blocks:

javascript
getUI: async () => [  { type: 'header', id: 'h1', title: 'Service Status', subtitle: 'Connected' },  { type: 'text', id: 't1', content: 'Last sync: 2 minutes ago', style: 'hint' },  { type: 'progress', id: 'p1', label: 'Storage Used', value: 45, max: 100 },  { type: 'input', id: 'search', label: 'Search', placeholder: 'query...', actionId: 'search' },  { type: 'button', id: 'sync', label: 'Sync Now', actionId: 'sync', variant: 'primary' }],async handleUIAction(actionId, data) {  if (actionId === 'sync') {    API.appAPI.showProgress('Sync requested', 100);  }}

Supported block types are header, button, text, progress, input, and group.

ui.dashboard is required.

Plugin UI v2

Plugin UI is a Max Commander-owned declarative schema, not arbitrary HTML or plugin-rendered React. The plugin describes intent; MC renders controls with its own theme, spacing, keyboard behavior, and accessibility rules.

Set pluginUiVersion: 2 in plugin.json when using expanded blocks:

  • notice: info/success/warning/danger message.
  • form: structured input surface with fields or a JSON-Schema-like schema.
  • list: selectable rows with optional actions.
  • table: compact rows and columns.
  • properties: key-value detail view with optional sensitive/copyable values.
  • confirm: host-styled confirmation block for destructive actions.

Filesystem item actions can open plugin UI with context:

javascript
async executeItemAction(actionId, item) {  if (actionId === 'edit') {    await API.appAPI.showDialog(id, { mode: 'edit', item });    return true;  }  return false;}getUI: async (context) => {  if (context?.mode === 'edit') {    return [{      type: 'form',      id: 'edit-form',      actionId: 'save',      submitLabel: 'Save',      fields: [        { id: 'name', type: 'text', label: 'Name', required: true },        { id: 'secret', type: 'password', label: 'Secret', required: true, revealable: true }      ],      initialValues: { name: context.item?.name || '' }    }];  }  return [{ type: 'header', id: 'h', title: 'Plugin' }];}

Form fields support text, password, textarea, number, checkbox, select, and url. Sensitive values should use password with explicit reveal/copy affordances.

Secure Vault API

Plugins that declare secure.vault can use a namespaced bridge to Max Commander's Secret Vault. The namespace is derived from the plugin id by the host; plugin code cannot read arbitrary MC vault keys.

javascript
const status = await API.appAPI.secureVault.status();await API.appAPI.secureVault.store('item:abc', JSON.stringify(record));const record = await API.appAPI.secureVault.load('item:abc');const keys = await API.appAPI.secureVault.list();await API.appAPI.secureVault.delete('item:abc');

The current backend is MC's portable master-password vault. Plugins never receive the master password; the vault must be unlocked by MC before plugin storage calls can read or write. The plugin API is backend-neutral so a future Windows DPAPI/Windows Hello provider can be added in core without changing plugin code.

Durable Config Writes

Plugins that declare plugin.config.write can update their own ordinary, non-secret settings from a direct action or another provider call:

javascript
await API.appAPI.updateConfig({ selectedFeed: 'technology', starredOnly: true });

The API accepts only a plain JSON object and never accepts a plugin ID. The host derives identity from the Worker binding. Arrays and non-objects are rejected at the root; every nested value must be JSON-compatible, all numbers must be finite, and __proto__, prototype, and constructor are forbidden at every depth. The patch is shallow-merged with the current plugin config so omitted keys survive. The complete merged value is validated and its serialized UTF-8 representation must not exceed 256 KiB.

Config replacement is serialized per plugin and owned by the plugin store. MC first persists a complete partialized mc-plugins candidate snapshot, then initializes a replacement Worker with the candidate config while the existing runtime remains authoritative. Only successful initialization may atomically replace the provider cache, registered provider, and store state. Failure restores the previous durable snapshot and keeps the old runtime. After successful cutover, the host acknowledges updateConfig() to the old Worker and marks it retiring; the Worker settles the awaiting call and its outer action RPC before closing itself. A retiring Worker cannot begin another host API request.

Ordinary non-secret feed URLs, read state, and starred state may live in config. Credentials, cookies, API keys, and other secrets remain in secure.vault.

Direct-action Clipboard Reads

Plugins that declare clipboard.read can read plain text only while MC has a live, host-owned direct invocation context:

javascript
const text = await API.appAPI.readClipboardText();

Eligible entry routes are plugin Dashboard and ToolDialog UI actions, Tool and Command Palette commands, item execution, and item actions. Listing, getUI, getMetadata, timers, background callbacks, and other passive work are not direct invocations. The Worker cannot supply a boolean, token, or plugin ID to manufacture authority. Each invocation permits one read; the context is cleared on the outer RPC response, error, or ten-second timeout. Returned text is capped at 64 KiB of UTF-8 and truncated only on a valid code-point boundary. Native clipboard failures produce a concise plugin-facing error.

Every Worker is bound at load time to an immutable manifest ID and permission set. Host dispatch verifies that the sender is still the bound active Worker and independently authorizes both new APIs, even if a Worker handcrafts protocol messages. After a config cutover acknowledges the old Worker, that retiring sender is no longer authorized for new app API requests.

Writable Filesystems

Most current examples are read-only. Writable filesystem plugins must set capabilities.readonly to false, declare filesystem.write, and implement the write methods the app may call:

javascript
async writeFile(path, content) {}async createDir(path) {}async delete(path) {}async rename(oldPath, newPath) {}

Keep write behavior conservative: reject unsupported paths clearly and return only after the external service has accepted the operation.

Background Tasks

Use background rows for live monitoring or long-running plugin work:

javascript
const taskId = API.appAPI.startBackgroundTask('Syncing Library');await API.appAPI.updateBackgroundTask(taskId, 12.5, 'Downloading metadata');await API.appAPI.updateBackgroundTask(taskId, -1, 'Watching for changes');await API.appAPI.finishBackgroundTask(taskId);

Use progress 0..100 for determinate work. Use a negative progress value for indeterminate/live status.

background.task is required.

Host API Summary

javascript
API.appAPI.showProgress(title, progress);API.appAPI.refresh();API.appAPI.navigate(path);API.appAPI.fillPanel(items);API.appAPI.showDialog(pluginId);API.appAPI.showFileMetadata(item);API.appAPI.openVideoPlayer(url);API.appAPI.updateConfig(patch);API.appAPI.readClipboardText();API.appAPI.readTextFile(path);API.appAPI.readDirectory(path);API.appAPI.getFileSize(path);API.appAPI.pathExists(path);API.appAPI.getImageDimensions(path);API.appAPI.openPath(path);API.appAPI.openUrl(url);API.appAPI.localHttpRequest(request);API.appAPI.networkFetch({ url, accept });API.appAPI.toAssetUrl(path);API.appAPI.startBackgroundTask(title);API.appAPI.updateBackgroundTask(taskId, progress, status);API.appAPI.finishBackgroundTask(taskId);

See the SDK Reference tab for permissions and exact API notes.

The standard worker fetch() API is available only when network.http is declared.

Public Internet Fetch Bridge

networkFetch({ url, accept? }) is the intentionally narrow native alternative for public feeds and discovery documents that reject the WebView origin through CORS. It requires the dangerous network.fetch permission and returns { body, finalUrl, status, headers }. It makes only an unauthenticated GET, accepts only a bounded Accept value, and sends a stable, host-owned Max Commander User-Agent identifying this desktop client. Plugins cannot set or override that identity or supply arbitrary request headers. It follows at most five validated HTTP(S) redirects, has one 15-second deadline, and returns at most 1.5 MiB of plain text. MC disables proxy inheritance, rejects URL credentials and literal/private hosts, and its actual request resolver rejects every non-global or mixed DNS result before connecting. Returned headers are limited to content type/length, ETag, Last-Modified, and Cache-Control.

This exists for cross-origin RSS/feed discovery and reading—not for generic HTTP. It has no POST/body/custom-header/auth/cookie/proxy/cache/scheduling support and never reaches localhost, LAN, or other reserved/private networks. The plugin must still treat all remote body content as untrusted.

Deferred Plugin Platform Contracts

The current API does not provide generic plugin KV storage, a general host internet proxy, scheduling, full-text indexing, OPML integration, or AI features. networkFetch is a constrained public GET reader, not a replacement for any of those contracts.

Localhost Bridge

Use localHttpRequest() for companion services on the user machine, such as a torrent downloader WebUI:

javascript
const response = await API.appAPI.localHttpRequest({  method: 'GET',  url: 'http://localhost:8080/api/v2/app/version',  timeoutMs: 15000});

It is intentionally limited to localhost, 127.0.0.1, and [::1], and it does not follow redirects. It exists to avoid browser/WebView CORS and cookie restrictions for local services, not to replace general internet fetch().

Packaging

From the app UI, use the plugin pack action where available. The backend command is pack_plugin(id).

It creates:

text
plugins/packed/<id>.mcx

Current packaging behavior:

  • archives direct files from plugins/<id>/
  • skips nested folders such as plugins/<id>/dev/
  • skips .mcx files in the plugin folder
  • expects plugin.json, index.js, and usually README.md

Manual packaging can use the same rule: zip the direct files and rename the archive to .mcx.

Installation

.mcx packages are zip files. Package installation, same-ID updates, and Plugins Settings editor create/update actions use one transactional workflow; no entry point writes live plugin content before the user has reviewed and accepted the candidate manifest and permissions.

The workflow is:

entry point, permission set, and package fingerprint, and compare an update with the installed plugin

dangerous permissions; consent is bound to the inspected package fingerprint

directory, and statically validate the staged manifest, source text, entry-point path, permissions, ID, scheme, and update contract again

the old provider, provider cache, registry entry, and persisted store fields

matching registry entry, invalidate plugin consumers once, dispose the previous worker, and finalize the transaction backup

  1. inspect the archive without extracting it, validate its package paths, manifest,
  2. show the candidate identity and complete permission list, highlighting additions and
  3. re-check the fingerprint, materialize the accepted bytes in a transaction-only staging
  4. commit the staged directory with a durable transaction marker and backup
  5. activate the committed plugin through the normal worker/runtime path while retaining
  6. after activation succeeds, atomically replace the manifest/provider cache and any

Precommit validation is deliberately static. Candidate source is never evaluated, imported, or initialized before commit, and there is no reduced-capability or "sandboxed candidate" execution mode. A plugin can execute only after consent-bound bytes are the committed disk version and normal activation begins. If that activation fails, the old runtime and store remain authoritative (or are restored first if a later cutover step failed), then the durable disk transaction rolls back. The activation error is surfaced only after rollback completes; a failed rollback leaves its marker and backup for startup recovery.

The store is the sole runtime cutover owner. The scanner merges disk state at startup but does not perform a live cutover, and ProviderRegistry does not dispose the old provider during a transactional replacement. Status, configuration, and installedAt are retained for a successful update. Open plugin panels, dashboards, Tools surfaces, the Function Bar, and Command Palette observe the same runtime-change invalidation so old commands cannot remain callable.

Transaction state is stored below plugins/.transactions/. The scanner explicitly ignores that directory and plugins/packed/. Startup scanning first reconciles incomplete transactions: staged work is discarded and any disk commit whose frontend cutover was not finalized restores its backup (or removes an unfinalized new installation). This includes a process stop during post-commit activation or rollback. Finalization durably acknowledges the runtime cutover outside the backup directory before cleanup, so a partially interrupted backup deletion can never be mistaken for a rollback source.

The editor derives a deterministic fingerprint from its candidate manifest, source, and README bytes, presents the same permission review, and re-checks those exact bytes when it stages them. Its source files are written only inside the transaction staging directory; the legacy direct save_plugin_files command is not exposed to the UI. Successful editor updates retain status, configuration, and installedAt exactly like .mcx updates.

Package validation requires a stable single-segment plugin ID, a contained relative entry point, contained archive members, and only host-known permission IDs. An installed plugin can only be updated by a package with the same ID and the same normalized filesystem scheme; scheme changes and collisions are rejected. If a plugin uses a gated API but does not declare the required permission, inspection fails before consent.

Edition Availability And Safety Boundary

Plugin installation, authoring, packaging, configuration, virtual drives, tools and commands are available in Free and Pro. Both editions use the same package inspection and permission-consent flow. Plugin permissions and compatibility requirements still apply; built-in premium features retain their own edition requirements.

Working Examples

Use these as concrete references:

  • plugins/sample-fs/: basic filesystem, thumbnails, custom columns, dashboard blocks
  • plugins/sample-tool/: tool plugin, dialog location, dashboard, commands
  • plugins/steam-library/: local filesystem reads, asset URLs, item actions, metadata
  • plugins/jellyfin/: remote API browsing, thumbnails, streaming
  • plugins/yts/: paged API VFS, caching, thumbnails, search path routing, magnet/torrent actions
  • plugins/qbittorrent/: localhost bridge, live monitor, background status rows, command palette controls

For new production plugins, add a development spec at plugins/<id>/dev/SPEC.md and keep it out of the .mcx package.