Metadata-Version: 2.4
Name: randonneuring-connect-mcp
Version: 3.1.0
Summary: Connect AI assistants to randonneuring cycling data - Explore Audax India events and worldwide LRM results with 8 intelligent tools
Author-email: Prathap Pandian <mprathappandian@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/mprathappandian/randonneuring-platform
Project-URL: Repository, https://github.com/mprathappandian/randonneuring-platform
Project-URL: Issues, https://github.com/mprathappandian/randonneuring-platform/issues
Project-URL: Documentation, https://github.com/mprathappandian/randonneuring-platform/tree/main/packages/mcp-server#readme
Project-URL: Changelog, https://github.com/mprathappandian/randonneuring-platform/blob/main/packages/mcp-server/CHANGELOG.md
Keywords: mcp,randonneuring,cycling,audax,model-context-protocol,ai,lrm
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp>=1.0.0
Requires-Dist: randonneuring-intelligence>=1.0.1
Provides-Extra: http
Requires-Dist: starlette; extra == "http"
Requires-Dist: uvicorn[standard]; extra == "http"
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Dynamic: license-file

# Randonneuring Connect MCP Server

[![PyPI version](https://badge.fury.io/py/randonneuring-connect-mcp.svg)](https://badge.fury.io/py/randonneuring-connect-mcp)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**Connect AI assistants to randonneuring cycling event data**

An MCP server that lets AI agents explore randonneuring (ultra-distance cycling) events through natural language. Provides **8 intelligent tools** for analyzing Audax India events and worldwide LRM results.

## What is This?

This MCP server lets AI agents analyze randonneuring (long-distance cycling) event data through natural language. It consolidates 60+ individual functions into 8 powerful tools:

- **3 Audax India tools** - Query events, participants, and statistics
- **3 LRM tools** - Query worldwide Long Randonnée Medal results
- **2 utility tools** - List available values and merge datasets

Ask questions like:
- "Who has completed the most events in Audax India?"
- "Show me all 1200km events in Maharashtra last year"
- "What's the completion rate for Paris-Brest-Paris?"
- "Which clubs have the most finishers?"

The AI uses the appropriate tools to answer your questions.

## Quick Start

### Installation

```bash
pip install randonneuring-connect-mcp
```

### Configure in Kiro

Add to your Kiro MCP config (`C:\Users\<username>\.kiro\settings\mcp.json` on Windows):

```json
{
  "mcpServers": {
    "randonneuring-connect": {
      "command": "randonneuring-connect"
    }
  }
}
```

### Configure in Claude Desktop

Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (Mac) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

```json
{
  "mcpServers": {
    "randonneuring-connect": {
      "command": "randonneuring-connect"
    }
  }
}
```

### Restart Your AI Client

Restart Kiro or Claude Desktop to load the server.

## Features

### 8 Consolidated Intelligent Tools

**Audax India Tools:**
1. `audax_query_events` - Query events with flexible filters (year, club, location, state, distance, status, type)
2. `audax_query_participants` - Query participants with filters (name, club, result, medal, fee)
3. `audax_get_statistics` - Get statistics and aggregations with 26 stat_types including:
   - Event, club, participant, state statistics
   - Completion rates by distance/club/year/state
   - Financial analysis (revenue, fees, outstanding payments)
   - Medal analysis (distribution, rates, top winners)
   - **NEW: Leaderboards** (top participants, top clubs, participant history, distance finishers)
   - Trends and DNS/DNF analysis
4. `audax_list_values` - List available clubs, locations, states, distances, event types

**LRM (Long Randonnée Medal) Tools:**
5. `lrm_query_results` - Query worldwide results (year, rider, event, club filters)
6. `lrm_get_statistics` - Get statistics with 4 stat_types:
   - Rider, club, event statistics
   - **NEW: Top riders leaderboard**
7. `lrm_list_values` - List available riders and clubs

**Cross-Dataset Tools:**
8. `merge_and_analyze` - Combine Audax India and LRM data for comparative analysis

## Example Queries

```
"Show me all 600km BRM events in Karnataka in 2023"
→ AI chains: audax_filter_by_year + audax_filter_by_distance + audax_filter_by_state

"What are the completion rates for different distances?"
→ AI calls: audax_get_completion_rates

"Show me John Smith's LRM statistics"
→ AI calls: lrm_get_rider_stats

"Which clubs have organized the most events?"
→ AI calls: audax_get_club_statistics
```

## Data

The package includes bundled data files (~23 MB):
- LRM worldwide results
- Audax India event catalog with participant details

Data is loaded once at startup for fast query performance.

## Requirements

- Python 3.10 or higher
- Works with any MCP-compatible AI client:
  - [Kiro](https://kiro.ai)
  - [Claude Desktop](https://claude.ai/download)
  - Custom MCP clients

## Architecture

```
AI Agent (Kiro/Claude)
       ↓
MCP Protocol (STDIO)
       ↓
This MCP Server
       ↓
randonneuring-intelligence (business logic)
       ↓
Bundled JSON Data Files
```

## Development

### Install from Source

```bash
git clone https://github.com/mprathappandian/randonneuring-platform.git
cd randonneuring-platform/packages/mcp-server
pip install -e .
```

### Run Tests

```bash
pip install -e ".[dev]"
pytest
```

## Advanced Configuration

### Custom Data Directory

Set environment variable to use your own data files:

```json
{
  "mcpServers": {
    "randonneuring-connect": {
      "command": "randonneuring-connect",
      "env": {
        "RANDONNEURING_DATA_DIR": "/path/to/your/data"
      }
    }
  }
}
```

### Debug Logging

```json
{
  "mcpServers": {
    "randonneuring-connect": {
      "command": "randonneuring-connect",
      "env": {
        "LOG_LEVEL": "DEBUG"
      }
    }
  }
}
```

## Troubleshooting

### Server Won't Start

1. Check Python version: `python --version` (must be 3.10+)
2. Verify installation: `pip show randonneuring-connect-mcp`
3. Test manually: `randonneuring-connect` (should show startup logs)

### Tools Not Working

1. Check logs in your AI client's console
2. Enable debug logging (see Advanced Configuration)
3. Verify data files loaded (check startup logs)

### Import Errors

Ensure `randonneuring-intelligence` is installed:
```bash
pip install randonneuring-intelligence
```

## Project Links

- **PyPI**: https://pypi.org/project/randonneuring-connect-mcp/
- **GitHub**: https://github.com/mprathappandian/randonneuring-platform
- **Issues**: https://github.com/mprathappandian/randonneuring-platform/issues
- **MCP Package**: packages/mcp-server/

## License

MIT License - see [LICENSE](LICENSE) file for details.

## Author

**Prathap Pandian**
- Email: mprathappandian@gmail.com
- GitHub: [@mprathappandian](https://github.com/mprathappandian)

## Acknowledgments

Built with:
- [Model Context Protocol](https://modelcontextprotocol.io) by Anthropic
- [randonneuring-intelligence](https://pypi.org/project/randonneuring-intelligence/) - Core data processing library

## Version History

### 3.1.0 (2024-12-XX)
- **RENAMED**: Package renamed from randonneuring-intelligence-mcp to randonneuring-connect-mcp
- Display name changed to "Randonneuring Connect"
- Configured for Kiro plugin marketplace with public HTTP endpoint
- Updated CLI commands: `randonneuring-connect` and `randonneuring-connect-http`
- All functionality remains identical - only branding changes
- Deployment URL: https://randonneuring-connect-server.onrender.com

### 0.1.0 (2024-11-18)
- Initial release as randonneuring-intelligence-mcp
- 53 tools (21 LRM + 32 Audax India)
- Bundled data files
- Support for Kiro and Claude Desktop
