Fetches GitHub pull request and issue data including titles, descriptions, file changes, and diffs, then combines them with documentation templates for automated documentation generation.
Documentation MCP Server
A Model Context Protocol (MCP) server that provides GitHub PR/issue data along with a documentation guide for LLM-based documentation generation.
Overview
This MCP server is a data provider that:
Fetches GitHub PR and issue data server-side
Loads a static documentation template
Returns formatted context to the client LLM
Lets the client LLM generate the actual documentation
Runs as an HTTP service - can be deployed locally or remotely
Architecture Flow:
The server does NOT contain its own LLM - it aggregates data for the client's LLM to process.
Features
HTTP Transport: Uses StreamableHTTP for MCP communication
Stateless: Supports multiple concurrent clients without session conflicts
Remote Deployment: Run on a different machine from your MCP client
Single Tool:
writeDocumentation- aggregates GitHub data with documentation guideServer-Side Fetching: Automatically retrieves PR details, linked issues, and diffs
Static Template: Uses a fixed documentation guide loaded at startup
No LLM Calls: Returns raw context for the client LLM to process
Health Check: Built-in
/healthendpoint for monitoring
Quick Start
1. Install and Build
2. Set GitHub Token
Get your token at: https://github.com/settings/tokens
3. Start the Server
You should see:
Configuration
Environment Variables
Variable | Description | Default | Required |
| GitHub Personal Access Token | - | Yes |
| HTTP server port |
| No |
| HTTP server host |
| No |
Examples
Usage
Health Check
Test if the server is running:
MCP Client Configuration
Configure your MCP client to connect to the server:
For remote servers:
Tool: writeDocumentation
Input Parameters:
prUrl(string, optional): GitHub pull request URLissueUrl(string, optional): GitHub issue URLnotes(string, optional): Additional context or notes
At least one of prUrl or issueUrl is required.
Example Usage:
Output:
Returns a formatted prompt containing:
The documentation guide (structure, rules, required sections)
GitHub PR/issue data (title, description, files, diffs)
Any additional notes provided
Instructions for the client LLM to generate documentation
Deployment
Docker
Build and run:
Docker Compose
Process Manager (PM2)
Cloud Platforms
Deploy to Railway, Render, Fly.io, or any platform supporting Node.js:
Push your code to GitHub
Connect repository to platform
Set
GITHUB_TOKENenvironment variablePlatform will auto-deploy
Testing
Test with curl
Architecture
How It Works
Server Starts: Loads documentation guide, starts HTTP server
Client Connects: MCP client connects to
/mcpendpointTool Invocation: Client calls
writeDocumentationwith GitHub URLsData Fetching: Server fetches PR/issue data from GitHub API
Context Building: Server combines guide + GitHub data into formatted prompt
Response: Server returns complete context via HTTP
Generation: Client LLM generates documentation following the guide
Transport Details
Protocol: StreamableHTTP (MCP specification)
MCP Endpoint:
GET/POST /mcp- Main MCP communicationHealth Endpoint:
GET /health- Status checkCORS: Enabled for all origins (configure for production)
Session Mode: Stateless (supports multiple concurrent clients)
Security
For production deployment:
Configure CORS: Restrict allowed origins
Use HTTPS: Deploy behind reverse proxy (nginx, Caddy)
Rate Limiting: Add rate limiting middleware
Authentication: Add auth tokens if needed
GitHub Token: Keep secure, use environment variables
Network: Use firewall rules to restrict access
Troubleshooting
See TROUBLESHOOTING.md for detailed solutions.
Common issues:
"Server already initialized": Fixed in latest version (stateless mode)
Connection refused: Server not running or wrong port
CORS errors: Configure CORS for your client origin
GitHub rate limits: Use a GitHub token
Requirements
Node.js 18+
TypeScript 5+
GitHub token (optional, but recommended)
License
MIT