Skip to main content

Package for accessing package artifacts via MCP

Project description

MCP Pack

A tool for creating and managing documentation databases from GitHub repositories.

Quickstart to create a database

Start the Qdrant server:

docker compose up

With a Qdrant server running:

uvx mcp_pack create_db https://github.com/user/repo

To start a server for querying the documentation:

mcp_pack create_server --module-name your_module_name

see the examples/ folder for how to setup the MCP server.

Installation

# Install from pip
pip install mcp_pack

Prerequisites

  • Qdrant server running (by default at http://localhost:6333)
  • GitHub token (optional, but recommended to avoid rate limits)
  • OpenAI API key (optional, for summarizing Jupyter notebooks)

Usage

See example/ folder.

Create a documentation database

# Basic usage
mcp_pack create_db https://github.com/user/repo

# With @ prefix syntax
mcp_pack create_db @https://github.com/user/repo

# With additional options
mcp_pack create_db @https://github.com/user/repo \
    --output-dir ./output \
    --verbose \
    --include-notebooks \
    --include-rst \
    --github-token YOUR_GITHUB_TOKEN \
    --openai-api_key YOUR_OPENAI_API_KEY

Clean the database

# Delete all collections
mcp_pack clean_db

# Delete a specific collection
mcp_pack clean_db --collection repo-name

List Database Collections

To list all collections in the Qdrant database, use the following command:

# Use default Qdrant
mcp_pack list_db

# Use Custom Qdrant server URL 
mcp_pack list_db --qdrant-url http://localhost:6333

This will display all the collections currently stored in the Qdrant database.

Create and Run a Query Server

To create and run a server for querying module documentation:

# Basic usage with default settings
mcp_pack create_server --module-name your_module_name

# With custom settings
mcp_pack create_server --module-name your_module_name \
    --transport sse \
    --port 8080 \
    --qdrant-url http://your-qdrant-server:6333 \
    --encoder-model all-MiniLM-L6-v2 \
    --collection-name custom_collection

This will start a server that provides semantic search capabilities over your module's documentation.

Environment Variables

You can set environment variables instead of passing command-line arguments:

# Create a .env file
GITHUB_TOKEN=your_github_token
OPENAI_API_KEY=your_openai_api_key

Options

create_db

  • repo_url: GitHub repository URL (can be prefixed with @)
  • --output-dir, -o: Directory to save JSONL output
  • --verbose, -v: Verbose output
  • --include-notebooks: Include Jupyter notebooks
  • --include-rst: Include RST files
  • --exclude-tests: Exclude test files and directories
  • --module-name: Name of the module (defaults to repository name)
  • --db-path: Path to store the database
  • --qdrant-url: Qdrant server URL (default: http://localhost:6333)
  • --github-token: GitHub personal access token
  • --openai-api-key: OpenAI API key

clean_db

  • --qdrant-url: Qdrant server URL (default: http://localhost:6333)
  • --collection: Specific collection to delete (optional)

list_db

create_server

  • --module-name: Name of the module to query (required)
  • --qdrant-url: Qdrant server URL (default: http://localhost:6333)
  • --encoder-model: SentenceTransformer model to use (default: all-MiniLM-L6-v2)
  • --collection-name: Name of the Qdrant collection (defaults to module_name)
  • --transport: Transport method for the MCP server (default: stdio, choices: stdio, sse)
  • --port: Port number for the MCP server (default: 8000)

Global Options

  • --version: Show version information

Additional info

> python -m mcp_pack.create_db --help 
Create documentation database for a GitHub repository

positional arguments:
  repo_url              GitHub repository URL

options:
  -h, --help            show this help message and exit
  --output-dir OUTPUT_DIR, -o OUTPUT_DIR
                        Directory to save JSONL output
  --verbose, -v         Verbose output
  --include-notebooks   Include Jupyter notebooks
  --include-rst         Include rst files
  --db-path DB_PATH     Path to store the database
  --qdrant-url QDRANT_URL
                        Qdrant server URL
  --github-token GITHUB_TOKEN
                        GitHub personal access token
  --openai-api-key OPENAI_API_KEY
                        OpenAI API key
python -m mcp_pack.clean_db --help
Clean Qdrant database collections

options:
  -h, --help            show this help message and exit
  --qdrant-url QDRANT_URL
                        Qdrant server URL
  --collection COLLECTION
                        Specific collection to delete (optional, if not provided, all collections will be deleted)

Resources

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

mcp_pack-0.3.0.tar.gz (306.9 kB view details)

Uploaded Source

Built Distribution

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

mcp_pack-0.3.0-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file mcp_pack-0.3.0.tar.gz.

File metadata

  • Download URL: mcp_pack-0.3.0.tar.gz
  • Upload date:
  • Size: 306.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mcp_pack-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9a9242b1cd10f07744275832ebf2de4bd481c1be5b162eb853be9c81e5b26a62
MD5 5bdca886437df894a32fdab21e019932
BLAKE2b-256 e029c8495267cac8b1acc948235327d4ef3786a68cd4855c874be33879e31396

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_pack-0.3.0.tar.gz:

Publisher: publish_pypi.yml on krosenfeld-IDM/mcp-pack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_pack-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_pack-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mcp_pack-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d2743c849174d3740113d628bbca40c8468a723ea66e9ec625b027b5483b464
MD5 515262e4a9778c883705a016cb4e2a94
BLAKE2b-256 790ac4d1256d5a90ec8b79672ab214abd1a335484d70c4b865854ef21a4e0e04

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_pack-0.3.0-py3-none-any.whl:

Publisher: publish_pypi.yml on krosenfeld-IDM/mcp-pack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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