A Model Context Protocol (MCP) server implementation that integrates with gitingest for turning any Git repository into a simple text digest of its codebase.
Features
- Easy integration with AI assistants through the Model Context Protocol
- Git repository analysis and ingestion capabilities
- Support for filtering files by size, patterns, and branches
- Returns comprehensive repository information including summaries, file structure, and content
Usage
Configuration Options
Add the following configuration to your AI assistant s settings to enable gitingest-mcp as an MCP server:
PyPI Installation
{
"mcpServers": {
"gitingestmcp": {
"command": "uvx",
"args": ["gitingestmcp@latest"]
}
}
}
GitHub Installation
{
"mcpServers": {
"gitingestmcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/narumiruna/gitingest-mcp",
"gitingestmcp"
]
}
}
}
Local Installation
{
"mcpServers": {
"gitingestmcp": {
"command": "uv",
"args": [
"run",
"--directory",
"/home/<user>/workspace/gitingest-mcp",
"gitingestmcp"
]
}
}
}
API
The server provides the following tool:
ingest_git
Analyzes a Git repository and returns its content in a structured format.
Parameters:
source
: The URL of a Git repository or a local directory pathmax_file_size
(optional): Maximum allowed file size in bytes (default: 10MB)include_patterns
(optional): Pattern or set of patterns specifying files to include (e.g., "*.md, src/")exclude_patterns
(optional): Pattern or set of patterns specifying files to excludebranch
(optional): The branch to clone and analyze (default: "main")
Returns:
A string containing:
- Repository summary
- Tree-like structure of the files
- Content of the repository files
Resources
- gitingest website: https://gitingest.com/
- gitingest repository: https://github.com/cyclotruc/gitingest
License
See the LICENSE file for details.
[
{
"description": "This function analyzes a source (URL or local path), clones the corresponding repository (if applicable),and processes its files according to the specified query parameters.It can return a summary, a tree-like structure of the files, or the content of the files.",
"name": "ingest_git",
"parameters": {
"additionalProperties": false,
"properties": {
"branch": {
"default": "main",
"description": "The branch to clone and ingest.",
"title": "Branch",
"type": "string"
},
"exclude_patterns": {
"default": "",
"description": "Pattern or set of patterns specifying which files to exclude, e.q. *.md, src/",
"title": "Exclude Patterns",
"type": "string"
},
"include_patterns": {
"default": "",
"description": "Pattern or set of patterns specifying which files to include, e.q. *.md, src/",
"title": "Include Patterns",
"type": "string"
},
"max_file_size": {
"default": 10485760,
"description": "Maximum allowed file size for file ingestion.Files larger than this size are ignored, by default 10*1024*1024 (10 MB).",
"title": "Max File Size",
"type": "integer"
},
"source": {
"description": "The source to analyze, which can be a URL (for a Git repository) or a local directory path.",
"title": "Source",
"type": "string"
}
},
"required": [
"source"
],
"type": "object"
}
}
]