pr-docs-mcp
officialMCP server + Claude skill that turns a GitHub pull request into a Mintlify doc draft.
pr-docs-mcp
Turn a GitHub pull request into a clear Mintlify documentation draft — using an MCP server for the data and a Claude skill for the writing.
This is an AI-native documentation pipeline: the server fetches the facts, Claude writes the prose, and Mintlify publishes the page. No copy-pasting PR descriptions by hand.
How it works
GitHub PR ──> fetch_pr (MCP tool) ──> doc-drafter skill (Claude writes) ──> docs-site/*.mdx ──> Mintlify
data plumbing the brain the page the website
- The server is plumbing.
docs-pipeline.tsexposes one data-only MCP tool,fetch_pr. It makes no LLM calls — it just returns facts about a pull request. - The skill is the brain.
doc-drafter/SKILL.mdtells Claude to callfetch_pr, then write the documentation itself and save it into the docs site. - Mintlify is the destination. The generated
.mdxlives indocs-site/and renders as a clean docs website.
The fetch_pr tool
Input:
| field | type | description |
|---|---|---|
owner | string | repository owner (user or org) |
repo | string | repository name |
pull_number | positive integer | the PR number |
Returns the PR’s number, title, body, changed files, and commits (commit messages) — as JSON.
Input is validated with Zod; failures come back as an MCP isError result rather than crashing the server.
Use it from npm (no clone needed)
The fastest way to use fetch_pr in any project — install straight from npm, no source code required.
1. Go to the project where you want it:
cd /path/to/your-project
2. Register the published server (token pulled from your gh login):
claude mcp add docs-pipeline -e GITHUB_TOKEN=$(gh auth token) -- npx -y pr-docs-mcp
npx -y pr-docs-mcp fetches the published package and runs it — no source code lives in your project.
3. Confirm it’s registered:
claude mcp list
You should see docs-pipeline in the list.
4. Start a fresh Claude Code session in that folder. MCP servers load when a session starts, so reload the VSCode window (or run claude in the folder).
5. Check it’s connected, then use it. Type /mcp — you should see docs-pipeline with the fetch_pr tool. Then ask:
Use fetch_pr to get PR 42 from owner/repo
$(gh auth token)needs the GitHub CLI installed and logged in (gh auth login). Nogh? Swap in-e GITHUB_TOKEN=your_tokeninstead.
Optional — the doc-drafter skill makes the assistant write the full doc, not just fetch data. It ships inside the package:
npm install pr-docs-mcp
cp -r node_modules/pr-docs-mcp/doc-drafter ~/.claude/skills/
Then ask: “write docs for PR 42 in owner/repo.”
Other MCP clients (Claude Desktop / Cursor)
Add the published server to the client’s MCP config:
{
"mcpServers": {
"docs-pipeline": {
"command": "npx",
"args": ["-y", "pr-docs-mcp"],
"env": { "GITHUB_TOKEN": "your_token" }
}
}
}
Restart the client, then ask: “fetch PR 42 from owner/repo.”
Run from source (for development)
Want to hack on the server itself? Clone it instead of installing from npm:
git clone https://github.com/nihaanth/pr-docs-mcp.git
cd pr-docs-mcp
npm install
Add a GitHub token (yours stays local — .env is gitignored):
cp .env.example .env
# edit .env and set GITHUB_TOKEN=...
A token with no scopes is enough for public repos (and raises your rate limit from 60 to 5000 requests/hour). Private repos need the
reposcope (classic) or “Pull requests: Read” (fine-grained).
Register the local server — note tsx and the full path instead of npx -y pr-docs-mcp:
claude mcp add docs-pipeline -e GITHUB_TOKEN=your_token -- npx tsx /full/path/to/pr-docs-mcp/docs-pipeline.ts
Local development
npm test # run the unit tests (Node's built-in test runner)
npm run typecheck # type-check with tsc
npm run dev # run the server directly (stdio)
Inspect the tool manually in a browser (no AI client needed):
npx @modelcontextprotocol/inspector npx tsx docs-pipeline.ts
Preview the docs site:
cd docs-site && npx mintlify dev
Releasing to npm
This repo keeps two READMEs: README.md (this one — the full story, shown on GitHub) and npm-readme.md (install-focused, shown on the npm page). npm always publishes the root README.md, so scripts/publish.mjs swaps npm-readme.md into place just for the publish, then restores README.md (the restore runs in a finally, so it happens even if publish fails).
npm version patch # 1.0.0 -> 1.0.1 (commit + tag)
npm run release # build, swap in the npm README, publish, restore
npm run release -- --dry-run # same, but `npm pack` instead of publish — inspect before shipping
Project structure
docs-pipeline.ts MCP server — registers the fetch_pr tool
github.ts fetchPr() logic + Zod input schema (pure, testable)
github.test.ts unit tests for fetchPr
doc-drafter/SKILL.md the Claude skill that orchestrates fetch -> write -> save
docs-site/ Mintlify docs site (docs.json + .mdx pages)
scripts/publish.mjs publish helper — swaps in npm-readme.md for the npm page
npm-readme.md install-focused README shown on npmjs.com
.env.example template for the required GITHUB_TOKEN
Status & roadmap
This is a working portfolio project, not a hosted service. Known limitations and next steps:
fetch_prreturns at most 30 files / 30 commits (GitHub’s default page size) — pagination (per_page/octokit.paginate) is a planned improvement.- An evaluation harness for the skill’s output lives under
evals/and is a work in progress. docs-site/ships with just the Mintlify config; pages are generated into it by the pipeline.
Tech stack
TypeScript · Model Context Protocol SDK · Octokit · Zod · Mintlify · Node’s built-in test runner