Skip to main content

Molecule AI workspace runtime — shared infrastructure for all agent adapters

Project description

molecule-ai-workspace-runtime

Shared workspace runtime for Molecule AI agent adapters. Installed by every workspace template image (workspace-template-claude-code, -langgraph, -hermes, etc.) to provide A2A delegation, heartbeat, memory, plugin loading, and skill management.

This package is published from the molecule-core monorepo workspace/ directory by the publish-runtime GitHub Actions workflow on every runtime-v* tag push. Do not edit this package directly — edit workspace/ in the monorepo.

External-runtime MCP server (molecule-mcp)

Operators running an agent outside the platform's container fleet (any runtime that supports MCP stdio — Claude Code, hermes, codex, etc.) can install this wheel and run the universal MCP server locally.

Requirements

  • Python ≥3.11. The wheel sets requires-python = ">=3.11". On older interpreters pip install returns the cryptic Could not find a version that satisfies the requirement — that message is pip filtering this wheel out, NOT the package missing from PyPI. Upgrade with brew install python@3.12 / apt install python3.12 / pyenv install 3.12 first.
  • pipx recommended over pip. pipx install puts molecule-mcp on PATH automatically and isolates the runtime's deps from your system Python. Plain pip install --user works but the binary lands in ~/.local/bin (Linux) or ~/Library/Python/3.X/bin (macOS) which is often not on PATH on a fresh shell — claude mcp add molecule -- molecule-mcp then fails with "command not found" at first use.

Install

# Recommended:
pipx install molecule-ai-workspace-runtime

# Alternative (manage PATH yourself):
pip install --user molecule-ai-workspace-runtime

Run

WORKSPACE_ID=<uuid> \
  PLATFORM_URL=https://<tenant>.staging.moleculesai.app \
  MOLECULE_WORKSPACE_TOKEN=<bearer> \
  molecule-mcp

That exposes the same 8 platform tools (delegate_task, list_peers, send_message_to_user, commit_memory, etc.) that container-bound runtimes already get via the workspace's auto-spawned MCP. Register the binary in your agent's MCP config (e.g. Claude Code's claude mcp add molecule -- molecule-mcp with the env above).

Keeping the token out of shell history

Inline MOLECULE_WORKSPACE_TOKEN=<bearer> ends up in ~/.zsh_history and (when registered via claude mcp add) plaintext in ~/.claude.json. To avoid that, write the token to a 0600 file and point MOLECULE_WORKSPACE_TOKEN_FILE at it:

umask 077
printf '%s' "<bearer>" > ~/.config/molecule/token
WORKSPACE_ID=<uuid> \
  PLATFORM_URL=https://<tenant>.staging.moleculesai.app \
  MOLECULE_WORKSPACE_TOKEN_FILE=$HOME/.config/molecule/token \
  molecule-mcp

Token resolution order: MOLECULE_WORKSPACE_TOKEN (inline env) → MOLECULE_WORKSPACE_TOKEN_FILE (path) → ${CONFIGS_DIR}/.auth_token (in-container default).

The token comes from the canvas → Tokens tab. Restarting an external workspace from the canvas no longer revokes the token (PR #2412), so operator tokens persist across status nudges.

Push vs poll delivery (Claude Code specifics)

By default the inbox runs in poll mode — every turn the agent calls wait_for_message, which blocks up to ~60s on /activity?since_id=…. Real-time push delivery is also supported, but on Claude Code it requires THREE conditions, ALL of which must hold:

  1. The MCP server declares experimental.claude/channel — this wheel does (see _build_initialize_result). Nothing for you to do.
  2. Claude Code installs the server as a marketplace plugin — a plain claude mcp add molecule -- molecule-mcp produces a non-plugin-sourced server, which Claude Code rejects with channel_enable requires a marketplace plugin. Until the official moleculesai/claude-code-plugin marketplace lands (issue #2934 follow-up), operators who want push must scaffold their own local marketplace under ~/.claude/marketplaces/molecule-local/ containing a marketplace.json + plugin.json that points at this wheel.
  3. Claude Code is launched with the dev-channels flag — pass --dangerously-load-development-channels plugin:molecule@<marketplace> on the claude invocation. Without this flag the channel capability is silently ignored.

Symptom of any condition failing: messages arrive but only via the poll path (every ~1–60s), not real-time. There's currently no diagnostic surfaced — molecule-mcp doctor (issue #2934 follow-up) is planned.

If you don't need real-time push, the default poll path works universally with no extra setup; both modes converge on the same inbox_pop ack so messages never duplicate.

See docs/workspace-runtime-package.md for the publish flow and architecture.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

molecule_ai_workspace_runtime-0.1.123.tar.gz (266.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

molecule_ai_workspace_runtime-0.1.123-py3-none-any.whl (314.3 kB view details)

Uploaded Python 3

File details

Details for the file molecule_ai_workspace_runtime-0.1.123.tar.gz.

File metadata

File hashes

Hashes for molecule_ai_workspace_runtime-0.1.123.tar.gz
Algorithm Hash digest
SHA256 ea11394116248e94fe44c39c093359805b5ae95af3ec97a22be595e54065f6c0
MD5 3be7e8e2d7c738a3a40e74efc8ed9f73
BLAKE2b-256 1dbb6cae076333476d7c26fb3f9023ccac86fe7ec156275b196472895114f71c

See more details on using hashes here.

Provenance

The following attestation bundles were made for molecule_ai_workspace_runtime-0.1.123.tar.gz:

Publisher: publish-runtime.yml on Molecule-AI/molecule-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file molecule_ai_workspace_runtime-0.1.123-py3-none-any.whl.

File metadata

File hashes

Hashes for molecule_ai_workspace_runtime-0.1.123-py3-none-any.whl
Algorithm Hash digest
SHA256 fe5997be9a31de6b947c68e2832ca21fcdaaba29526b10c6e4e29be0bd32ba61
MD5 a23203de7e0667f49d12ea87e123cfcc
BLAKE2b-256 9e143a8fc7df8b684023f42d465ad5e3749b25f0c82e0e590850c1c1316c432a

See more details on using hashes here.

Provenance

The following attestation bundles were made for molecule_ai_workspace_runtime-0.1.123-py3-none-any.whl:

Publisher: publish-runtime.yml on Molecule-AI/molecule-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page