MCP server for analyzing outstanding git changes in repositories
Project description
=============================================================================
README.md - Project Documentation
=============================================================================
Local Git Changes Analyzer
A FastMCP server for analyzing outstanding local git changes that haven't made their way to GitHub yet.
Features
- Working Directory Analysis: Detect uncommitted changes
- Staging Area Analysis: Analyze staged changes ready for commit
- Unpushed Commits: Find commits that haven't been pushed to remote
- Stash Analysis: Examine stashed changes
- Risk Assessment: Identify high-risk changes and potential conflicts
- Push Readiness: Assess if repository is ready for remote push
Installation
Prerequisites
- Python 3.9+
- Poetry (for dependency management)
- Git
Setup
# Clone the repository
git clone <repository-url>
cd local-git-analyzer
# Install Poetry if you haven't already
curl -sSL https://install.python-poetry.org | python3 -
# Install dependencies
poetry install
# For development dependencies
poetry install --with dev
Configuration
Copy .env.example to .env and configure your settings:
cp .env.example .env
Usage
Run the FastMCP server:
# Using Poetry
poetry run python main.py
# Or activate the virtual environment
poetry shell
python main.py
Or use the CLI:
poetry run local-git-analyzer
Development
Setup Development Environment
# Install all dependencies including dev
poetry install --with dev,test
# Install pre-commit hooks
poetry run pre-commit install
# Run tests
poetry run pytest
# Run tests with coverage
poetry run pytest --cov=local_git_analyzer --cov-report=html
# Run type checking
poetry run mypy local_git_analyzer
# Format code
poetry run black local_git_analyzer
poetry run isort local_git_analyzer
# Or use ruff for linting and formatting
poetry run ruff check local_git_analyzer
poetry run ruff format local_git_analyzer
Poetry Commands
# Add a new dependency
poetry add <package>
# Add a development dependency
poetry add --group dev <package>
# Update dependencies
poetry update
# Show dependency tree
poetry show --tree
# Build the package
poetry build
# Publish to PyPI
poetry publish
Project Structure
local_git_analyzer/
├── main.py # FastMCP server entry point
├── config.py # Configuration and settings
├── models/ # Pydantic data models
├── services/ # Business logic services
├── tools/ # FastMCP tools
├── tests/ # Test files
├── pyproject.toml # Poetry configuration
└── README.md # This file
Testing
# Run all tests
poetry run pytest
# Run with coverage
poetry run pytest --cov=local_git_analyzer
# Run specific test file
poetry run pytest tests/test_git_client.py
# Run tests with specific markers
poetry run pytest -m unit
poetry run pytest -m integration
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_local_repo_analyzer-0.1.1.tar.gz.
File metadata
- Download URL: mcp_local_repo_analyzer-0.1.1.tar.gz
- Upload date:
- Size: 36.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.10 Darwin/23.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
305d012626bd2fad1e8e7a0cc81c936806dbbc5152c80828b62194da71abe59d
|
|
| MD5 |
678a99ee8055bac34781f50de7a1e9a2
|
|
| BLAKE2b-256 |
624585a675bf1f2e3f9a31bfdb8a470228956ee2c116d755bd9192b913b47832
|
File details
Details for the file mcp_local_repo_analyzer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcp_local_repo_analyzer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 42.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.10 Darwin/23.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
221875690138d7481931da292716e01f61fa0d8ce7728ed803baa7d9fafc6e30
|
|
| MD5 |
63385cedfa2b16aabc1f46843bcf762c
|
|
| BLAKE2b-256 |
936405cf2b79ea6268f654720459335074a9a5b9c168025cbd43623e6d5989d6
|