nirutyodjai/git-memory-mcp-server
If you are the rightful owner of git-memory-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Git Memory MCP Server is a cutting-edge server that integrates Git repository management with advanced semantic memory capabilities, designed to enhance AI assistant functionalities.
5. Start Redis
Ubuntu/Debian
sudo systemctl start redis-server
macOS (Homebrew)
brew services start redis
Windows
redis-server
### 6. Configure Security Settings
#### API Key Authentication (Required for Production)
āđāļāļīāđāļĄāļāļąāļ§āđāļāļĢ `GIT_MEMORY_API_KEY` āđāļ `.env` āđāļāļ·āđāļāđāļāļīāļāđāļāđāļāļēāļ API key authentication āļŠāļģāļŦāļĢāļąāļ `/git/*` endpoints āđāļĨāļ° MCP tools:
```bash
GIT_MEMORY_API_KEY=your-secret-api-key-here
āļāļēāļĢāđāļāđāļāļēāļ:
# āđāļāđ x-api-key header
curl -X POST http://localhost:3000/git/status \
-H "Content-Type: application/json" \
-H "x-api-key: your-secret-api-key-here" \
-d '{"repoPath": "/path/to/repo", "json": true}'
# āļŦāļĢāļ·āļāđāļāđ Authorization header (Bearer token)
curl -X POST http://localhost:3000/git/status \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-secret-api-key-here" \
-d '{"repoPath": "/path/to/repo", "json": true}'
āļŦāļĄāļēāļĒāđāļŦāļāļļ: āļŦāļēāļāđāļĄāđāļāļąāđāļāļāđāļē GIT_MEMORY_API_KEY
āļĢāļ°āļāļāļāļ°āđāļĄāđāļāļąāļāļāļąāļāđāļāđ API key (āđāļŦāļĄāļēāļ°āļŠāļģāļŦāļĢāļąāļ development āđāļāđāļēāļāļąāđāļ)
Repository Path Whitelist (Recommended)
āđāļāļīāđāļĄāļāļąāļ§āđāļāļĢ GIT_MEMORY_ALLOWED_REPOS
āđāļ .env
āđāļāļ·āđāļāļāļģāļāļąāļ path āļāļĩāđāļāļāļļāļāļēāļāđāļŦāđāđāļĢāļĩāļĒāļāđāļāđāļāļģāļŠāļąāđāļ Git āļāđāļēāļ CLI endpoints:
# Windows
GIT_MEMORY_ALLOWED_REPOS=D:\repos\project-a;D:\repos\project-b
# Linux/macOS
GIT_MEMORY_ALLOWED_REPOS=/var/repos/project-a:/var/repos/project-b
āļāļąāđāļāļŦāļĨāļēāļĒ path āļāđāļ§āļĒ ;
(Windows) āļŦāļĢāļ·āļ :
(Linux/macOS). āļĢāļ°āļāļāļāļ°āļāļĢāļ§āļāļŠāļāļāļ§āđāļēāļāļģāļāļāļāļĒāļđāđāļ āļēāļĒāđāļ path āļāļĩāđāļāļāļļāļāļēāļāļāđāļāļāļĢāļąāļāļāļģāļŠāļąāđāļ.
ð Performance Testing
Load Testing
# Run basic load test
npm run test:load
# Run stress test with 3000 connections
npm run test:stress
# Run custom performance test
node test/performance-test.js --connections 3000 --duration 300
Testing Git CLI Endpoints
# Set environment variables
export GIT_MEMORY_API_KEY=your-test-api-key
export TEST_REPO_PATH=/path/to/test/repo
# Run endpoint tests
node test/test-git-endpoints.js
ð Monitoring
Health Check Endpoint
curl http://localhost:3000/health
Metrics Endpoint (Prometheus format)
curl http://localhost:3000/metrics
Monitoring Dashboard
āļāļđāļāļđāđāļĄāļ·āļāļāļēāļĢāļāļąāđāļāļāđāļē Prometheus, Grafana āđāļĨāļ° Alerting āđāļāđāļāļĩāđ
Key Metrics:
- Active connections
- Request rate and error rate
- Average response time
- Memory and CPU usage
- Tool execution metrics
ð API Endpoints
Git Operations (HTTP)
Method | Endpoint | Description |
---|---|---|
POST | /git/status | Get repository status |
POST | /git/fetch | Fetch from remote repository |
POST | /git/rebase | Rebase repository |
POST | /git/clone | Clone repository |
POST | /git/push | Push to remote repository |
POST | /git/pull | Pull from remote repository |
POST | /git/merge | Merge branches |
POST | /git/branch/create | Create new branch |
DELETE | /git/branch/:name | Delete branch |
GET | /git/stats | Get repository statistics |
POST | /git/stash | Stash changes |
POST | /git/stash/apply | Apply stashed changes |
GET | /git/diff | Get diff between commits |
WebSocket Real-time Features
Connect to ws://localhost:3000
for real-time updates:
const ws = new WebSocket('ws://localhost:3000');
// Subscribe to repository events
ws.send(JSON.stringify({
type: 'subscribe_repo_events',
data: { repoPath: '/path/to/repo' }
}));
// Subscribe to tool execution events
ws.send(JSON.stringify({
type: 'subscribe_tool_executions',
data: { toolName: 'git_status_cli' }
}));
// Execute tool with real-time updates
ws.send(JSON.stringify({
type: 'execute_tool',
data: {
name: 'git_status_cli',
arguments: { repoPath: '/path/to/repo', json: true }
}
}));
ws.onmessage = (event) => {
const message = JSON.parse(event.data);
switch (message.type) {
case 'repo_event':
console.log('Repository event:', message.eventType);
break;
case 'tool_execution_event':
console.log('Tool execution:', message.data.status);
break;
}
};
1. **Always set `GIT_MEMORY_API_KEY` in production**
2. **Configure `GIT_MEMORY_ALLOWED_REPOS` to limit repository access**
3. **Use HTTPS in production** (configure reverse proxy like nginx)
4. **Rotate API keys regularly**
5. **Monitor metrics endpoint** (`/metrics`) for suspicious activity
6. **Review logs** in `logs/error.log` and `logs/combined.log`
### Docker Deployment
```dockerfile
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000 9090
CMD ["npm", "start"]
Production Deployment with PM2
# Install PM2 globally
npm install -g pm2
# Start with PM2
pm2 start ecosystem.config.js
# Monitor
pm2 monit
ðģ Kubernetes Deployment
Quick Start with Kubernetes
- Deploy to development:
# Deploy development environment
kubectl apply -k k8s/overlays/development
# Check deployment status
kubectl get pods -n git-memory
kubectl get services -n git-memory
- Deploy to production:
# Deploy production environment
kubectl apply -k k8s/overlays/production
# Check HPA and ingress
kubectl get hpa -n git-memory
kubectl get ingress -n git-memory
- Access services:
# Port forward for local access
kubectl port-forward -n git-memory service/git-memory-mcp-server 3000:80
# Access Jaeger UI
kubectl port-forward -n git-memory service/git-memory-jaeger 16686:16686
# Access Grafana
kubectl port-forward -n git-memory service/git-memory-grafana 3001:3000
Kubernetes Features
- Horizontal Pod Autoscaling (HPA) with CPU/Memory metrics
- Ingress with SSL/TLS āđāļĨāļ° rate limiting
- Persistent Volumes āļŠāļģāļŦāļĢāļąāļ logs āđāļĨāļ° data
- Network Policies āļŠāļģāļŦāļĢāļąāļ security
- Service Monitoring āļŠāļģāļŦāļĢāļąāļ Prometheus
- Kustomize āļŠāļģāļŦāļĢāļąāļ environment management
ðŧ VS Code Development Setup
Recommended Extensions
āđāļāļīāļ VS Code āđāļĨāļ°āļāļīāļāļāļąāđāļ extensions āļāļĩāđāđāļāļ°āļāļģ:
# Extensions āļāļ°āļāļđāļāđāļāļ°āļāļģāļāļąāļāđāļāļĄāļąāļāļīāđāļĄāļ·āđāļāđāļāļīāļ workspace
# āļŦāļĢāļ·āļāļāļīāļāļāļąāđāļāļāđāļ§āļĒāļāļāđāļāļāļāļēāļāđāļāļĨāđ .vscode/extensions.json
Debugging Configurations
- Debug Server: F5 āđāļāļ·āđāļāđāļĢāļīāđāļĄ debugging
- Debug with Docker: Debug āļ āļēāļĒāđāļ Docker container
- Debug TypeScript: Debug āđāļāļĨāđ TypeScript
- Debug Tests: Debug unit tests
- Attach to Process: Attach āđāļāļĒāļąāļ process āļāļĩāđāļāļģāļĨāļąāļāļĢāļąāļ
Development Tasks
āđāļāđ VS Code Tasks āļŠāļģāļŦāļĢāļąāļ:
- npm: dev - āđāļĢāļīāđāļĄ development server
- npm: test - āļĢāļąāļ tests
- npm: lint - āļĢāļąāļ ESLint
- npm: format - āļāļąāļāļĢāļđāļāđāļāļ code
- docker: build - āļŠāļĢāđāļēāļ Docker image
- k8s: deploy - Deploy āđāļāļĒāļąāļ Kubernetes
Keyboard Shortcuts
Ctrl+Shift+P
â "Tasks: Run Task" āļŠāļģāļŦāļĢāļąāļāļĢāļąāļ tasksF5
â āđāļĢāļīāđāļĄ debuggingCtrl+Shift+D
â āđāļāļīāļ debug panelCtrl+Shift+E
â āđāļāļīāļ explorer- `Ctrl+`` â āļŠāļĨāļąāļ terminal
â āļāļĩāđāļāļāļĢāđāļŦāļĨāļąāļāļāļĩāđāļŠāļĄāļāļđāļĢāļāđ
-
ð WebSocket Real-time Features
- Repository event subscriptions āđāļĨāļ° broadcasting
- Tool execution monitoring āļāļąāļ real-time updates
- WebSocket client example āļāļĢāđāļāļĄāđāļāđāļāļēāļ
- Connection management āļāļĩāđāļĄāļĩāļāļĢāļ°āļŠāļīāļāļāļīāļ āļēāļāļŠāļđāļ
-
ð§ Enhanced Git API Endpoints
- Clone, push, pull, merge operations
- Branch management (create/delete)
- Repository statistics āđāļĨāļ° analytics
- Stash operations āđāļĨāļ° diff viewing
- Advanced Git operations service
-
ð Monitoring & Observability
- Distributed Tracing āļāļąāļ Jaeger/OpenTelemetry
- Performance Profiling āļŠāļģāļŦāļĢāļąāļ memory āđāļĨāļ° CPU analysis
- Structured Logging āļāļĩāđāļāļĢāļāļāļāļĨāļļāļĄ
- Prometheus Metrics āļŠāļģāļŦāļĢāļąāļ monitoring
- Grafana Dashboards āļŠāļģāļŦāļĢāļąāļ visualization
-
ðģ Docker & CI/CD Infrastructure
- Development Environment āļāļĩāđāļŠāļĄāļāļđāļĢāļāđāļāđāļ§āļĒ Docker Compose
- CI/CD Pipeline āļāđāļ§āļĒ GitHub Actions
- Production-ready Dockerfiles
- Automated Testing āđāļĨāļ° deployment
-
âļïļ Kubernetes Deployment
- Complete Kubernetes manifests āļŠāļģāļŦāļĢāļąāļ production
- Multi-environment support (development/production)
- Auto-scaling āđāļĨāļ° monitoring āļāđāļ§āļĒ HPA āđāļĨāļ° ServiceMonitor
- Security policies āđāļĨāļ° network isolation
-
ðŠ Git Webhooks Support
- GitHub/GitLab Webhooks endpoint āļāļĢāđāļāļĄ signature verification
- Event Processing āļŠāļģāļŦāļĢāļąāļ push, pull request, issues
- Integration āļāļąāļ WebSocket real-time features
- Security Validation āđāļĨāļ° origin checking
-
⥠Performance Profiling Tools
- Memory Leak Detection āđāļĨāļ° monitoring
- Git Operation Profiling āļŠāļģāļŦāļĢāļąāļ performance analysis
- System Metrics Collection āđāļāļ real-time
- Performance Report Generation
-
ð TypeScript Support
- Complete Type Definitions āļŠāļģāļŦāļĢāļąāļāļāļļāļāļāļĩāđāļāļāļĢāđ
- ESLint & Prettier Configuration
- Type-safe Development āļāļĢāđāļāļĄ JSDoc annotations
- Gradual Migration Path āļāļēāļ JavaScript
-
ðŧ VS Code Development Environment
- Comprehensive Extensions āļŠāļģāļŦāļĢāļąāļ development workflow
- Debugging Configurations āļŠāļģāļŦāļĢāļąāļāļāļļāļ scenarios
- Build āđāļĨāļ° test tasks āļŠāļģāļŦāļĢāļąāļ automation
- Kubernetes integration āļŠāļģāļŦāļĢāļąāļ deployment
-
ð Advanced Rate Limiting
- Multiple algorithms (Token Bucket, Sliding Window, Fixed Window)
- Dynamic rate limiting based on system load
- Distributed rate limiting with Redis
- WebSocket rate limiting āđāļĨāļ° per-user limits
- Rate limiting analytics āđāļĨāļ° monitoring
-
ð Comprehensive Audit Logging
- Structured audit logs with multiple storage backends
- GDPR compliance with data anonymization
- Real-time log streaming āđāļĨāļ° filtering
- Log retention policies āđāļĨāļ° rotation
- Performance impact monitoring
-
ð Advanced Connection Pooling
- Dynamic connection pool management
- Connection health monitoring āđāļĨāļ° recovery
- Load balancing across multiple database instances
- Automatic failover āđāļĨāļ° retry mechanisms
- Performance monitoring āđāļĨāļ° metrics
-
âïļ Advanced Load Balancing
- Multiple algorithms (Round Robin, Least Connections, IP Hash, etc.)
- Dynamic algorithm switching based on system conditions
- Health checking āđāļĨāļ° automatic failover
- Session persistence āđāļĨāļ° sticky sessions
- Geographic load balancing support
-
ðū Multi-Level Advanced Caching
- Multi-tier caching (Memory, Redis, File/SSD)
- Intelligent cache warming āđāļĨāļ° preloading
- Adaptive TTL based on access patterns
- Cache partitioning āđāļĨāļ° sharding
- Background refresh āđāļĨāļ° stale-while-revalidate
-
ð API Versioning Support
- Semantic versioning (Major.Minor.Patch)
- Version negotiation (Accept header, URL path, query parameter)
- Backward compatibility management
- Breaking change detection āđāļĨāļ° notification
- A/B testing support āļŠāļģāļŦāļĢāļąāļ API versions
ðŊ āļŠāļāļēāļāļąāļāļĒāļāļĢāļĢāļĄāļāļĩāđāļāļąāļāļāļēāđāļĨāđāļ§
- Ultra-High-Performance Server āļĢāļāļāļĢāļąāļ 3000+ concurrent connections
- Enterprise-Grade Architecture āļāđāļ§āļĒ microservices āđāļĨāļ° event-driven design
- Scalable Infrastructure āļāļĢāđāļāļĄ Docker, Kubernetes āđāļĨāļ° auto-scaling
- Comprehensive Monitoring āļāđāļ§āļĒ distributed tracing āđāļĨāļ° advanced metrics
- Security-First Design āļāđāļ§āļĒ authentication, authorization āđāļĨāļ° encryption
- Developer Experience āļāļĩāđāļāļĩāđāļĒāļĩāđāļĒāļĄāļāđāļ§āļĒ TypeScript āđāļĨāļ° tooling āļāļĩāđāļāļĢāļāļāļāļĨāļļāļĄ
- Production-Ready āļŠāļģāļŦāļĢāļąāļ enterprise deployment āļāļĩāđāļĄāļĩāļāļĢāļ°āļŠāļīāļāļāļīāļ āļēāļāļŠāļđāļāļŠāļļāļ
ð Performance & Scalability āļāļĩāđāļĢāļāļāļĢāļąāļ
- Connection Metrics: Active connections, WebSocket events, session management
- Performance Metrics: Response times, memory usage, CPU utilization āļāļĩāđ optimize āđāļĨāđāļ§
- Git Operation Metrics: Tool execution times, success/failure rates āļāļĩāđāļĄāļĩāļāļĢāļ°āļŠāļīāļāļāļīāļ āļēāļāļŠāļđāļ
- Caching Metrics: Multi-level cache hit rates, memory usage, Redis performance
- Load Balancing Metrics: Algorithm performance, backend health, geographic routing
- Rate Limiting Metrics: Request throttling, user behavior analysis, system protection
- Audit Metrics: Log processing performance, compliance tracking, security monitoring
ð āļāļēāļĢāļāļīāļāļāļąāđāļāđāļĨāļ°āđāļāđāļāļēāļ
# āđāļĢāļīāđāļĄāļāđāļāļāļąāļāļāļē
git clone <repository-url>
cd git-memory-mcp-server
npm install
# āđāļĢāļīāđāļĄ development environment āļāļĩāđāļĄāļĩāļāļĢāļ°āļŠāļīāļāļāļīāļ āļēāļāļŠāļđāļāļŠāļļāļ
docker-compose -f docker-compose.dev.yml up -d
# āļŦāļĢāļ·āļ deploy production āļāļĩāđ scale āđāļāđāđāļĄāđāļāļģāļāļąāļ
kubectl apply -k k8s/overlays/production
# āđāļāđāļēāļāļķāļ services āļāļĩāđāļĄāļĩāļāļĢāļ°āļŠāļīāļāļāļīāļ āļēāļāļŠāļđāļ
# - Server: http://localhost:3000 āļŦāļĢāļ·āļ Kubernetes service āļāļĩāđ scale āđāļāđ
# - Admin Dashboard: http://localhost:3000/admin (āļŠāļģāļŦāļĢāļąāļāļāļąāļāļāļēāļĢ server)
# - Jaeger: http://localhost:16686 (distributed tracing)
# - Grafana: http://localhost:3001 (advanced monitoring)
# - Prometheus: http://localhost:9090 (metrics collection)
{{ ... }}
- **Comprehensive Git Operations** āļāđāļ§āļĒ REST API, CLI āđāļĨāļ° advanced tooling
- **Advanced Monitoring** āđāļĨāļ° observability āļāļĩāđāļāļĢāļāļāļāļĨāļļāļĄāļāļļāļ aspect
- **Production-Ready Infrastructure** āļāļĢāđāļāļĄ Docker, Kubernetes āđāļĨāļ° auto-scaling
- **Enterprise-Grade Security** āļāđāļ§āļĒ authentication, authorization āđāļĨāļ° compliance
- **Developer Experience** āļāļĩāđāļāļĩāđāļĒāļĩāđāļĒāļĄāļāđāļ§āļĒ TypeScript, VS Code integration āđāļĨāļ° tooling
- **Management Interface** āļāļĩāđāđāļāđāļāļēāļāļāđāļēāļĒāļāđāļ§āļĒ Admin Dashboard
- **Scalability āđāļĨāļ° Performance** āļāļĩāđāđāļāļ·āđāļāļāļ·āļāđāļāđāļŠāļģāļŦāļĢāļąāļāļāļāļāđāļāļĢāļāļāļēāļāđāļŦāļāđ
āļĢāļ°āļāļāļāļĩāđāļāļĢāđāļāļĄāļŠāļģāļŦāļĢāļąāļāļāļēāļĢāđāļāđāļāļēāļāļāļĢāļīāļāđāļāļāļāļāđāļāļĢāļāļāļēāļāđāļŦāļāđāđāļĨāļ°āļŠāļēāļĄāļēāļĢāļ **scale āđāļāđāđāļĄāđāļāļģāļāļąāļ** āļāļēāļĄāļāļ§āļēāļĄāļāđāļāļāļāļēāļĢ! ð
---
## ð **āļŠāļāļīāļāļīāđāļĨāļ°āļāļ§āļēāļĄāļŠāļģāđāļĢāđāļ**
- **16+ Advanced Services** āļāļĩāđāļāļąāļāļāļēāđāļŠāļĢāđāļāļŠāļĄāļāļđāļĢāļāđ â
- **Enterprise-Grade Architecture** āļāļĩāđāļĢāļāļāļĢāļąāļ production workload â
- **Comprehensive Feature Set** āļāļĩāđāļāļĢāļāļāļāļĨāļļāļĄāļāļļāļ requirement â
- **High-Performance Design** āļāļĩāđ optimize āļŠāļģāļŦāļĢāļąāļ maximum throughput â
- **Production-Ready Codebase** āļāļĩāđāļāļĢāđāļāļĄ deploy āļāļąāļāļāļĩ â
- **Modern Admin Interface** āļŠāļģāļŦāļĢāļąāļāļāļąāļāļāļēāļĢ server āļāļĒāđāļēāļāļāđāļēāļĒāļāļēāļĒ â
**āļĢāļ°āļāļāļāļĩāđāđāļāđāļāļąāļāļāļēāđāļāļāļķāļāļāļļāļāļŠāļđāļāļŠāļļāļāļāļāļāļāļ§āļēāļĄāđāļāđāļāđāļĨāļīāļĻāļāļēāļāđāļāļāļāļīāļāđāļĨāđāļ§āļāļĢāļąāļ!** ðâĻ
## ð License
MIT