How I Leveraged a Local MCP Server and GitHub Copilot to Automate Code Reviews
Photo by Daniil Komov on Unsplash
Tech March 04, 2026 · By Garv

How I Leveraged a Local MCP Server and GitHub Copilot to Automate Code Reviews

Bridging the gap between GitLab-hosted repos and AI-powered review tooling — without leaving VS Code.

Share: Twitter Facebook LinkedIn

The Problem: GitLab Repos in a GitHub-Shaped World

If your codebase lives on GitHub, you're spoiled for choice. GitHub's native Copilot pull request review feature can scan diffs, flag issues, and suggest fixes — all baked into the platform.

But what if your repository is on GitLab?

That's the position our team was in. We maintain a .NET backend — a platform with strict technical requirements spanning authentication, data persistence, message queue consumers, scheduled jobs, resilience patterns, observability and more. The codebase is hosted on GitLab, where:

GitHub Copilot's native PR review doesn't exist. It's a GitHub-only feature.

  • Our technical requirements document is 30+ pages. New developers (and sometimes experienced ones) forget rules. We needed something that could check code against our specific policies — not generic best practices.
  • Manual reviews can be bottlenecks. engineers spending a lot of time reviewing PRs is not the best use of time.
  • With the rise of AI tools in the development workflow. it only makes sense to introduce code review tools that meet the demand.

We needed a way to bring AI-powered, project-aware code review into our workflow — despite being on GitLab.

The solution: a local MCP server that encodes our technical requirements as machine-readable policy rules, connected to GitHub Copilot in VS Code agent mode.

What Are MCP Servers?

The Model Context Protocol (MCP) simply put is an open standard, originally developed by Anthropic, that defines how AI models communicate with external tools and data sources. Think of it as a USB-C port for AI — a universal interface that lets any compatible AI client (GitHub Copilot, Claude Desktop, Cursor, etc.) plug into any compatible server.

The key here is that the MCP server doesn't contain an LLM. It's a lightweight process that provides context and capabilities to an LLM running elsewhere (in our case, GitHub Copilot). The server runs locally, reads our filesystem, executes git commands, and returns structured data — but the reasoning about that data happens in the LLM.

Transport

MCP supports multiple transports — HTTP and stdio (standard input/output). For a local tool running inside VS Code, stdio is ideal: VS Code spawns the server as a child process and communicates via JSON-RPC over stdin/stdout. No ports to open, no authentication to configure, no network exposure.

GitHub Copilot in VS Code: The Final Piece

GitHub Copilot in VS Code isn't just autocomplete anymore. It operates in several modes, and understanding the difference is key to this solution: For the sake of this article i'll focus on the mode that makes our solution work.

Agent Mode

Agent mode transforms Copilot from a responder into an autonomous agent. In this mode, Copilot can:

  • Call tools — including MCP tools you've registered
  • Read resources — structured data exposed by MCP servers
  • Execute multi-step workflows — "get changed files → classify them → read each one → evaluate against policies → report findings"
  • Make decisions — choose which tools to call based on intermediate results

This is the mode that makes our solution tick. When you type "Review my staged changes" in Copilot Chat with agent mode enabled, Copilot doesn't just look at your open file — it orchestrates a multi-step review workflow by calling our MCP server's tools in sequence, reasoning about the results, and producing a structured report.

For fear of this article getting longer than it already is, I'll save the tech stack and how to's for a follow up that'll tie everything together. The key take away is that if your repo isn't on GitHub, you're not locked out of AI-powered reviews. There's workarounds which can allow you to breach the threshold, one of which we'll continue to explore in the second part of this series.

How did you find this article?

Garv

Garv

Blog administrator and primary author

An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.