Skip to content
Courses/Agents and automation/MCP Verification Before Merge

MCP Verification Before Merge

MCP lets you connect agents to real tools. That is powerful and dangerous. The healthy pattern for code is to separate two roles: an agent that proposes changes and a verifier that tests in a clean environment before merge.

  • Understand the edit → verify → approve pattern.
  • Separate write permissions and verification permissions.
  • Design an internal MCP without giving away repo keys.

The Typical Mistake

The agent edits code, says "it's done," and nobody runs the project from scratch. There may be broken dependencies, tests that don't run, missing environment variables, or a build that only worked in its context. MCP helps turn that intuition into a verifiable process.

Terminal
# Recommended flow
1. Editor agent:
   - create branch
   - apply changes
   - open PR with summary and risks

2. Agent/verifier:
   - clone repo in clean folder
   - install dependencies
   - run lint, tests, and build
   - attach logs to PR

3. Human or policy:
   - approve only if verification passes

Permission Design

  • GitHub MCP: create branch, commit, and PR; never force-push to `main`.
  • Verify MCP: fresh clone, install, lint, test, build, and logs.
  • Secrets: don't pass real `.env` files to the verifier if they aren't needed.
  • Network: limit external outbound connections if the project doesn't need them.
  • Logs: save command, exit code, Node/Python version, and summary.
Terminal
{
  "tool": "verify_repo",
  "input": {
    "repo": "github.com/company/app",
    "branch": "agent/fix-login",
    "commands": ["npm ci", "npm run lint", "npm test", "npm run build"],
    "timeout_seconds": 900
  },
  "output": {
    "status": "failed",
    "failed_command": "npm test",
    "exit_code": 1,
    "log_url": "https://..."
  }
}

Official Sources

  • Model Context Protocol introduction
  • MCP specification
Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue