LiadMatus/personal-mcp-server
If you are the rightful owner of personal-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.
The Personal MCP Server is a FastAPI-based server implementing the Model Context Protocol (MCP) for streaming structured context into a persistent memory buffer, ideal for real-time syncing with LLMs like ChatGPT.
๐ Personal MCP Server
A unified Model Context Protocol server that bridges AI assistants with your development workflow
Features โข Installation โข Usage โข API โข Deployment โข Contributing
โจ Features
๐ค MCP Protocol Support
Perfect integration with AI assistants like Claude and Cline, providing:
- ๐ง Git Operations - Complete repository management with branch operations
- ๐ File Management - Read, write, search, and batch operations
- ๐พ Context Storage - Persistent memory with full-text search capabilities
- ๐๏ธ Project Templates - Quick scaffolding for Python, React, FastAPI, and more
- ๐ค Automatic Context Logging - Every interaction automatically logged and organized
- ๐ Project Discovery - Automatic detection and cataloging of all your projects
๐ HTTP API Support
RESTful endpoints for web applications:
- ๐ Context Management - Add, retrieve, and organize context streams
- ๐ Repository Updates - Specialized git workflow endpoints
- ๐ Health Monitoring - Server status and performance metrics
- ๐ Production Ready - CORS support, error handling, and comprehensive logging
๐ข Deployment Ready
Multiple deployment options with full configuration:
- ๐ณ Docker - Production-ready containerization with health checks
- โ๏ธ Cloud Platforms - Heroku, Railway, Render, DigitalOcean, GCP, AWS
- ๐ง Development - Auto-reload, comprehensive testing, and debugging tools
๐ Installation
Prerequisites
- Python 3.8 or higher
- Git (for repository operations)
Quick Start
# Clone the repository
git clone https://github.com/LiadMatus/personal-mcp-server.git
cd personal-mcp-server
# Install dependencies
pip install -r requirements.txt
# Run in MCP mode (for AI assistants)
python3 mcp_server.py
# Or run in HTTP mode (for web applications)
python3 unified_mcp_server.py --http
Development Installation
# Install with development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black .
# Type checking
mypy .
๐ก Usage
๐ MCP Mode (AI Assistant Integration)
Perfect for Claude, Cline and other MCP-compatible AI assistants:
python3 mcp_server.py
Claude Desktop Configuration:
{
"mcpServers": {
"personal-mcp-server": {
"command": "python3",
"args": ["mcp_server.py"],
"cwd": "/path/to/Personal-MCP-Server",
"type": "stdio"
}
}
}
๐ HTTP Mode (Web API)
For web applications and direct API access:
python3 unified_mcp_server.py --http
- ๐ API Base:
http://localhost:8000
- ๐ Interactive Docs:
http://localhost:8000/docs
- ๐ Health Check:
http://localhost:8000/status
๐ ๏ธ Available Tools
๐ง Git Operations
list_git_repos
- Discover all repositories in common directoriesget_repo_status
- Detailed repository information with statusgit_command
- Execute any git command safelygit_branch
- Branch management (list, create, switch, delete)git_diff
- View changes, diffs, and staged contentgit_commit
- Create commits with automatic staging options
๐ File Management
read_file
- Read file contents with encoding detectionwrite_file
- Create or update files with directory creationlist_directory
- Browse directory contents with filteringsearch_files
- Find files by name or content with regex supportbatch_file_operation
- Bulk operations (copy, move, delete, rename)
๐พ Context & Memory
add_context
- Store information in persistent context streamsget_context
- Retrieve stored context with optional limitssearch_context
- Full-text search with date and stream filters- Automatic Logging - Every tool interaction automatically logged
- Session Tracking - Unique session IDs for interaction history
๐๏ธ Project Templates
create_project_template
- Scaffold new projects with best practices- Supported Types: Python, JavaScript, React, FastAPI, MCP Server
- Features: Git initialization, proper .gitignore, README templates
- Smart Detection: Automatic project type detection for existing projects
๐ค Automatic Context Features
๐ Interaction Logging
Every MCP tool call is automatically logged with:
- Tool name and sanitized arguments
- Execution time and success/failure status
- Result summaries (large content truncated)
- Error messages and debugging information
๐ Project Discovery
On startup, the server automatically:
- Scans Documents and Desktop for git repositories
- Detects project types (Python, JavaScript, React, Vue, etc.)
- Catalogs technologies and configuration files
- Creates comprehensive project profiles
๐ Context Streams
Organized context storage:
session_[ID]
- Complete interaction historyproject_[name]
- Individual project discoveriestool_[name]
- Significant operations (commits, file writes)system_overview
- Server initialization infoprojects_overview
- All discovered projects summary
๐ก API Reference
Context Management
POST /add_context # Store new context
GET /get_context?target=ID # Retrieve context by stream ID
DELETE /delete_context?target=ID # Remove context stream
GET /status # Server health and statistics
Repository Operations
POST /repos/update_context # Repository-specific context updates
System Information
GET / # Basic server information
GET /status # Detailed server status with metrics
Example Status Response:
{
"status": "ok",
"stored_contexts": ["session_abc123", "project_my-app"],
"total_items": 42,
"server_uptime": "2:30:15",
"mcp_tools": 15,
"mcp_resources": 6
}
๐ข Deployment
๐ณ Docker Deployment
# Build and run with Docker
docker build -t personal-mcp-server .
docker run -p 8000:8000 -v $(pwd)/context_data.json:/app/context_data.json personal-mcp-server
# Or use Docker Compose
docker-compose up --build
# Production with nginx
docker-compose --profile production up -d
โ๏ธ Cloud Deployment
Heroku
heroku create your-mcp-server
git push heroku main
Railway
railway login
railway init
railway up
Render, DigitalOcean, GCP, AWS
See our comprehensive for detailed instructions.
๐ง Environment Variables
PORT
- Server port (default: 8000)PYTHONUNBUFFERED
- Enable immediate outputPYTHONDONTWRITEBYTECODE
- Prevent .pyc files
๐ Project Structure
Personal-MCP-Server/
โโโ ๐ mcp_server.py # MCP mode entry point
โโโ ๐ unified_mcp_server.py # Main server implementation
โโโ ๐ requirements.txt # Python dependencies
โโโ ๐ฆ setup.py # Package configuration
โโโ ๐พ context_data.json # Persistent context storage
โโโ ๐ณ Dockerfile # Container configuration
โโโ ๐ข docker-compose.yml # Multi-service setup
โโโ ๐ README.md # This documentation
โโโ ๐ DEPLOYMENT.md # Deployment guide
โโโ ๐ค CONTRIBUTING.md # Contribution guidelines
โโโ ๐ LICENSE # MIT license
โโโ ๐ Procfile # Heroku deployment config
โโโ ๐ UNIFIED_SERVER_GUIDE.md # Additional server documentation
โโโ ๐งช tests/ # Test suite
โโโ __init__.py
โโโ test_context_store.py
๐งช Testing
# Run all tests
pytest
# Run with coverage
pytest --cov=. --cov-report=html
# Run specific test file
pytest tests/test_context_store.py
# Test with different Python versions
tox
๐ง Development
Local Development
# Run with auto-reload
uvicorn unified_mcp_server:app --reload --host 0.0.0.0 --port 8000
# Run MCP mode with debugging
python3 mcp_server.py
# Format code
black .
# Lint code
flake8 .
# Type checking
mypy .
Development Tools
- Black - Code formatting
- flake8 - Linting
- mypy - Type checking
- pytest - Testing framework
- coverage - Test coverage reporting
๐ Monitoring & Health Checks
Health Endpoint
curl http://localhost:8000/status
Docker Health Checks
Built-in health checks monitor:
- Server responsiveness
- Context storage functionality
- MCP tool availability
- Resource accessibility
Logging
Comprehensive logging with:
- Structured log format
- Error tracking and debugging
- Performance metrics
- Interaction history
๐ Security & Best Practices
Security Features
- Content Sanitization - Large content automatically truncated
- Input Validation - Pydantic models for all API inputs
- Error Handling - Graceful error responses without data leaks
- CORS Configuration - Configurable cross-origin policies
Production Considerations
- Use environment variables for sensitive configuration
- Enable HTTPS in production deployments
- Configure appropriate CORS origins
- Set up monitoring and alerting
- Regular backups of context data
๐ค Contributing
We welcome contributions! Please see our for details.
Quick Contribution Steps
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes with tests
- Run the test suite (
pytest
) - Format your code (
black .
) - Submit a pull request
Development Setup
# Clone your fork
git clone https://github.com/YOUR_USERNAME/personal-mcp-server.git
cd personal-mcp-server
# Install development dependencies
pip install -e ".[dev]"
# Run tests to ensure everything works
pytest
๐ License
This project is licensed under the MIT License - see the file for details.
๐ Acknowledgments
- MCP Protocol - Model Context Protocol
- FastAPI - Modern, fast web framework for building APIs
- Claude & Cline - AI assistants that inspired this integration
- Contributors - Everyone who has contributed to this project
Built with โค๏ธ by Liad Matusovsky
Empowering AI assistants with powerful development tools
โญ Star this repo if you find it useful! โญ