Building a MCP: Giving AI Hands in Your CI/CD Pipeline
I built a cloud-hosted Model Context Protocol server so ChatGPT and Claude can look straight into your GitHub repos: check CI/CD failures, review pull requests, and spit out workflow configs, all without you leaving the chat window.
01The Problem: Context Switching Hell
Every engineer knows this workflow intimately. Your pipeline breaks. Now you go through the ritual:
That's 8–10 steps of context switching before you even start fixing anything. And the worst part is you still had to manually copy-paste your error logs into the AI. It couldn't look at your actual GitHub. It only knew what you handed it.
The problem was never that ChatGPT is bad at reading CI failures. It's that ChatGPT can't see them in the first place.
02What is MCP?
MCP stands for Model Context Protocol, an open standard for letting AI models call external tools. Think of it as an API layer sitting between an assistant and the outside world.
Without MCP, ChatGPT is basically a brain in a jar. Smart, but cut off from your actual systems. MCP gives it hands: access to specific tools you define, with real limits on what it's allowed to touch.
03Architecture: Brain, Hands, and System
Here's the full architecture of the MCP as I built it:
ChatGPT / Claude
│
│ MCP Protocol
↓
┌──────────────────────────────┐
│ MCP │
│ │
│ devops-mcp.pratikpatil.tech │
└──────────────┬───────────────┘
│
GitHub REST API
│
┌───────────┼───────────┐
↓ ↓ ↓
Repositories Actions Pull Requests04What the MCP Can Do
The current version focuses on GitHub and CI/CD. Here are the tools it exposes:
Pulls repository metadata: visibility, default branch, stars, open issues, last pushed date. Good for confirming repo state without opening a browser.
Lists recent workflow runs with their status (success, failure, cancelled). You can filter by branch or workflow file.
This is the flagship feature. The MCP pulls the failed run, finds the failing jobs, grabs their logs, and hands the AI enough data to pinpoint the root cause and suggest a fix.
Fetches raw logs for a specific workflow run ID, for when you want to dig into one particular run instead of the most recent one.
Pulls the PR diff, changed files, and existing review comments, so the AI can give code review feedback without you leaving the chat.
Generates .github/workflows/*.yml files for Python, Node.js, Java, or Docker projects, complete with checkout, build, test, and deploy steps.
05How It Works End-to-End
Say you type: "Check my latest GitHub Actions pipeline."
The AI doesn't magically know about your GitHub. It knows about the tool, and chooses to call it. From there, the MCP handles the actual GitHub communication and hands back structured data the AI can reason over.
name: CI
on:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests
run: pytest06Why OAuth Matters
The MCP endpoint is publicly reachable at devops-mcp.pratikpatil.tech/mcp. That doesn't mean anyone who stumbles on it can touch my GitHub repositories, though.
ChatGPT ↓ MCP ↓ OAuth authentication ← GitHub asks: "Who is this user?" ↓ User grants access ← "Pratik authorized this app" ↓ Access token issued ↓ GitHub API (authenticated)
OAuth answers one question: "Who is this user, and are they allowed to use the DevOps MCP?" The GitHub connection is what gives the MCP permission to call GitHub at all. The OAuth token then scopes exactly which repositories and actions that permission covers.
07Custom Domain & Cloud Deployment
The MCP runs on Manufact Cloud and sits behind a custom subdomain instead of a throwaway deployment URL.
Internet
│
↓
devops-mcp.pratikpatil.tech
│
↓
Manufact Cloud
│
↓
MCP Server
│
┌──────────┴──────────┐
↓ ↓
GitHub API MCP Clients
(ChatGPT / Claude)That makes it a proper cloud-hosted MCP service instead of something running off my laptop. Any compatible MCP client, whether that's ChatGPT, Claude Desktop, or a custom integration, can connect, authenticate, and start using the DevOps tools right away.
08Making the MCP Context-Aware
One limitation in the current version: even with GitHub connected and authenticated, the tools still make you spell out the repository every single time. So instead of just asking:
you currently have to say something closer to:
The fix is making every parameter optional and letting the tool figure the rest out on its own. There's a distinction worth pulling apart here:
The ideal tool signature makes everything optional:
// All parameters are optional
interface ActionsInput {
repository?: string // auto-discovered if not given
workflow?: string // listed from repo if not given
branch?: string // defaults to repo's default branch
limit?: number // defaults to 10
}
async function githubActionsStatus(input: ActionsInput) {
// Step 1: resolve repository
if (!input.repository) {
input.repository = await discoverRepository()
// → lists accessible repos, picks most relevant
}
// Step 2: resolve workflow
if (!input.workflow) {
const workflows = await listWorkflows(input.repository)
// → returns all .yml files in .github/workflows/
}
// Step 3: fetch runs
return await fetchWorkflowRuns(input)
}With that in place, going from intent to result stays simple:
09Why MCP Instead of Just Asking ChatGPT?
This is the part that actually matters. It's not about what the AI knows. It's about what it can reach.
Here's the full list of what the MCP exposes right now: the actual actions the AI can take.
Honestly, the tools themselves are the less interesting part. What I actually got out of this was practice building the pattern behind them: connecting an AI model to a real system through something structured and auditable, instead of just pasting text back and forth all day.
MCP itself is still young, and a lot of this will probably look different in a year. But giving a model hands instead of just a voice is clearly where this is headed, and this project was my first real attempt at building that.