intermediatepractical-guidesloop-engineeringmcpconnectorsintegrations

Chapter 5 of 8

Connectors & MCP

Plugging the loop into your real environment so it can open PRs, link tickets, and ping channels — not just tell you what it would do.

Connectors & MCP

A loop that can only see the filesystem is a tiny loop.

The difference between an agent that says "here is the fix" and a loop that opens the PR, links the Linear ticket, and pings the channel once CI is green by itself — that difference is connectors.

What connectors are

Connectors let the agent read your issue tracker, query a database, hit a staging API, drop a message in Slack. They are built on MCP (Model Context Protocol) — an open standard, so a connector you write for one tool usually works in the others.

# A minimal MCP server that exposes one tool: read open issues
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("issues")

@mcp.tool()
def open_issues(limit: int = 10) -> list[dict]:
    """Return the most recent open issues from the tracker."""
    return issue_tracker.list_open(limit=limit)

if __name__ == "__main__":
    mcp.run()

Once registered, the loop can call open_issues like any other tool — the agent decides when to use it based on the task.

Why MCP specifically

Because it's portable. Codex and Claude Code both speak MCP. Write the connector once, point both tools at it. This is the same tool-agnostic thesis from chapter one: the shape is the same, so your loop survives switching agents.

MCP also gives you a clean boundary for permissions. A connector can be read-only (safe to let a loop run unattended) or read-write (gate behind human approval). Design the connector with the loop's autonomy in mind.

Plugins: bundling connectors and skills

A skill is the authoring format. A plugin is how you ship a bundle. When you want a teammate to install your setup — three connectors plus two skills — in one go instead of rebuilding it from memory, you package it as a plugin.

my-team-plugin/
├── plugin.json              # manifest
├── skills/
│   ├── deploy-checklist/
│   └── triage-issues/
└── connectors/
    ├── github/              # MCP server
    └── linear/

Connectors expand the blast radius

A loop that can read your filesystem is contained. A loop that can write to your issue tracker, deploy to staging, and message your team is not. Every connector you add multiplies what an unattended loop can do — including do wrong. Start connectors read-only; promote to write only behind a human checkpoint.

What this block contributes to the loop

Connectors are why the loop can act inside your actual environment instead of just telling you what it would do if it could. Without them, a loop that finds a bug writes "consider fixing auth.py line 42". With them, the same loop opens a worktree, drafts the fix, opens the PR, and links the ticket. The loop graduates from advisor to operator.


Next: State & Memory — the +1 block, the spine that lets a loop survive between runs.