Ramesh Inampudi

AI and agents

xGAIR: An MCP Server That Gives AI Assistants Repo Context

By Ramesh Inampudi · 2026-11-16 · 4 min read

AI coding assistants are good at writing code and bad at knowing your project. Every new session starts from zero: the assistant doesn't know your stack, your conventions, or the mistake you already fixed last week. It also tends to jump straight to writing code. I built xGAIR to deal with both problems: missing context and missing discipline.

Why I built it

I work on several side projects across different stacks, including vanilla JavaScript, TypeScript with React, and Kotlin with Compose. Each time I opened an AI assistant on one of them, I had to re-explain the basics. The assistant would also happily start editing files before it understood the problem.

I wanted one layer that sits between any GitHub repository and any AI assistant, so the assistant arrives already informed and follows the same process every time. The tagline I settled on is PLUG IN. IT ALREADY KNOWS.

What it does

xGAIR is an MCP (Model Context Protocol) server. It is not a chatbot wrapper. It works with Claude Code, VS Code GitHub Copilot, Cursor, Windsurf, Zed, Claude Desktop, JetBrains IDEs and ChatGPT. The README describes it as doing six things:

The workflow is the core idea. Every task, however small, follows the same sequence:

INVESTIGATE → PLAN (hard stop, wait for approval) → IMPLEMENT → VALIDATE → SHIP

The hard stop after planning matters most. The assistant has to present a plan and wait for approval before it touches code.

How it works

The project is written in TypeScript, with some Python and shell scripts alongside. It targets Node.js 18 and above and is published on npm as xgair. The server entry points are src/server.ts and src/index.ts, and a CLI wraps the setup and serving steps.

Two transports

Most IDEs launch MCP servers as a subprocess and talk over stdio, so seven of the eight supported clients use that mode. The config is the same pattern everywhere:

{"command": "npx", "args": ["xgair", "serve"], "env": {"GITHUB_TOKEN": "<your-token>"}}

ChatGPT and other web clients need HTTP instead. xgair serve --http --port 3000 exposes an MCP endpoint at /mcp and a health check at /health. For remote access you can tunnel it with npx ngrok http 3000. If you only want local access, --host 127.0.0.1 binds to localhost.

Supporting both from one server meant the tool logic had to stay independent of the transport. That is a reusable lesson for any MCP server: keep the tools transport-agnostic and treat stdio and HTTP as thin entry layers.

Discovery without a clone

Discovery runs as a five-phase pipeline against the GitHub API. Because it reads through the API, you can connect a repo or a whole organization without checking anything out. xgair connect owner/repo registers one repository, and xgair connect --org myorg registers every repo in an org. xgair discover runs the pipeline, and it resumes from cached phases unless you pass --no-resume. Resumability is useful when a long pipeline gets interrupted partway through.

Setup as a single command

The interactive wizard is the main entry point:

npx xgair init --github <your-username>

It verifies your GitHub token, creates a workspace directory (~/.xgair by default), connects your first repo, optionally runs discovery, and prints setup instructions for every supported IDE. After that, xgair config --ide <id> prints the exact config for your editor, and you can redirect it straight into a file such as .mcp.json or .vscode/mcp.json.

xgair status lists connected repositories with their detected stack and how many discovery phases have completed, so you can see at a glance which repos are ready.

What I learned

I have not published any measurements of how much this improves assistant output, so I won't claim a number. What I can say is that it changes how a session starts: the assistant has context and a process before the first prompt.

Conclusion

xGAIR is my attempt to stop re-explaining my projects to AI assistants and to make them plan before they code. It is an MCP server with a CLI, support for eight IDEs and assistants, and a fixed four-phase workflow. If you want to try it, the package is on npm as xgair, and the quick start is the single init command above. Questions or feedback are welcome at hello@iramesh.com.