Skip to main content

Shared library for MCP components providing common utilities, models, and tools

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_shared_lib-0.1.1.tar.gz (47.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_shared_lib-0.1.1-py3-none-any.whl (65.3 kB view details)

Uploaded Python 3

File details

Details for the file mcp_shared_lib-0.1.1.tar.gz.

File metadata

  • Download URL: mcp_shared_lib-0.1.1.tar.gz
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.10 Darwin/23.4.0

File hashes

Hashes for mcp_shared_lib-0.1.1.tar.gz
Algorithm Hash digest
SHA256 772778ecd44cb8908bcac32b28ecf3399b2d6751bef3cae9c600b435fc6df346
MD5 9fe7c55dfd2b8478b83a92ef391fa99a
BLAKE2b-256 35de38478a512b6696f95093597deaef50ebdd91239924c4ddfa09814dfb8fd4

See more details on using hashes here.

File details

Details for the file mcp_shared_lib-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mcp_shared_lib-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 65.3 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

Hashes for mcp_shared_lib-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee431aa55601e5adb8194e0301921be2172c969de686dc1e786fb3ec7bec05d0
MD5 278f3ee34073d51f6af63260da61c85a
BLAKE2b-256 e4039a40a2f5ab4a82d26409c639b0e665dac68d0012081f81274a17ae32c3a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page