Gitingest 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.
[!WARNING] Private repo support in gitingest is not yet on PyPI as of June 25th 2025. Once that is pushed, this MCP will automatically support it.
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 provides a single tool called gitingest that can be used to analyze Git repositories. The tool accepts the following parameters:
repo_uri(required): URL or local path to the Git repositoryresource_type: Type of data to retrieve (summary,tree,content, orall). Default issummary.max_file_size: Maximum file size in bytes to include in the analysis. Default is 10MB.include_patterns: Comma-separated patterns of files to include in the analysis.exclude_patterns: Comma-separated patterns of files to exclude from the analysis.branch: Specific branch to analyze.output: File path to save the output to.max_tokens: Truncates the response to a specified number of tokens.
Accessing Private Repositories
You can ingest private GitHub repositories by providing a GitHub Personal Access Token (PAT).
Recommended: Set an Environment Variable in your MCP Config
This is the best approach for persistent configuration. Add an env block to your server definition in your MCP configuration file. The gitingest library will automatically use the GITHUB_TOKEN environment variable.
"mcpServers": {
"trelis-gitingest-mcp": {
"command": "uvx",
"args": [
"trelis-gitingest-mcp"
],
"env": {
"GITHUB_TOKEN": "github_pat_..."
}
}
}
Resource Types and Large Repositories
For large repositories, it's recommended to first request only the summary (which is the default). After ingestion, you can access more detailed information through the resources:
- Use the
treeresource to explore the repository structure - Use the
contentresource to access the full content (if not too large)
If the repository is too large, consider using include_patterns and/or exclude_patterns to limit the scope of the ingestion.
Accessing Resources After a Tool Call
After you call the gitingest tool for a repository, the server defines resources for that repository:
- Summary: A high-level summary of the repository
- Tree: The file/directory structure
- Content: The full content (subject to size limits)
These resources can be accessed individually via the resources interface in any MCP-compatible client. This is useful for browsing or fetching specific aspects of a repository after ingestion.
MCP Server Configuration
To use this MCP server from PyPI, add the following to your MCP config:
"mcpServers": {
"trelis-gitingest-mcp": {
"command": "uvx",
"args": [
"trelis-gitingest-mcp"
]
}
}
To run directly from the GitHub repository:
"mcpServers": {
"trelis-gitingest-mcp": {
"command": "uvx",
"args": [
"git+https://github.com/TrelisResearch/trelis-gitingest-mcp"
]
}
}
Development
Building and Publishing
To prepare the package for distribution:
- Sync dependencies and update lockfile:
uv sync - Build package distributions:
uv build - Publish to PyPI:
uv publish
Debugging
The best way to debug MCP servers is with the MCP Inspector.
You can launch the Inspector with your local server using this command:
npx @modelcontextprotocol/inspector uv --directory /Users/RonanMcGovern/TR/trelis-gitingest-mcp run trelis-gitingest-mcp
or using uvx for the mcp server:
npx @modelcontextprotocol/inspector uvx https://github.com/TrelisResearch/trelis-gitingest-mcp.git
or using the PyPI package:
npx @modelcontextprotocol/inspector uvx trelis-gitingest-mcp
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
Metadata
Release files for trelis-gitingest-mcp 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| trelis_gitingest_mcp-1.1.2.tar.gz | 27.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| trelis_gitingest_mcp-1.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.2 kB
Release files / trelis_gitingest_mcp-1.1.2.tar.gz
| Download URL | trelis_gitingest_mcp-1.1.2.tar.gz |
|---|---|
| Size | 27.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64ea06d272f4f979f23943e8e2ab064d88b300fcd210252bf5e487129e079b37
|
|
BLAKE2b-256 checksum How to use checksums |
2e96970ba1eb0ea560e6bbe8d9c2e8a8bfb576c5ca6179f1d44b3001dbef4278
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.7
|
Release files / trelis_gitingest_mcp-1.1.2-py3-none-any.whl
| Download URL | trelis_gitingest_mcp-1.1.2-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c53246c7f32efad500731edfce1bd14771662b5fa9b4eb10cf3631fab7bbbfe3
|
|
BLAKE2b-256 checksum How to use checksums |
fbcb02641178e90d8b97d7a87b219686ba6815e0b8c44adc8c77054e8486c9d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.7
|
Security for trelis-gitingest-mcp 1.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.