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 toolsmcp_pr_recommender- PR recommendation engine
Installation
cd mcp_shared_lib
poetry install
Usage
Models
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
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
poetry run pytest
Code Formatting
poetry run black .
poetry run isort .
Type Checking
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
Metadata
Release files for mcp-shared-lib 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcp_shared_lib-0.1.1.tar.gz | 47.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_shared_lib-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 113.0 kB
Security for mcp-shared-lib 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.