Skip to content
118 changes: 117 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,81 @@ utility-mcp-server/
### Current MCP Tools

1. **`generate_release_notes`**: Generates structured release notes from git commits and tags
- **Remote Repository Support**: Fetch commits from GitHub/GitLab via API (no local clone needed)
- **Local Repository Support**: Fallback to local git repositories via subprocess
- **AI Agent Integration**: Returns structured data for intelligent AI-driven categorization
- **Provider Pattern**: Extensible architecture for adding new git hosting services

### Release Notes Tool

The `generate_release_notes` tool automatically creates comprehensive release notes from git commits, categorizing changes into features, enhancements, bug fixes, and breaking changes. See [USE_CASES.md](USE_CASES.md) for detailed use cases and integration scenarios.
The `generate_release_notes` tool automatically creates comprehensive release notes from git commits. It supports both remote repositories (GitHub, GitLab) and local repositories, with optional AI agent integration for intelligent categorization.

#### Remote Repository Support

The tool can fetch commits directly from GitHub and GitLab repositories without requiring a local clone:

**GitHub:**
- Provide `repo_url` like `https://github.com/owner/repo`
- Optionally provide `github_token` (or set `GITHUB_TOKEN` environment variable)
- Uses PyGithub API to fetch commits and PR associations

**GitLab:**
- Provide `repo_url` like `https://gitlab.com/owner/repo`
- Optionally provide `gitlab_token` (or set `GITLAB_TOKEN` environment variable)
- Uses python-gitlab API to fetch commits and MR associations

**Local Repository (fallback):**
- Provide `repo_path` to a local git repository
- Uses git subprocess commands

#### AI Agent Integration

The tool returns structured commit data **with embedded AI instructions** for intelligent categorization:
- Returns raw commit list with hashes, messages, authors, dates, and PR/MR numbers
- **Includes `ai_instructions`** field with comprehensive guidance on categorization
- Instructions travel with data - ensures consistent categorization across all AI agents
- AI creates dynamic categories based on actual changes instead of predefined patterns
- Better context understanding than regex-based categorization

**Example response structure:**
```python
result = await generate_release_notes(
version="v1.0.0",
previous_version="v0.9.0",
repo_url="https://github.com/owner/repo"
)

# Returns:
{
"status": "success",
"data": {
"commits": [...],
"version": "v1.0.0",
...
},
"ai_instructions": {
"role": "release_notes_categorizer",
"task": "Analyze commits and create intelligent release notes",
"guidelines": [
"Create dynamic categories based on actual changes",
"Group related commits intelligently",
"Understand context beyond pattern matching",
...
],
"categorization_strategy": {...},
"suggested_sections": {...},
"output_format": {...}
}
}
```

**Why instructions are embedded:**
- ✅ Instructions version-controlled with tool
- ✅ Consistent categorization across all workflows
- ✅ Self-documenting - AI knows how to use the data
- ✅ No need to duplicate instructions in each workflow

See [USE_CASES.md](USE_CASES.md) for detailed use cases and integration scenarios.

## Installation

Expand Down Expand Up @@ -200,6 +271,51 @@ Once configured, you can use the `generate_release_notes` tool in your conversat

The tool will analyze git commits between the specified tags and generate structured release notes with categorized changes.

## Usage Examples

### Remote GitHub Repository

```python
# Using with AI agent integration
result = await generate_release_notes(
version="v1.0.0",
previous_version="v0.9.0",
repo_url="https://github.com/owner/repo",
github_token=os.getenv('GITHUB_TOKEN'), # Optional, but recommended
return_raw_data=True # Returns structured data for AI processing
)

# Standard formatted output
result = await generate_release_notes(
version="v1.0.0",
previous_version="v0.9.0",
repo_url="https://github.com/owner/repo",
github_token=os.getenv('GITHUB_TOKEN')
)
```

### Remote GitLab Repository

```python
result = await generate_release_notes(
version="v2.0.0",
previous_version="v1.5.0",
repo_url="https://gitlab.com/owner/repo",
gitlab_token=os.getenv('GITLAB_TOKEN') # Optional for public repos
)
```

### Local Repository

```python
# Existing behavior - still fully supported
result = await generate_release_notes(
version="v1.0.0",
previous_version="v0.9.0",
repo_path="/path/to/local/repo"
)
```

## Running as HTTP Server

For development, testing, or integration with other tools, you can run the MCP server as an HTTP service.
Expand Down
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ packages = ["utility_mcp_server"]

[project]
name = "utility-mcp-server"
version = "0.1.1"
description = "A utility Model Context Protocol (MCP) server"
version = "0.2.0"
description = "A utility Model Context Protocol (MCP) server with remote repository support"
readme = "README.md"
license = {text = "Apache-2.0"}
authors = [
{name = "Jitendra Yejare", email = "jyejare@redhat.com"}
]
keywords = ["mcp", "model-context-protocol", "release-notes", "fastmcp", "ai-tools"]
keywords = ["mcp", "model-context-protocol", "release-notes", "fastmcp", "ai-tools", "github", "gitlab"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
Expand All @@ -39,6 +39,9 @@ dependencies = [
"psycopg==3.2.3",
"itsdangerous==2.2.0",
"requests-oauthlib==2.0.0",
"PyGithub>=2.1.1",
"python-gitlab>=4.0.0",
"packaging>=23.0",
]

[project.optional-dependencies]
Expand Down
Loading