Molecule AI
ArchitectureTechnical Reference

Skills, Bundles, Coordinator & MCP

Skills system, bundle system, the coordinator pattern, and MCP server integrations.

Part of the Comprehensive Technical Documentation. Definitive reference based on a non-invasive scan of the molecule-core repository.

13. Skills System

Three Capability Sources

  1. Workspace-local skills: skills/<skill-name>/SKILL.md + tools/ directory
  2. Plugin-mounted rules: /plugins volume (read-only), shared across all workspaces
  3. Built-in tools: delegation, approval, memory, sandbox, telemetry, audit, compliance, governance

Skill Directory Structure

skills/generate-seo-page/
├── SKILL.md              # YAML frontmatter + natural language instructions
├── tools/
│   ├── write_page.py     # @tool-decorated Python functions
│   └── check_gsc.py
├── examples/             # Few-shot examples
├── templates/            # Reference files (HTML, etc.)
└── links.yaml            # External resource URLs

SKILL.md Frontmatter

---
name: "Generate SEO Landing Page"
description: "Create SEO-optimized bilingual landing pages"
version: "1.0.0"
tags: ["seo", "content", "bilingual"]
examples: ["Create a Vancouver renovation page in EN/ZH"]
requires:
  env: ["GSC_CREDENTIALS"]
  bins: ["jq"]
---

# Agent instructions follow in natural language...

Hot-Reload Pipeline

StepActionTiming
1File watcher detects change in skills/2s debounce
2Reload skill metadata + tool Python modulesImmediate
3Rebuild agent tools and Agent Card~100ms
4Broadcast updated card via WebSocket~50ms
5Peer system prompts rebuilt with new awareness~500ms
TotalEnd-to-end propagation~3 seconds

14. Bundle System

Bundle Format (.bundle.json)

{
  "schema": "1.0",
  "id": "seo-agent-vancouver",
  "name": "Vancouver SEO Agent",
  "tier": 1,
  "model": "anthropic:claude-sonnet-4-6",
  "system_prompt": "...full prompt text...",
  "skills": [{
    "id": "generate-seo-page",
    "name": "Generate SEO Landing Page",
    "files": {
      "SKILL.md": "---\nname: ...",
      "tools/write_page.py": "def write_page(...):\n    ..."
    }
  }],
  "tools": [{"id": "web_search", "config": {}}],
  "prompts": {"prompts/page-generation.md": "..."},
  "sub_workspaces": [],
  "agent_card": {"...": "A2A card snapshot"},
  "author": "molecule",
  "version": "1.2.0"
}

Inclusion/Exclusion Rules

IncludedExcluded
Full system prompt textAPI keys / secrets
All skill files (inlined)Memory / conversation history
Prompt templates + assetsDatabase data
Tool configurationsRuntime state
Sub-workspace bundles (recursive)
Agent Card snapshot

Workflow

  • Export: Right-click workspace → "Export as bundle" → .bundle.json download
  • Import: Drag .bundle.json onto Canvas → POST /bundles/import → recursive provisioning → new IDs → source_bundle_id traces lineage

17. Coordinator Pattern

How Team Expansion Works

  1. Workspace "expands into team" → becomes coordinator (team lead)
  2. Coordinator fetches children's Agent Cards to understand capabilities
  3. For each incoming task: analyzes → selects best-suited child → delegates via A2A
  4. Aggregates responses when tasks span multiple children
  5. Falls back to self-handling only if no child suitable

Key Properties

  • Enforcement: Coordinators cannot do direct work — all execution delegated to children
  • Recursive: Child workspaces can themselves expand into teams (unlimited depth)
  • Transparent: Upstream parent doesn't need to know if child is single agent or team of fifty
  • Detectable: coordinator.py checks get_children() — if children exist, coordinator mode activates

28. MCP Server & Integrations

Molecule AI MCP Server (mcp-server/)

20+ tools for Claude Code, Cursor, Codex, or any MCP client:

  • Workspace CRUD (list, create, get, delete, restart)
  • Agent communication (chat_with_agent)
  • Memory operations (commit_memory, search_memory)
  • Team management (expand_team, collapse_team)
  • Secrets management (set_secret, list_secrets)
  • File operations (read_file, write_file, delete_file)
  • Approvals (list_pending_approvals, decide_approval)
  • Config updates (update_workspace)
  • Templates (list_templates)

Transport: stdio (local CLI integration)

{
  "mcpServers": {
    "molecule": {
      "type": "stdio",
      "command": "node",
      "args": ["./mcp-server/dist/index.js"],
      "env": {"MOLECULE_URL": "http://localhost:8080"}
    }
  }
}

Awareness MCP Server

For persistent cross-session memory:

{
  "awareness-memory": {
    "type": "stdio",
    "command": "npx",
    "args": ["-y", "@awareness-sdk/local", "mcp"]
  }
}

On this page