GI

GitMCP MCP Server for GitHub Repositories and Documentation

Connect any GitHub repository or project documentation effortlessly with the GitMCP MCP server to sync and serve docs instantly.

Quick Install
npx -y @idosal/git-mcp

Overview

GitMCP MCP Server is a lightweight server that connects GitHub repositories and project documentation to the Model Context Protocol (MCP) ecosystem. It scans repository files, converts documentation into MCP-compatible manifests and content endpoints, and exposes those resources so retrieval-augmented models or documentation tooling can fetch up-to-date context directly from the source code and docs.

This server is useful when you need to keep model context in sync with repository documentation or to provide a standardized HTTP interface for doc retrieval. By wiring GitHub repositories (or local docs) to MCP endpoints, you can automate updates via webhooks, serve manifests for indexing, and make repo content consumable by downstream tools without manual publishing steps.

Features

  • Sync content directly from GitHub repositories or local documentation folders
  • Serve MCP-compatible manifest and chunked content endpoints
  • Support for webhook-driven updates to keep content fresh
  • Configurable filters and path mappings (include/exclude patterns)
  • Authentication support for private repositories (GitHub token)
  • Docker-friendly and suitable for deployment in CI/CD pipelines
  • Simple HTTP API for retrieval and status monitoring

Installation / Configuration

The server can be run via a Docker image or as a local binary/service. Below are example approaches and a sample configuration file you can adapt.

Run via Docker (example):

docker run -p 8080:8080 \
  -e GITHUB_TOKEN=ghp_xxx \
  -v /path/to/config.yml:/app/config.yml \
  idosal/git-mcp:latest

Run from source (example; language/runtime-agnostic):

  1. Clone the repo:
git clone https://github.com/idosal/git-mcp.git
cd git-mcp
  1. Install dependencies / build (replace with actual build steps for your environment):
# example: Node
npm install
npm run build
npm start -- --config=config.yml

Sample config.yml:

server:
  host: 0.0.0.0
  port: 8080

sources:
  - type: github
    owner: my-org
    repo: my-repo
    branch: main
    docs_path: docs
    include:
      - "**/*.md"
    exclude:
      - "docs/drafts/**"

auth:
  github_token_env: GITHUB_TOKEN

webhooks:
  enabled: true
  secret: your-webhook-secret

Configuration reference (common keys):

KeyDescription
server.hostHost/interface to bind
server.portHTTP port
sourcesList of repositories or local sources to index
sources.type“github” or “local”
sources.owner/repoGitHub repository identifier
sources.branchBranch to sync (default: main)
sources.docs_pathPath within the repo to index
include/excludeGlob patterns to filter files
auth.github_token_envEnvironment variable holding a GitHub token
webhooks.enabledWhether to accept GitHub webhooks
webhooks.secretSecret for validating webhook payloads

Available Resources

The MCP server exposes HTTP endpoints that mirror standard MCP concepts. Typical endpoints:

  • GET /mcp/manifest/:repo
    • Returns an MCP manifest for the given repository or source.
  • GET /mcp/content/:repo/:chunk_id
    • Fetch a chunk of indexed content (text or metadata).
  • POST /mcp/refresh/:repo
    • Trigger a manual refresh of a repo (requires auth).
  • POST /webhook/github
    • Receives GitHub webhook events to trigger updates.

Example: fetch a manifest with curl

curl -s https://your-gitmcp.example.com/mcp/manifest/my-repo | jq .

Authentication and access control can be configured for private endpoints. OAuth or token-based headers are commonly used for protected refresh or admin endpoints.

Use Cases

  • LLM retrieval augmentation: Keep model context current by serving the latest docs and README content as MCP manifests and chunks. The model can request relevant chunks at inference time.
  • Documentation search and QA: Index a repo’s docs and expose chunked content so search or QA systems can retrieve precise passages, enabling accurate answers grounded in the repo.
  • CI documentation previews: Use webhooks to auto-refresh MCP content on pull requests so reviewers and bots can access up-to-date generated context without manual publishing.
  • Multi-repo aggregation: Aggregate multiple repositories into a single MCP endpoint for cross-repo context (monorepos, microservices documentation).
  • Private repo integration: Serve private documentation to internal models by configuring a GitHub token and hosting the MCP server inside your network.

Getting Help and Contributing

  • Repository: https://github.com/idosal/git-mcp
  • Common contribution tasks: improving file parsing rules, adding new source types, improving webhook handling, or adding authentication adapters.
  • When opening issues, include the config.yml, server logs, and a short description of the source repository and expected behavior.

This documentation provides the essentials to get started with GitMCP. Adapt the configuration for your environment, secure webhook and admin endpoints, and integrate the MCP endpoints into your retrieval or documentation tooling.