Metadata-Version: 2.4
Name: mcp-server-propel
Version: 0.1.0
Summary: MCP server for Propel code review API - submit git diffs for AI-powered code review
Author-email: Propel <support@propelcode.ai>
License: MIT
Project-URL: Homepage, https://propelcode.ai
Project-URL: Repository, https://github.com/propel/mcp-server-propel
Project-URL: Documentation, https://docs.propelcode.ai
Keywords: mcp,code-review,propel,mcp-server,git,diff
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp>=1.0.0
Requires-Dist: httpx>=0.24.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Dynamic: license-file

# MCP Server for Propel

Submit git diffs for AI-powered code review directly from Claude using the [Propel](https://propelcode.ai) code review platform.

## Features

- Submit git diffs for async code review
- Automatically polls for results (reviews take 5-10 minutes)
- Retrieve detailed review comments with file paths, line numbers, and severity
- Quick status checks for in-progress reviews

## Installation

```bash
pip install mcp-server-propel
```

## Setup

1. Get your Propel API token from [propelcode.ai/settings/api](https://propelcode.ai/settings/api)
   - Your token needs `reviews:write` scope (which also grants `reviews:read`)

2. Add to your Claude Desktop config:

**MacOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "propel": {
      "command": "mcp-server-propel",
      "env": {
        "PROPEL_API_TOKEN": "your-api-token-here"
      }
    }
  }
}
```

3. Restart Claude Desktop

## Tools

### submit_review

Submit a git diff for code review. Returns immediately with a review ID, then instructs Claude to call `get_review` to poll for results.

**Parameters:**
- `diff` (required): Unified git diff output
- `repository` (required): Repository identifier (name, full name, or URL)
- `base_commit` (optional): Base commit SHA for additional context

### get_review

Get review results. Polls the API automatically every 12 seconds until the review completes or fails (~12 min max).

**Parameters:**
- `review_id` (required): The review job identifier

### check_review_status

Quick, non-polling status check. Returns only status and timing info without waiting.

**Parameters:**
- `review_id` (required): The review job identifier

## Usage Examples

**Submit a diff for review:**
```
Review this diff on Propel for repository myorg/myrepo:
<paste git diff output>
```

**Check review status:**
```
Check the status of Propel review abc-123
```

**Get full review results:**
```
Get the results of Propel review abc-123
```

## Getting a Git Diff

```bash
# Uncommitted changes
git diff

# Between branches
git diff main..feature-branch

# Last commit
git diff HEAD~1 HEAD

# Staged changes
git diff --cached
```

## Local Development

```bash
# Install in development mode
cd mcp-server-propel
pip install -e ".[dev]"

# Run tests
pytest -v

# Test against local Propel API
export PROPEL_API_TOKEN="your-token"
export PROPEL_API_URL="http://localhost:6060"
mcp-server-propel
```

For testing with MCP Inspector:
```bash
mcp dev src/mcp_server_propel/server.py
```

For local Propel API, add to Claude Desktop config:
```json
{
  "mcpServers": {
    "propel": {
      "command": "mcp-server-propel",
      "env": {
        "PROPEL_API_TOKEN": "your-token",
        "PROPEL_API_URL": "http://localhost:6060"
      }
    }
  }
}
```

## Troubleshooting

**"PROPEL_API_TOKEN environment variable is required"**
- Add the token to your Claude Desktop config `env` section
- Restart Claude Desktop after updating the config

**"Invalid authorization token" / "Authorization token has expired"**
- Generate a new token at [propelcode.ai/settings/api](https://propelcode.ai/settings/api)
- Ensure it has `reviews:write` scope

**"Diff too large"**
- Your diff exceeds the 1 MB size limit
- Try reviewing a smaller changeset (fewer files or commits)

**"Repository not found"**
- The repository must be connected to your Propel workspace
- Check the repository name matches what's configured in Propel

## Support

- Documentation: https://docs.propelcode.ai
- Issues: https://github.com/propel/mcp-server-propel/issues
