Sign inSign up

mekayelanik/gitnexus-mcp

By mekayelanik

•Updated 20 days ago

Image
Machine learning & AI
Developer tools
Web analytics
0

10K+

mekayelanik/gitnexus-mcp repository overview

⁠GitNexus MCP Server

⁠Multi-Architecture Docker Image for Distributed Deployment

Disclaimer: This is an unofficial Docker image. GitNexus is developed by Abhigyan Patwari / Akon Labs⁠ under the PolyForm Noncommercial License 1.0.0⁠. Docker packaging independently maintained by Mohammad Mekayel Anik⁠ under GPL v3.


⁠Table of Contents


⁠Buy Me a Coffee

If you found value in this project, you can buy me a coffee to keep me inspired.

Buy Me A Coffee ⁠

⁠Overview

GitNexus⁠ is a code intelligence MCP server: knowledge graph (LadybugDB), Tree-sitter indexing, embeddings, wiki docs, AI code search. Packaged with HAProxy + mcp-proxy bridge — API key auth, CORS, HTTP/1.1, HTTP/2, HTTP/3 (QUIC).

⁠Key Features
  • Multi-Architecture - Native x86-64 and ARM64
  • Modern MCP Bridge - mcp-proxy⁠ stdio↔SHTTP/SSE; stateful, no spawn-per-request leak
  • Auto-Analysis - Indexes all repos in the data directory on startup
  • Self-Hosted Web UI - Built-in interface on the same port as MCP
  • Wiki Generation - AI-powered wiki via OpenAI, Ollama, vLLM, or compatible API
  • Secure by Design - API key auth, CORS, TLS termination, security headers
  • High Performance - ZSTD compression for faster deployments

⁠Supported Architectures

ArchitectureTag PrefixStatus
x86-64amd64-<version>Stable
ARM64arm64v8-<version>Stable

Multi-arch images automatically select the correct architecture for your system.


⁠Available Tags

TagStabilityDescriptionUse Case
latestProductionLatest stable releaseRecommended for production
1.6.12ProductionSpecific versionVersion pinning for consistency
⁠System Requirements
  • Docker Engine: 23.0+
  • RAM: 1GB min (2GB+ for embeddings)
  • CPU: Single core (multi-core recommended)
  • GPU: Optional NVIDIA for embeddings (see GPU Support⁠)
  • Storage: Depends on repo sizes

CRITICAL: Do NOT expose directly to the internet without a reverse proxy, SSL/TLS, auth, and firewall.


⁠Quick Start

services:
  gitnexus-mcp:
    image: mekayelanik/gitnexus-mcp:latest
    container_name: gitnexus-mcp
    restart: unless-stopped
    ports:
      - "8010:8010"   # MCP + Web UI + API (all via HAProxy)
    volumes:
      - /path/to/your/repos:/data:rw
      - gitnexus-registry:/home/node/.gitnexus   # Persist index registry
      - gitnexus-cache:/home/node/.cache          # Persist embedding models
    environment:
      - PORT=8010
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Dhaka
      - NODE_ENV=production
      - PROTOCOL=SHTTP
      - ENABLE_HTTPS=false
      - HTTP_VERSION_MODE=auto
      # GitNexus Analysis Options
      - DATA_DIR=/data
      - ANALYZE_FORCE=false
      - ANALYZE_VERBOSE=false
      # Optional: require Bearer token auth at HAProxy layer
      # - API_KEY=replace-with-strong-secret
      # Optional: Wiki generation (requires LLM API key)
      # - WIKI_ENABLED=true
      # - OPENAI_API_KEY=sk-...
      # - WIKI_MODEL=gpt-4o
    hostname: gitnexus-mcp
    domainname: local

volumes:
  gitnexus-registry:
    driver: local
  gitnexus-cache:
    driver: local

Deploy:

docker compose up -d
docker compose logs -f gitnexus-mcp
⁠Docker CLI
docker volume create gitnexus-registry && docker volume create gitnexus-cache
docker run -d \
  --name=gitnexus-mcp \
  --restart=unless-stopped \
  -p 8010:8010 \
  -v /path/to/your/repos:/data:rw \
  -v gitnexus-registry:/home/node/.gitnexus \
  -v gitnexus-cache:/home/node/.cache \
  -e PORT=8010 \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Asia/Dhaka \
  -e NODE_ENV=production \
  -e PROTOCOL=SHTTP \
  -e ENABLE_HTTPS=false \
  -e HTTP_VERSION_MODE=auto \
  -e DATA_DIR=/data \
  mekayelanik/gitnexus-mcp:latest
services:
  gitnexus-mcp:
    image: mekayelanik/gitnexus-mcp:latest
    container_name: gitnexus-mcp
    restart: unless-stopped
    ports:
      - "8010:8010"   # MCP + Web UI + API (all via HAProxy)
    volumes:
      - /path/to/your/repos:/data:rw
      - gitnexus-registry:/home/node/.gitnexus   # Persist index registry
      - gitnexus-cache:/home/node/.cache          # Persist embedding models
      - /path/to/certs:/etc/haproxy/certs:ro      # TLS certificates
      # GPU: mount host CUDA libs (remove if no GPU)
      - /usr/local/cuda/lib64:/usr/local/cuda/lib64:ro
    environment:
      # Core
      - PORT=8010
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Dhaka
      - NODE_ENV=production
      # MCP Transport (SHTTP, SSE, or WS)
      - PROTOCOL=SHTTP
      # Security
      - API_KEY=replace-with-a-strong-secret
      - CORS=*
      - ENABLE_HTTPS=true
      - TLS_CERT_PATH=/etc/haproxy/certs/server.crt
      - TLS_KEY_PATH=/etc/haproxy/certs/server.key
      - TLS_MIN_VERSION=TLSv1.3
      - HTTP_VERSION_MODE=auto
      # Repository Analysis
      - DATA_DIR=/data
      - ANALYZE_FORCE=false
      - ANALYZE_SKILLS=true
      - ANALYZE_EMBEDDINGS=true
      - ANALYZE_VERBOSE=false
      # Wiki Generation
      - WIKI_ENABLED=true
      - OPENAI_API_KEY=sk-your-key-here
      - WIKI_MODEL=gpt-4o-mini
      # Web UI
      - ENABLE_WEB_UI=true
    # NVIDIA GPU (optional — remove if no GPU)
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu, compute, utility]
    hostname: gitnexus-mcp
    domainname: local

volumes:
  gitnexus-registry:
    driver: local
  gitnexus-cache:
    driver: local
docker volume create gitnexus-registry && docker volume create gitnexus-cache
docker run -d \
  --name=gitnexus-mcp \
  --restart=unless-stopped \
  --gpus all \
  -p 8010:8010 \
  -v /path/to/your/repos:/data:rw \
  -v gitnexus-registry:/home/node/.gitnexus \
  -v gitnexus-cache:/home/node/.cache \
  -v /path/to/certs:/etc/haproxy/certs:ro \
  -v /usr/local/cuda/lib64:/usr/local/cuda/lib64:ro \
  -e PORT=8010 \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Asia/Dhaka \
  -e NODE_ENV=production \
  -e PROTOCOL=SHTTP \
  -e API_KEY=replace-with-a-strong-secret \
  -e CORS='*' \
  -e ENABLE_HTTPS=true \
  -e TLS_CERT_PATH=/etc/haproxy/certs/server.crt \
  -e TLS_KEY_PATH=/etc/haproxy/certs/server.key \
  -e HTTP_VERSION_MODE=auto \
  -e DATA_DIR=/data \
  -e ANALYZE_SKILLS=true \
  -e ANALYZE_EMBEDDINGS=true \
  -e WIKI_ENABLED=true \
  -e OPENAI_API_KEY=sk-your-key-here \
  -e WIKI_MODEL=gpt-4o-mini \
  mekayelanik/gitnexus-mcp:latest
⁠Local Ollama + GitNexus (Docker Compose)
services:
  gitnexus-mcp:
    image: mekayelanik/gitnexus-mcp:latest
    container_name: gitnexus-mcp
    restart: unless-stopped
    ports:
      - "8010:8010"
    volumes:
      - /path/to/your/repos:/data:rw
      - gitnexus-registry:/home/node/.gitnexus   # Persist index registry
      - gitnexus-cache:/home/node/.cache          # Persist embedding models
    environment:
      - PORT=8010
      - PROTOCOL=SHTTP
      - ENABLE_HTTPS=false
      - DATA_DIR=/data
      - ANALYZE_VERBOSE=false
      # Wiki via local Ollama
      - WIKI_ENABLED=true
      - WIKI_BASE_URL=http://ollama:11434/v1
      - WIKI_MODEL=llama3
      - OPENAI_API_KEY=not-needed

  ollama:
    image: ollama/ollama:latest
    container_name: ollama
    restart: unless-stopped
    volumes:
      - ollama-data:/root/.ollama
    # Uncomment for GPU
    # deploy:
    #   resources:
    #     reservations:
    #       devices:
    #         - driver: nvidia
    #           count: all
    #           capabilities: [compute, utility]

volumes:
  gitnexus-registry:
    driver: local
  gitnexus-cache:
    driver: local
  ollama-data:
⁠Access Endpoints

All services are accessible on a single port (default 8010) via HAProxy:

ServiceEndpointDescription
Web UIhttp://host-ip:8010/GitNexus web interface
MCP (SHTTP)http://host-ip:8010/mcpStreamable HTTP (recommended)
MCP (SSE)http://host-ip:8010/sseServer-Sent Events
REST APIhttp://host-ip:8010/api/*REST API (repos, search, graph)
Healthhttp://host-ip:8010/healthzHealth check

With ENABLE_HTTPS=true, use TLS endpoints:

ServiceEndpoint
Web UIhttps://host-ip:8010/
MCP (SHTTP)https://host-ip:8010/mcp
MCP (SSE)https://host-ip:8010/sse

Single-Port Architecture: HAProxy routes /mcp,/sse→mcp-proxy, /api/*→GitNexus API, /*→web UI; /healthz answered locally. Set ENABLE_WEB_UI=false for MCP-only.

Smart Healthcheck: Reports healthy during analysis/wiki phases to avoid false unhealthy status.

Security Warning: Defaults to HTTP. Use ENABLE_HTTPS=true with own certs for production. See CERTIFICATE_SETUP_GUIDE.md⁠. ARM devices: allow 60-120s for init.


⁠Configuration

⁠Volumes
MountContainer PathPurpose
Repository data/dataRoot directory containing repos to analyze (required)
Index registry/home/node/.gitnexusRepo-to-index registry. Persist to avoid re-registration
Embedding cache/home/node/.cacheHuggingFace models, ONNX cache. Persist to avoid re-download
TLS certificates/etc/haproxy/certsTLS cert/key files (only with ENABLE_HTTPS=true)

Indexes live in .gitnexus/ within each repo. The registry at /home/node/.gitnexus stores pointers.

⁠Complete Environment Variables Reference
⁠Networking & Ports
VariableDefaultPossible ValuesDescription
PORT80101-65535External HAProxy port (MCP + Web UI + API)
PROTOCOLSHTTPSHTTP, SSEMCP transport (WS unsupported by mcp-proxy)
MCP_PROXY_STATELESSfalsetrue,falsefalse=shared child no TTL; true=per-request isolation
GITNEXUS_MAX_MEM_MB00 or >=16384prlimit --as MiB cap. LadybugDB mmaps ~16 GiB virtual; lower caps break DB tools
HAPROXY_FRONTEND_MAXCONN00-NHAProxy frontend max conns (0=off)
HAPROXY_SERVER_MAXCONN00-NHAProxy→mcp-proxy max conns (0=off)

Internal ports (INTERNAL_PORT=38011, WEB_UI_PORT=4747) are used by HAProxy; change only for in-container port conflicts. Static file server port (39012) is fixed.

⁠Security & TLS
VariableDefaultPossible ValuesDescription
API_KEY(empty)5-256 printable charsBearer token auth (Authorization: Bearer <key>)
CORS(empty)*, comma-separated originsCORS allowed origins
ENABLE_HTTPSfalsetrue, falseTLS termination in HAProxy (requires own certs)
TLS_CERT_PATH/etc/haproxy/certs/server.crtAny valid pathTLS certificate file
TLS_KEY_PATH/etc/haproxy/certs/server.keyAny valid pathTLS private key file
TLS_PEM_PATH/etc/haproxy/certs/server.pemAny valid pathCombined PEM (auto-generated from cert+key)
TLS_MIN_VERSIONTLSv1.3TLSv1.2, TLSv1.3Minimum TLS version
HTTP_VERSION_MODEautoauto, all, h1, h2, h3, h1+h2HTTP versions to enable
RATE_LIMIT00-NMax requests per RATE_LIMIT_PERIOD per IP (0=off)
RATE_LIMIT_PERIOD10s10s, 1m, 1h, etc.Rate limit sliding window
MAX_CONNECTIONS_PER_IP00-NMax concurrent connections per IP (0=off)
IP_ALLOWLIST(empty)Comma-separated IPs/CIDRsAllow only listed IPs (others blocked)
IP_BLOCKLIST(empty)Comma-separated IPs/CIDRsBlock listed IPs
⁠Container & System
VariableDefaultPossible ValuesDescription
PUID1000Any positive integerUser ID
PGID1000Any positive integerGroup ID
TZAsia/DhakaTZ database names⁠Timezone
NODE_ENVproductionproduction, developmentNode.js environment
ENABLE_WEB_UItruetrue, falseEnable Web UI
⁠Repository Analysis
VariableDefaultPossible ValuesDescription
DATA_DIR/dataAny valid pathRoot directory containing repos
ANALYZE_FORCEfalsetrue, falseForce full re-index (once per lifecycle)
ANALYZE_SKILLSfalsetrue, falseGenerate skill files from communities
ANALYZE_EMBEDDINGSfalsetrue, falseEnable embeddings for semantic search
ANALYZE_SKIP_GITfalsetrue, falseIndex folders without .git
ANALYZE_VERBOSEfalsetrue, falseLog skipped files
⁠Embedding Override (HTTP Backend)
VariableDefaultDescription
GITNEXUS_EMBEDDING_URL(empty)OpenAI-compatible /v1/embeddings endpoint URL
GITNEXUS_EMBEDDING_MODEL(empty)Model name for API requests
GITNEXUS_EMBEDDING_API_KEYunusedBearer token for the endpoint
GITNEXUS_EMBEDDING_DIMS384Embedding dimensions (must match model)

Local default: Snowflake/snowflake-arctic-embed-xs (22M params, 384 dims, ~90MB). Auto-downloads when ANALYZE_EMBEDDINGS=true. Set URL + MODEL to use a remote API instead:

# OpenAI
- GITNEXUS_EMBEDDING_URL=https://api.openai.com/v1
- GITNEXUS_EMBEDDING_MODEL=text-embedding-3-small
- GITNEXUS_EMBEDDING_API_KEY=sk-your-key
- GITNEXUS_EMBEDDING_DIMS=1536

# Self-hosted (OpenAI-compatible endpoint)
- GITNEXUS_EMBEDDING_URL=http://your-server:port/v1
- GITNEXUS_EMBEDDING_MODEL=Snowflake/snowflake-arctic-embed-xs
- GITNEXUS_EMBEDDING_DIMS=384
⁠Cleanup
VariableDefaultPossible ValuesDescription
CLEAN_ON_STARTfalsetrue, falseRun gitnexus clean before analysis
CLEAN_ALL_FORCEfalsetrue, falseRun gitnexus clean --all --force
⁠Wiki Generation
VariableDefaultPossible ValuesDescription
WIKI_ENABLEDfalsetrue, falseEnable wiki generation after analysis
WIKI_MODELgpt-4o-miniAny model nameLLM model (e.g. gpt-4o-mini, llama3)
WIKI_BASE_URL(OpenAI default)Any URLLLM API base URL
WIKI_FORCEfalsetrue, falseForce wiki regeneration
OPENAI_API_KEY(empty)Any stringAPI key for OpenAI or compatible provider

Booleans: true, 1, yes, on are truthy. Once per lifecycle: CLEAN_ON_START, CLEAN_ALL_FORCE, ANALYZE_FORCE, WIKI_FORCE run once after creation; recreate to re-trigger.

⁠One-Shot Operations (via docker exec)
docker exec gitnexus-mcp gitnexus clean              # Clean current repo index
docker exec gitnexus-mcp gitnexus clean --all --force # Delete ALL indexes
docker exec gitnexus-mcp gitnexus analyze --force     # Force full re-index
docker exec gitnexus-mcp gitnexus wiki --force        # Force wiki regeneration
⁠HTTPS Notes
  • Provide own TLS cert/key. Merged into TLS_PEM_PATH automatically.
  • HTTP_VERSION_MODE=h3/auto enables HTTP/3 only when HAProxy includes QUIC.
⁠API Key Authentication
  • Set API_KEY to enforce auth at the proxy level.
  • Header: Authorization: Bearer <API_KEY>.
  • /healthz and CORS preflight bypass auth.
⁠Rate Limiting and IP Access Control
  • Rate limiting: RATE_LIMIT=100 allows 100 req/period/IP. Excess returns 429.
  • Connection limiting: MAX_CONNECTIONS_PER_IP=50 caps concurrent connections/IP.
  • IP blocklist/allowlist: Block or allow specific IPs/CIDRs. Blocklist checked first. All disabled by default.
⁠Security Headers

HAProxy adds X-Content-Type-Options: nosniff, X-Frame-Options: DENY (always), and Strict-Transport-Security (HTTPS only).


⁠GitNexus-Specific Configuration

⁠Volume Mount Structure

The container analyzes all subdirectories in DATA_DIR on startup. Mount repos as subdirectories.

/data/
├── my-project-1/    # auto-analyzed
├── my-project-2/    # auto-analyzed
└── another-repo/    # auto-analyzed

Set ANALYZE_SKIP_GIT=true to index folders without .git.


⁠Wiki Generation

Supports cloud and local LLM providers via OpenAI-compatible API.

ProviderWIKI_BASE_URLWIKI_MODELOPENAI_API_KEY
OpenAI(default)gpt-4o-minisk-your-key
Ollamahttp://host.docker.internal:11434/v1llama3not-needed
vLLM/llama.cpphttp://your-server:8000/v1your-modelnot-needed

⁠GPU Support

GPU-accelerated embeddings via onnxruntime CUDA EP. NVIDIA x64 only. Falls back to CPU on ARM64 or without CUDA.

Requirements: NVIDIA driver + Container Toolkit⁠ + CUDA toolkit on host.

Setup: Mount host CUDA libs + enable GPU passthrough:

# docker-compose.yml additions
volumes:
  - /usr/local/cuda/lib64:/usr/local/cuda/lib64:ro
deploy:
  resources:
    reservations:
      devices:
        - driver: nvidia
          count: all
          capabilities: [gpu, compute, utility]

CLI: docker run --gpus all -v /usr/local/cuda/lib64:/usr/local/cuda/lib64:ro ...

Verify: Look for CUDA runtime libraries: found (libcublasLt.so.12) in startup logs. If not found, try alternate host paths: /usr/local/cuda-12/targets/x86_64-linux/lib or /usr/lib/x86_64-linux-gnu.

The ONNX CUDA EP binary is in the image. Only host CUDA runtime libs (libcublas, libcufft, libcurand, libcudart, libcudnn, libnvrtc) need mounting.


⁠MCP Client Configuration

⁠Transport Support
ClientSHTTPSSERecommended
VS Code (Cline/Roo-Cline)YesYesSHTTP
Claude DesktopYesYesSHTTP
Claude CLIYesYesSHTTP
Codex CLIYesYesSHTTP
Codeium (Windsurf)YesYesSHTTP
CursorYesYesSHTTP

⁠Claude Code / Claude Desktop
# With API_KEY
claude mcp add-json gitnexus '{"type":"http","url":"http://host-ip:8010/mcp","headers":{"Authorization":"Bearer <KEY>"}}'
# Without API_KEY
claude mcp add-json gitnexus '{"type":"http","url":"http://host-ip:8010/mcp"}'
⁠VS Code / Codex / Cursor / Windsurf

Same JSON format: VS Code (mcp.servers), Codex, Cursor (mcpServers), Windsurf (mcpServers).

{
  "mcpServers": {
    "gitnexus": {
      "transport": "http",
      "url": "http://host-ip:8010/mcp"
    }
  }
}

Test with MCP Inspector⁠: npx @modelcontextprotocol/inspector http://host-ip:8010/mcp


⁠Network Configuration

ModeConfigUse Case
Bridgeports: ["8010:8010"]Default, isolated
Hostnetwork_mode: hostMax performance (Linux)
MACVLANDedicated LAN IP via macvlan driverAdvanced, direct LAN

⁠Updating

⁠Docker Compose
docker compose pull
docker compose up -d
docker image prune -f
⁠Docker CLI
docker pull mekayelanik/gitnexus-mcp:latest
docker stop gitnexus-mcp && docker rm gitnexus-mcp
# Run your original docker run command
docker image prune -f
⁠One-Time Update with Watchtower
docker run --rm \
  -v /var/run/docker.sock:/var/run/docker.sock \
  containrrr/watchtower \
  --run-once \
  gitnexus-mcp

⁠Troubleshooting

⁠Pre-Flight Checklist
  • Docker Engine 23.0+, port 8010 available, latest image
  • Correct DATA_DIR with repository subdirectories
  • ARM devices: allow 60-120s startup time
⁠Common Issues
IssueSolution
Container won't startdocker logs gitnexus-mcp, check port: netstat -tulpn | grep 8010
Stays unhealthyNormal during analysis. If persistent after startup, check logs
No repos analyzedVerify mount: ls -la /path/to/repos/ - must be subdirectories
Permission errorsMatch PUID/PGID: id $USER, fix: chown -R 1000:1000 /path/to/repos
Client can't connectTest: curl http://localhost:8010/mcp, check firewall
Wiki failsVerify: docker exec gitnexus-mcp env | grep OPENAI_API_KEY
⁠Debug Info
docker --version && uname -a
docker logs gitnexus-mcp --tail 200 > logs.txt
docker inspect gitnexus-mcp > inspect.json

⁠Additional Resources


⁠Buy Me a Coffee

If you found value in this project, you can buy me a coffee to keep me inspired.

Buy Me A Coffee ⁠

⁠Support & License

⁠Getting Help
⁠Contributing

Contributions welcome: bug reports, feature suggestions, docs improvements, and beta testing.

⁠License

Docker Image: GPL v3 (LICENSE⁠). Upstream: PolyForm Noncommercial 1.0.0 (LICENSE⁠). Image license covers Docker packaging, scripts, and docs only. Users must comply with upstream license independently.

Required Notice: Copyright Abhigyan Patwari (https://github.com/abhigyanpatwari/GitNexus⁠)

⁠Credits

Tag summary

Content type

Image

Digest

sha256:4800cbb77…

Size

635.3 MB

Last updated

20 days ago

docker pull mekayelanik/gitnexus-mcp