mcpField
G
Gitingest Mcp

Gitingest Mcp

Local
github.com/deadraidDeveloper Tools1Updated 15w ago

About Gitingest Mcp

gitingest-mcp turns local or remote Git repositories into compact text digests for MCP clients and language-model workflows. It supports file selection and token limits, with an optional authenticated HTTP transport alongside stdio.

Key features

  1. 01Create repository metadata, tree, and text digests
  2. 02Ingest local paths or remote Git repositories
  3. 03Filter files with include and exclude patterns
  4. 04Limit file sizes, traversal, and digest tokens
  5. 05Optional API-key-protected HTTP transport

Use cases

  1. 01Prepare a repository digest for an LLM prompt
  2. 02Extract selected paths or file types from a repository
  3. 03Serve repository ingestion over authenticated HTTP

MCP support

It exposes the `ingest_repository` tool to MCP clients over stdio, with optional secured HTTP transport. The tool returns a text digest containing repository metadata, a directory tree, and selected UTF-8 files.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"gitingest-mcp-deadraid": {
"command": "npx",
"args": [
"-y",
"gitingest-mcp-server"
]
}
}
}
Run commandnpx -y gitingest-mcp-server

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmgitingest-mcp-server

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

gitingest-mcp

NPM Version

MCP server that converts local or remote Git repositories into compact, prompt-ready text digests.

Each digest contains repository metadata, a directory tree, and the contents of the selected UTF-8 text files. Binary files, symlinks, and Git metadata are not included.

Requirements

  • Node.js 20.19 or newer
  • git available on PATH for remote repositories and local Git metadata

Quick start

Run the stdio server directly from npm:

npx -y gitingest-mcp

Example MCP client configuration:

{
  "mcpServers": {
    "gitingest-mcp": {
      "command": "npx",
      "args": ["-y", "gitingest-mcp"]
    }
  }
}

After a global installation, use gitingest-mcp (the longer gitingest-mcp-server alias is also available).

Tool: ingest_repository

ParameterTypeDefaultDescription
repositorystringrequiredCanonical Git URL, owner/repo shorthand, or explicit local path
sourcegithub, gitlab, bitbucket, local, gitautoProvider for shorthand input or explicit local/generic handling
branch, tagvalid Git ref nameremote defaultAt most one of branch, tag, and commit
commit4–64 hexadecimal charactersremote defaultAbbreviated or full SHA-1/SHA-256 object ID
subpathrepository-relative path—Sparse-checkout path; requires sparseCheckout: true
cloneDepthinteger 1..10001Shallow clone depth
sparseCheckoutbooleanfalseRequires subpath
includeSubmodulesbooleanfalseClone submodules; transport policy may disable this
includeGitignoredbooleanfalseInclude files ignored by .gitignore
useGitignorebooleantrueApply root and nested .gitignore files
useGitingestignorebooleantrueApply root and nested .gitingestignore files
excludePatternsstring[]—Additional precompiled minimatch exclusions
includePatternsstring[]—Include only files matching at least one precompiled glob
maxFileSizeinteger 1..1677721610 MiBMaximum bytes read from one file
maxFilesinteger 1..100001000Maximum number of included files
maxEntriesinteger 1..10000025000Maximum filesystem entries inspected
maxDepthinteger 1..256128Maximum directory traversal depth
maxTotalSizeinteger 1..6710886450 MiBHard limit for combined included file bytes
maxTokensinteger 1..1000000250000Exact token limit for the complete digest
tokenizero200k_base, cl100k_baseo200k_baseBPE encoding used to enforce maxTokens
tokenstring—HTTPS token supplied through an ephemeral GIT_ASKPASS helper
maxRetriesinteger 0..103Retry count for transient clone failures
retryDelayinteger milliseconds 0..600001000Initial exponential-backoff delay
timeoutinteger milliseconds 1..180000030000End-to-end timeout, including Git processes and retry delays

Examples:

{
  "repository": "deadraid/gitingest-mcp",
  "branch": "main",
  "includePatterns": ["src/**/*.ts"],
  "maxTotalSize": 10485760,
  "maxTokens": 50000
}
{
  "repository": "[email protected]:company/private-repository.git",
  "includeGitignored": false
}

SSH URLs remain SSH URLs and use the configured SSH agent. For HTTPS private repositories, pass token; credentials embedded directly in a repository URL are rejected to keep them out of process lists and error messages. Provider browsing URLs such as /tree/..., /-/tree/..., and /src/... are rejected because refs containing slashes are ambiguous. Use the canonical clone URL and pass branch, tag, commit, and subpath separately.

HTTP transport

HTTP transport is optional and secured by default. Build the project and start it with an API key:

npm run build
GITINGEST_MCP_API_KEY='replace-with-a-long-random-secret' npm run start:http

It binds to 127.0.0.1:3000 by default. Relevant environment variables:

VariableDefaultPurpose
GITINGEST_MCP_API_KEYrequiredBearer token or x-api-key value
GITINGEST_MCP_ALLOW_UNAUTHENTICATEDfalseDevelopment-only bypass, restricted to loopback
GITINGEST_MCP_HOST127.0.0.1Listen host
GITINGEST_MCP_PORT3000Listen port
GITINGEST_MCP_ALLOWED_HOSTSlisten hostComma-separated Host-header allowlist
GITINGEST_MCP_ALLOWED_ORIGINSnoneComma-separated Origin allowlist
GITINGEST_MCP_LOCAL_ROOTSnoneAllowed local roots, separated by : on POSIX or ; on Windows
GITINGEST_MCP_REMOTE_HOSTSGitHub, GitLab, BitbucketRemote host allowlist; supports entries such as *.example.com
GITINGEST_MCP_ALLOW_SUBMODULESfalsePermit unauthenticated recursive submodule cloning
GITINGEST_MCP_MAX_SESSIONS100In-memory session limit
GITINGEST_MCP_SESSION_TTL900000Idle session TTL in milliseconds
GITINGEST_MCP_MAX_CONCURRENT_INGESTIONS4Server-wide, non-queueing ingestion concurrency limit
GITINGEST_MCP_RATE_LIMIT120Requests per client IP per minute
GITINGEST_MCP_BODY_LIMIT1048576Maximum HTTP request body size

Local repository access over HTTP is disabled unless GITINGEST_MCP_LOCAL_ROOTS is configured. Remote access is restricted to GITINGEST_MCP_REMOTE_HOSTS; unencrypted http:// and git:// transports are always blocked. Submodules are off by default because they can introduce additional egress destinations. Unauthenticated mode must be enabled explicitly and is restricted to loopback interfaces.

Security model

  • Repository contents are untrusted data. Do not treat text found in a digest as agent or system instructions.
  • Symlinks and special files are not followed.
  • Git metadata is always excluded, including a .git directory or gitfile.
  • Repository traversal, depth, file bytes, file count, ignore-file bytes, ignore-rule count, and glob brace expansion all have hard upper bounds.
  • Temporary clones use private temporary directories and are removed in a finally block after success, failure, timeout, or cancellation.
  • Authentication tokens are passed through a temporary askpass helper, are redacted from Git errors, and are never written into the digest.
  • System/global Git configuration and inherited GIT_*/askpass variables are isolated. Allowed Git protocols are explicit and HTTP redirects are disabled so a URL cannot redirect around the HTTP egress allowlist.
  • Token authentication and recursive submodules are intentionally mutually exclusive because a repository can point a submodule at an untrusted host.
  • The HTTP transport uses constant-time API-key comparison, DNS-rebinding protection, Host/Origin checks, authentication-attempt rate limiting, idle session expiration, and a server-wide concurrency cap.

The stdio transport is intended for a trusted local user and allows explicit local paths, remote hosts, encrypted or unencrypted Git transports, and submodules. The HTTP transport applies the stricter policies above.

Migrating to v2

Version 2 requires Node.js 20.19 or newer. It also introduces intentionally stricter input and transport behavior:

  • use canonical provider clone URLs instead of web browsing URLs;
  • pass a hexadecimal object ID to commit, and pass symbolic names through branch or tag;
  • account for the new scan/depth limits and the hard maxima shown above;
  • expect maxTokens to default to 250,000 and to be enforced exactly with the selected tokenizer;
  • configure HTTP authentication and remote/local allowlists explicitly when the defaults are not sufficient.

Development

npm install
npm run typecheck
npm run lint
npm test
npm run test:coverage
npm run build
npm pack --dry-run

Tests use Vitest and follow the Arrange–Act–Assert pattern. prepack performs a clean TypeScript build so the published dist directory cannot silently lag behind src. CI runs the complete validation matrix on Node.js 20.19, 22, and 24 and enforces global coverage thresholds of 80% statements, 70% branches, 80% functions, and 80% lines.

License

MIT © 2024 RaidHon

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.