Connectors

Connector refers to the three ways Markus “connects through” to external systems/platforms: external agent platform connectors (gateway type, wiring agent platforms like OpenClaw into Markus), IM communication adapters (bringing chat platforms like Feishu/Slack/Telegram/WhatsApp in as messaging channels), and MCP integration (providing new tools via MCP servers). This page explains these three paths and the connector descriptor format. ← Back to Assets · 中文原版


1. Three Access Paths at a Glance

AccessMechanismPurpose
External platform connectorConnector descriptor (JSON) + config read/write + skill template injectionWire external agent platforms (OpenClaw / Hermes…) into Markus
IM communication adapter@markus/comms CommAdapter + MessageRouterUse Feishu/Slack/Telegram/WhatsApp/WebUI as messaging channels
MCP skillmcpServers in a SKILL packageProvide brand-new tools to Agents (external API access, etc.) — see Skills

2. External Agent Platform Connectors (Gateway Connector)

The core of this connector type is a connector descriptor (Connector Descriptor, a JSON file) describing how to detect, install, and wire up a given external agent platform. Load order: built-in (ships with the CLI package) → development directory (packages/cli/connectors/) → user directory (~/.markus/connectors/, same name overrides built-in). Files starting with _ are skipped.

Descriptor Format

{
  "platform": "openclaw",              // platform name, decisive identifier
  "displayName": "OpenClaw",
  "description": "Open-source AI coding agent",
  "homepage": "https://github.com/...",
  "detection": {
    "configPaths": ["~/.openclaw/openclaw.json", "~/.openclaw/openclaw.json5"],
    "binaryName": "openclaw",          // probe in PATH
    "processName": "openclaw"          // probe whether the process is running
  },
  "installation": {
    "npmPackage": "openclaw",
    "initCommand": "openclaw init",
    "startCommand": "openclaw start --daemon",
    "stopCommand": "openclaw stop"
  },
  "integration": {
    "type": "gateway",
    "configFormat": "json5",           // json | json5
    "configPath": "~/.openclaw/openclaw.json",
    "tokenField": "integrations.markus.token",  // dotted-nested write
    "urlField": "integrations.markus.url",
    "llmProvidersField": "models.providers",    // read shared providers dimension
    "skillDir": "~/.openclaw/skills",
    "skillTemplateName": "openclaw-markus-skill"
  },
  "defaultCapabilities": ["code", "review", "test", "debug", "documentation"],
  "defaultAgentName": "OpenClaw Agent"
}

Connector Service Capabilities (connector-service)

  • Detect: scanInstalledPlatforms() returns each platform’s installed / binaryFound / running (checks config paths, binaries in PATH, process names). This is the input to markus doctor / the install wizard.
  • Read config: readPlatformConfig parses the external platform’s config; json5 is cleaned (comments/trailing commas) before parsing.
  • Write config: writePlatformConfig writes Markus’s URL + token into the external config (dotted-nested fields), creating them if missing.
  • Install skill template: copies Markus integration skill templates into the external platform’s skills directory (installSkillTemplate).
  • LLM reuse: readPlatformLLMProviders reads the external platform’s providers, reusable in Markus.

In one sentence: a connector lets Markus “recognize, install, and configure” an external agent platform, and share messages and LLM config bidirectionally with it.


3. IM Communication Adapters (Comms Layer)

packages/comms provides a unified messaging adapter layer so Agents can send/receive messages over mainstream IM platforms:

Built-in Adapters

PlatformModule
Feishucomms/src/feishu/ (adapter + cards + client)
Slackcomms/src/slack/
Telegramcomms/src/telegram/
WhatsAppcomms/src/whatsapp/
WebUIcomms/src/webui/ (built-in browser UI)

MessageRouter Routing Model

MessageRouter
  ├─ registerAdapter(adapter)          # register adapter by platform
  ├─ bindAgentToChannel(agentId, platform, channelId)  # bind a channel to an Agent
  ├─ connectAll(configs)               # batch-connect and attach onMessage
  ├─ sendToChannel / sendAsAgent       # send to a channel / send as an Agent
  └─ routeIncomingMessage              # route inbound message platform:channelId → agent
  • Each adapter implements the CommAdapter interface (connect / disconnect / onMessage / sendMessage / isConnected).
  • Inbound messages are routed precisely by {platform}:{channelId} to the bound Agent; the Agent can reply (replying in the original thread when a threadId exists).
  • Platform integration landing (Feishu platform page + install steps): see Feishu Integration →.

ℹ️ For currently officially supported platform integration details, see Feishu Integration (Feishu is the reference implementation; other platforms will be filled in once landed).


4. MCP Integration (MCP-Based Skills)

MCP (Model Context Protocol) integration means “turning external capabilities into Agent tools via a standard protocol”, carried by MCP-based skills:

  • Declare servers {command, args, env} under skill.mcpServers in skill.json; the command can be any executable (node / python3 / npx / …).
  • MCP servers use JSON-RPC 2.0 over stdio, implementing initialize / tools/list / tools/call.
  • Exposed tools are automatically prefixed with the server name (e.g. my-api__search); Agents call them by the prefixed name.
  • Can use the Markus Hub / external MCP server formats; markus skill import also normalizes the mcp-server format (containing mcp.json / .mcp.json).
  • Community MCP servers can be used directly as tools (e.g. activated via discover_tools).
  • MCP details: see Skills / MCP-based section; an external skill’s mcpServers only take effect if the local runtime (npx / uvx installed) is present.

5. Next Steps

  • How to build MCP-based skills → Skills / MCP-based.
  • Specific platform integration (Feishu is currently officially supported) → Feishu Integration →.
  • External agent platform connection is the foundation of platform integration → read it together with the platform integration category.