In the previous chapter, The Skills System, we taught our agents how to do things by giving them "Skill Books" (like how to deploy code or run tests).
However, there is still a big problem: our agents are "Brains in a Jar."
They are very smart, but they are locked inside a text file. They cannot see your Trello board, they cannot check your live GitHub Issues, and they cannot hear you unless you open a chat window.
In this chapter, we will give the agents:
Without integration, working with AI feels like this:
This is tedious. We want the agent to just see Issue #42 and fix it directly.
MCP stands for Model Context Protocol. Think of it like a Universal USB Port for AI.
Before MCP, if you wanted an AI to talk to Trello, you had to write complex custom code. With MCP, you just "plug in" the Trello server, and suddenly your agent knows how to read cards and move lists.
mcp-config.jsonTo give your squad hands, you create a configuration file. This tells the Coordinator which tools are allowed.
This file lives at .copilot/mcp-config.json (or .vscode/settings.json).
{
"mcpServers": {
"github": {
"command": "node",
"args": ["path/to/github-mcp.js"],
"env": {
"GITHUB_TOKEN": "$GITHUB_TOKEN"
}
}
}
}
What is happening here?
github.github-mcp.js).GITHUB_TOKEN) so the agent has permission to log in.Once this file exists, you can say:
"Squad, look at the open issues on GitHub and summarize them."
The agent effectively "plugs in" to GitHub, fetches the live data, and reads it. You didn't have to copy-paste anything.
MCP allows the agent to reach out, but GitHub Workflows allow the outside world to poke the agent.
Imagine a Receptionist at your office. When a client walks in (a new Issue is created), the receptionist calls the correct agent on the phone. You don't need to be there for this to happen.
Squad comes with a template called squad-triage.yml. It is a GitHub Action that runs every time a specific event happens in your repository.
name: Squad Triage
on:
issues:
types: [labeled] # Listen for labels
jobs:
triage:
if: github.event.label.name == 'squad' # Only if label is 'squad'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Wake up the Team
uses: actions/github-script@v7
# Script follows...
What is happening here?
squad to an issue.Let's combine these concepts into a real-world flow.
squad.Let's look at how the MCP connection is established when you start a chat.
The Coordinator needs to safely read your configuration to know what tools are available. It parses the JSON and checks for errors.
// Simplified from test/mcp-config.test.js logic
function loadMcpConfig(dir) {
const configPath = path.join(dir, '.copilot', 'mcp-config.json');
if (!fs.existsSync(configPath)) {
return {}; // No tools configured
}
// Read and parse the JSON file
const content = fs.readFileSync(configPath, 'utf8');
return JSON.parse(content);
}
This simple function is the gateway. If the file exists, the Coordinator loads the definitions. If not, the agents work in "offline" mode.
The squad-triage.yml workflow actually runs a piece of JavaScript directly on GitHub servers. It acts as a bridge between the "Event" and your "Team Roster."
Here is a simplified view of how the workflow reads your team:
// Simplified from templates/workflows/squad-triage.yml
const teamFile = '.ai-team/team.md';
const content = fs.readFileSync(teamFile, 'utf8');
// Look for the Frontend role
if (issueBody.includes('css') || issueBody.includes('ui')) {
// Find the member with "Frontend" role in the text
const member = findMemberByRole(content, 'Frontend');
// Apply the label to assign them
github.issues.addLabels({
issue_number: context.issue.number,
labels: [`squad:${member.name}`]
});
}
Explanation:
team.md file (which is just text in your repo!).In this chapter, we connected our agents to the outside world.
Now your agents are connected and aware. But when a new issue arrives, who exactly should work on it? Should the "Frontend" agent take it, or the "Team Lead"? How do we handle complex requests that require multiple agents?
In the final chapter, we will explore the logic of distributing work.
Next Chapter: Work Routing & Triage
Generated by Code IQ