DEV Community

floworkos
floworkos

Posted on

Building Connections in Flowork: Channels, MCP Servers, and Custom Connectors

Flowork treats connections as a unified layer—the pipes that carry messages into your agents and the tools your agents can reach. Whether you're opening a new messaging door or wiring up external AI capabilities, the architecture stays the same: install, configure, and let the kernel route traffic through a single contract.

Channels: Human-to-Agent Doors

A channel is how people talk to your agents. Flowork ships with native support for Telegram, Discord, Slack, WhatsApp, and CLI, and lets you add more.

Installing a Channel

Drop a .fwpack file (marked kind:channel) into Flowork. The system validates it, extracts it to its own folder, and hot-loads it—no restart required. Each connector appears as a card in the Connections panel with three actions:

  • Enable / Disable — toggle whether the channel accepts messages.
  • Config — set credentials (bot token, API key, etc.) and any channel-specific options. The form fields come directly from the connector's manifest, and secrets are always masked in the UI.
  • 🗑 Uninstall — remove the connector.

Native connectors (the built-in ones) skip the install step and only expose Config.

The pattern is simple: a message arrives on Telegram, Discord, or CLI → the channel connector relays it to an agent → the agent replies → the connector sends the response back to the user.

MCP: Bidirectional Tool Integration

MCP (Model Context Protocol) is an open standard for connecting AI systems to external tools. Flowork speaks it both ways: your agents can use outside tools, and outside applications can drive your agents.

Using External MCP Servers (Client Mode)

Paste the same mcpServers JSON configuration you'd use in any MCP-compatible application:

{
  "github": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-github"],
    "env": { "GITHUB_TOKEN": "your-token-here" }
  }
}
Enter fullscreen mode Exit fullscreen mode

Hit Install + Enable. Flowork starts the server process and makes its tools available to all agents immediately. Each MCP card displays:

  • The list of tools the server exposes.
  • Enable/Disable toggle (disable it for all agents, or untick it per-agent in each agent's Tools settings).
  • Uninstall button.

Now your agents can call those tools as naturally as built-in functions.

Exposing Your Agents (Server Mode)

Flowork can also be the MCP server, so external IDEs, AI assistants, or automation tools can talk to your agents over the MCP protocol (stdio-based).

It exposes:

  • chat — send a message to an agent and get a reply (same semantics as Telegram or the CLI).
  • task_list, task_run, task_result — query and execute tasks.

To use it, point an external MCP client at the flowork-mcp command and set the FLOWORK_MCP_AGENT environment variable to the agent name. Flowork handles the rest—authentication, capability routing, and all the MCP framing.

Building a Custom Channel Connector

Start from templates/connector-template/. A channel connector is a .fwpack with:

  1. A manifest declaring config fields (e.g., bot_token, webhook_url).
  2. Relay logic: a simple pipe that listens for incoming messages, forwards them to an agent, and sends replies back.

Build the .fwpack, drop it into Flowork, and the Config panel auto-generates form fields from your manifest. No MCP building needed—MCP servers are just configuration; you only write code for channels.

One Door: The Loket

All traffic—incoming messages, tool calls, database reads—flows through a single kernel interface called the loket. No module acts alone. To send a message, run a tool, or write to memory, it calls call(capability_name, args). The kernel checks permissions, routes the request to the right provider, and returns the result.

This design means:

  • Isolation — each agent runs in its own WASM sandbox and can only use capabilities it's been granted.
  • Auditability — every action is routed through one place, making logs and monitoring straightforward.
  • Extensibility — adding a new connector or tool doesn't touch the core; it just registers a new capability.

Settings: Secrets and Defaults

Global configuration lives in Settings, kept separate from any single agent. API keys, LLM defaults, and Telegram notifications all live here, never hardcoded.

API Keys is where every external credential goes—Dev.to tokens, social media cookies, service keys. You can add them manually (name + value) or tap a service chip (Dev.to, X, LinkedIn, Telegram) to auto-fill the expected variable name. Once saved, they're injected into the running process immediately and available to agents at boot via environment variables.

Router & Model sets the global fallback LLM and router address. Per-agent settings always override these defaults.

The principle: one place for owner-level secrets and system defaults, one place for each agent's private settings. No credentials in code.


Flowork is open source — both products:

Top comments (0)