Skip to main content

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

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)

Source distribution for mcp-shared-lib 0.1.1
File Size Uploaded Provenance
mcp_shared_lib-0.1.1.tar.gz 47.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-shared-lib 0.1.1
File Interpreter ABI Platform
mcp_shared_lib-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 113.0 kB

Release files / mcp_shared_lib-0.1.1.tar.gz

Download URL mcp_shared_lib-0.1.1.tar.gz
Size 47.7 kB
Tags Source
SHA-256 checksum
How to use checksums
772778ecd44cb8908bcac32b28ecf3399b2d6751bef3cae9c600b435fc6df346
BLAKE2b-256 checksum
How to use checksums
35de38478a512b6696f95093597deaef50ebdd91239924c4ddfa09814dfb8fd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.10 Darwin/23.4.0

Release files / mcp_shared_lib-0.1.1-py3-none-any.whl

Download URL mcp_shared_lib-0.1.1-py3-none-any.whl
Size 65.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee431aa55601e5adb8194e0301921be2172c969de686dc1e786fb3ec7bec05d0
BLAKE2b-256 checksum
How to use checksums
e4039a40a2f5ab4a82d26409c639b0e665dac68d0012081f81274a17ae32c3a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.10 Darwin/23.4.0

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page