Skip to main content

An MCP server for gitingest

Project description

trelis-gitingest-mcp MCP server

An MCP server for gitingest that provides access to Git repository analysis through the Model Context Protocol (MCP). This server leverages the gitingest library to analyze Git repositories and make their content available in a format optimized for LLMs.

Overview

This MCP server provides a single unified tool for accessing Git repository data. It automatically handles repository ingestion as needed, so users can immediately query repository content without an explicit ingestion step.

Tool: gitingest

The server implements a single unified tool that handles all gitingest functionality:

Parameters

  • repo_uri: URL or local path to the Git repository (required)
  • resource_type: Type of data to retrieve (optional, default: "all")
    • "summary": Repository summary
    • "tree": File tree structure
    • "content": Repository content
    • "all": All of the above
  • max_file_size: Maximum file size in bytes (optional, default: 10MB)
  • include_patterns: Comma-separated patterns of files to include (optional). Note: These patterns only match files immediately in the specified paths, not nested files.
  • exclude_patterns: Comma-separated patterns of files to exclude (optional). Note: These patterns only match files immediately in the specified paths, not nested files.
  • branch: Specific branch to analyze (optional)
  • output: File path to save the output to (optional)

Automatic Ingestion and Simple Caching

The server will automatically ingest repositories on demand. You don't need to call a separate ingestion function before querying.

Results are cached in memory during the server's runtime, so subsequent requests for the same repository will be faster. However, the cache is cleared when the server restarts.

Once a repository is ingested, you can access its data either by calling the gitingest tool again or by using the resources interface.

Examples

Get everything for a repository:

{
  "repo_uri": "https://github.com/user/repo"
}

Get just the summary:

{
  "repo_uri": "https://github.com/user/repo",
  "resource_type": "summary"
}

Get the file tree:

{
  "repo_uri": "https://github.com/user/repo",
  "resource_type": "tree"
}

Get the full content:

{
  "repo_uri": "https://github.com/user/repo",
  "resource_type": "content"
}

Custom ingestion parameters:

{
  "repo_uri": "https://github.com/user/repo",
  "branch": "dev",
  "exclude_patterns": "*.md,tests/*",
  "max_file_size": 5242880
}

Using include patterns to focus on specific files:

{
  "repo_uri": "https://github.com/user/repo",
  "include_patterns": "src/*.py,bin/*"
}

Note: The patterns src/*.py and bin/* will only match Python files directly in the src directory and any files directly in the bin directory, not in subdirectories.

Save output to a file:

{
  "repo_uri": "https://github.com/user/repo",
  "resource_type": "all",
  "output": "/path/to/output/file.txt"
}

Configuration

Quickstart

Install

Claude Desktop

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

Development/Unpublished Servers Configuration

"mcpServers": {
  "trelis-gitingest-mcp": {
    "command": "uv",
    "args": [
      "--directory",
      "/Users/your-username/trelis-gitingest-mcp",
      "run",
      "trelis-gitingest-mcp"
    ]
  }
}

Published Servers Configuration

"mcpServers": {
  "trelis-gitingest-mcp": {
    "command": "uvx",
    "args": [
      "trelis-gitingest-mcp"
    ]
  }
}

Development

Building and Publishing

To prepare the package for distribution:

  1. Sync dependencies and update lockfile:
uv sync
  1. Build package distributions:
uv build

This will create source and wheel distributions in the dist/ directory.

  1. Publish to PyPI:
uv publish

Note: You'll need to set PyPI credentials via environment variables or command flags:

  • Token: --token or UV_PUBLISH_TOKEN
  • Or username/password: --username/UV_PUBLISH_USERNAME and --password/UV_PUBLISH_PASSWORD

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.

You can launch the MCP Inspector via npm with this command:

npx @modelcontextprotocol/inspector uv --directory /Users/your-username/trelis-gitingest-mcp run trelis-gitingest-mcp

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

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

trelis_gitingest_mcp-0.1.1.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

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

trelis_gitingest_mcp-0.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file trelis_gitingest_mcp-0.1.1.tar.gz.

File metadata

File hashes

Hashes for trelis_gitingest_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0c9d6ed30133fb607d53c232697a4c038ab90b0cd9585f84bce03fa2659fcbef
MD5 6913a0efc423478717c0195aabae3d8b
BLAKE2b-256 9cb223a748ada2fca194bc7a28113d4cf09fb3bc641f12a4cab806999059105a

See more details on using hashes here.

File details

Details for the file trelis_gitingest_mcp-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for trelis_gitingest_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5fc050ec36f633846f5fd27f806f2a288e1c48ec533403428e13e4dd85138468
MD5 d6f83a9477220cbcd46779d81c957c3d
BLAKE2b-256 077f8130bddff3f5855309e6383cc7e8afa9eede9b50bf4e349ee4dcbdc020de

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