Skip to main content

GitScribe: Web Scraping RAG MCP Server for Git-based Documentation

Project description

GitScribe ๐Ÿ“œ

Scribing knowledge from the Git universe

GitScribe is a powerful Model Context Protocol (MCP) server that enables intelligent web scraping of Git-based documentation with Retrieval Augmented Generation (RAG) capabilities. This tool helps code assistants and developers efficiently extract, process, and retrieve information from documentation websites, GitHub repositories, and other Git-based resources to accelerate application development.

โœจ Features

  • ๐ŸŒ Universal Git Support: Works with GitHub, GitLab, Bitbucket, and Azure DevOps
  • ๐Ÿง  Intelligent RAG System: ChromaDB + Sentence Transformers for semantic search
  • ๐Ÿ“„ Multi-Format Parsing: Markdown, HTML, reStructuredText, and source code files
  • โšก High Performance: Async scraping with intelligent rate limiting
  • ๐Ÿ”ง MCP Integration: Full Model Context Protocol compliance for AI assistants
  • ๐Ÿ“Š Rich CLI: Command-line interface for testing and management
  • ๐ŸŽฏ Smart Filtering: Automatic content filtering and relevance scoring

๐Ÿš€ Quick Start

Installation

# Install from PyPI (recommended)
pip install gitscribe-mcp

# Or install with uv (recommended for development)
uv sync

# Or install with pip for development
pip install -e .

# Or install dependencies manually
pip install -r requirements-gitscribe.txt

Basic Usage

1. Start the MCP Server

# Start the server for use with AI assistants
gitscribe server

# Or run directly with uv
uv run gitscribe server

2. Scrape Documentation

# Scrape Python documentation
gitscribe scrape https://docs.python.org --depth 2 --output python_docs.json

# Scrape a GitHub repository
gitscribe scrape https://github.com/microsoft/vscode --formats md html rst

3. Index Documents

# Index scraped documents into the RAG system
gitscribe index python_docs.json

4. Search Documentation

# Search indexed documentation
gitscribe search "async await python examples"
gitscribe search "VSCode extension API" --limit 5

5. Analyze Repositories

# Get repository information and structure
gitscribe repo-info https://github.com/microsoft/vscode

๐Ÿ“‹ MCP Tools

GitScribe provides the following MCP tools:

scrape_documentation

Scrape and index documentation from a Git repository or website.

Parameters:

  • url (string, required): Repository or documentation URL
  • depth (integer, optional): Maximum crawling depth (default: 3)
  • formats (array, optional): Supported document formats

search_documentation

Search indexed documentation using semantic search.

Parameters:

  • query (string, required): Natural language search query
  • limit (integer, optional): Maximum number of results (default: 10)
  • filter (object, optional): Filter criteria (language, framework, etc.)

get_code_examples

Extract code examples related to a specific topic.

Parameters:

  • topic (string, required): Programming topic or concept
  • language (string, optional): Programming language filter
  • framework (string, optional): Framework or library filter

๐Ÿ› ๏ธ Configuration

GitScribe can be configured through environment variables:

# Server settings
export GITSCRIBE_DEBUG=true
export GITSCRIBE_MAX_DEPTH=3
export GITSCRIBE_MAX_PAGES=100

# RAG system settings
export GITSCRIBE_EMBEDDING_MODEL="sentence-transformers/all-MiniLM-L6-v2"
export GITSCRIBE_CHUNK_SIZE=1000
export GITSCRIBE_CHROMA_DIR="./chroma_db"

# Rate limiting
export GITSCRIBE_REQUEST_DELAY=1.0
export GITSCRIBE_CONCURRENT_REQUESTS=5

# Git platform authentication (optional)
export GITHUB_TOKEN="your_github_token"
export GITLAB_TOKEN="your_gitlab_token"

๐Ÿ“– Claude Desktop Integration

Install

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

Development Configuration

{
  "mcpServers": {
    "gitscribe": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/your/gitscribe",
        "run",
        "gitscribe",
        "server"
      ],
      "env": {
        "GITSCRIBE_DEBUG": "false"
      }
    }
  }
}

Published Server Configuration

{
  "mcpServers": {
    "gitscribe": {
      "command": "uvx",
      "args": ["gitscribe", "server"]
    }
  }
}

๐Ÿงช Development

Building and Publishing

  1. Sync dependencies:
uv sync
  1. Build package:
uv build
  1. Publish to PyPI:
uv publish

Debugging

Use the MCP Inspector for debugging:

npx @modelcontextprotocol/inspector uv --directory /path/to/gitscribe run gitscribe server

Testing

# Run all tests
uv run pytest

# Run with coverage
uv run pytest --cov=gitscribe

# Run specific tests
uv run pytest tests/test_scraper.py

๐Ÿ“š Supported Formats

  • Documentation: Markdown (.md), HTML (.html), reStructuredText (.rst)
  • Code Files: Python (.py), JavaScript (.js), TypeScript (.ts), Java (.java), C++ (.cpp), Go (.go), Rust (.rs)
  • Configuration: JSON, YAML, TOML
  • Web Content: Dynamic HTML pages, static sites

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   MCP Client    โ”‚โ”€โ”€โ”€โ–ถโ”‚   MCP Server    โ”‚โ”€โ”€โ”€โ–ถโ”‚  Web Scraper    โ”‚
โ”‚ (Code Assistant)โ”‚    โ”‚   (GitScribe)   โ”‚    โ”‚ (Beautiful Soup)โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ”‚
                                โ–ผ
                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                       โ”‚   RAG System    โ”‚
                       โ”‚  - ChromaDB     โ”‚
                       โ”‚  - Embeddings   โ”‚
                       โ”‚  - Search       โ”‚
                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“„ License

This project is licensed under the MIT License.

๐Ÿ™ Acknowledgments


GitScribe - Making documentation accessible to AI assistants, one commit at a time! ๐Ÿš€

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitscribe_mcp-1.0.0.tar.gz (318.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitscribe_mcp-1.0.0-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file gitscribe_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: gitscribe_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 318.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gitscribe_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 39a789c565cdc99b4c8c6bc2ea009aad85400813d5071882c833cfc2cc78f677
MD5 d7e0b059ce59f91dfa9fd472ad9d09c6
BLAKE2b-256 71f5cd3af661d75a99cd7e0c36d6891c8a0e8fa1e1ca9a0ad71acd457eff3c0c

See more details on using hashes here.

File details

Details for the file gitscribe_mcp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gitscribe_mcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gitscribe_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e1a5412f5cbe1560257b37423b03ad0cef319cc58ae97bf7173c2f85437ca52
MD5 366ed25635fb67b392d9b65ddee1932b
BLAKE2b-256 3a24ce6445f4857f7132cd29bf593252f0bc0e50ac5275ed3e557d156ef777dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page