Skip to content

5. Using connectors ​

A connector is an outside service a task can use: a server that gives agents tools over the Model Context Protocol (MCP). Put it at the top level of the workflow, and link it to each task that needs it with a dotted link (-.-).

Code:
mermaid
agentflow TB
  connector github["GitHub"]@{ protocol: "mcp", url: "https://api.githubcopilot.com/mcp/" }

  flow triage["Issue triage"]
    read["Read issues"]@{ instruction: "List the open issues labelled bug." }
    label["Label issues"]@{ instruction: "Add a priority label to each bug." }
    read --> label
    read -.- github
    label -.- github
  end
Ctrl + Enter|

A connector needs two settings:

  • protocol — always "mcp".
  • url — the full address of the server.

You can also write the settings on their own line, after the connector:

text
connector github["GitHub"]
github@{ protocol: "mcp", url: "https://api.githubcopilot.com/mcp/" }

A dotted link has no direction, so read -.- github and github -.- read mean the same. Only a task can link to a connector, and a connector is never part of the order of steps. An arrow to a connector is an error.

Code:
mermaid
agentflow TB
  connector github["GitHub"]@{ protocol: "mcp", url: "https://api.githubcopilot.com/mcp/" }

  flow triage["Issue triage"]
    read["Read issues"]@{ instruction: "List the open issues labelled bug." }
    read --> github
  end
Ctrl + Enter|

Connector "github" can't be the target of an arrow. Link it with a dotted link instead: <task> -.- github.

A connector that no task links to is an error too, because nothing can use it.

Next: 6. Starting a flow.

Opens in mermaid.ai