Metadata-Version: 2.3
Name: mcp-shared-lib
Version: 0.1.1
Summary: Shared library for MCP components providing common utilities, models, and tools
License: MIT
Keywords: mcp,model-context-protocol,shared-library,transport,git
Author: Manav Gupta
Author-email: manavg@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Dist: fastapi (>=0.116.1,<0.117.0)
Requires-Dist: pathlib (>=1.0.1,<2.0.0)
Requires-Dist: pydantic-settings (>=2.10.1,<3.0.0)
Requires-Dist: pydantic[mypy] (>=2.11.7,<3.0.0)
Requires-Dist: sse-starlette (>=2.4.1,<3.0.0)
Requires-Dist: typing-extensions (>=4.8.0,<5.0.0)
Requires-Dist: uvicorn (>=0.35.0,<0.36.0)
Project-URL: Documentation, https://github.com/manavgup/mcp_shared_lib#readme
Project-URL: Homepage, https://github.com/manavgup/mcp_shared_lib
Project-URL: Repository, https://github.com/manavgup/mcp_shared_lib
Description-Content-Type: text/markdown

# MCP Shared Library

Shared models and services for MCP (Model Context Protocol) components.

## Overview

This library provides common data models, services, and utilities used by:
- `mcp_local_repo_analyzer` - Git repository analysis tools
- `mcp_pr_recommender` - PR recommendation engine

## Installation

```bash
cd mcp_shared_lib
poetry install
```

## Usage

### Models

```python
from mcp_shared_lib.models import FileStatus, WorkingDirectoryChanges, RiskAssessment

# Create a file status
file_status = FileStatus(
    path="src/main.py",
    status_code="M",
    lines_added=10,
    lines_deleted=5
)
```

### Services

```python
from mcp_shared_lib.services import GitClient, ChangeDetector
from mcp_shared_lib.config import GitAnalyzerSettings

# Setup services
settings = GitAnalyzerSettings()
git_client = GitClient(settings)
change_detector = ChangeDetector(git_client)

# Use services
repo = LocalRepository(path=".", name="my-repo", current_branch="main", head_commit="abc123")
changes = await change_detector.detect_working_directory_changes(repo)
```

## Architecture

```
mcp_shared_lib/
├── models/          # Data models
│   ├── git/         # Git-related models
│   ├── analysis/    # Analysis models
│   ├── pr/          # PR models (Phase 2)
│   └── base/        # Base classes
├── services/        # Business logic services
│   ├── git/         # Git services
│   └── pr/          # PR services (Phase 2)
├── tools/           # Tool base classes
├── utils/           # Utility functions
└── config/          # Configuration management
```

## Development

### Running Tests

```bash
poetry run pytest
```

### Code Formatting

```bash
poetry run black .
poetry run isort .
```

### Type Checking

```bash
poetry run mypy .
```

## Migration Status

- ✅ Phase 1: Foundation setup (models from mcp_local_repo_analyzer)
- ⏳ Phase 2: PR models migration (from mcp_pr_recommender)
- ⏳ Phase 3: Service migration
- ⏳ Phase 4: Repository updates
- ⏳ Phase 5: Testing & cleanup

