Challenge MCP
A Model Context Protocol (MCP) server for challenge management with authentication. This package provides a FastMCP server that enables AI assistants to interact with challenge management systems through a standardized protocol.
Features
- 🚀 FastMCP Server: Built on the Model Context Protocol for seamless AI integration
- 🔐 Authentication: Secure token-based authentication system
- 🏆 Challenge Management: Complete API for managing challenges, participants, and teams
- 📊 Real-time Data: Server-Sent Events (SSE) support for live updates
- 🔧 Easy Configuration: Environment-based configuration with sensible defaults
Installation
From PyPI (Recommended)
pip install challenge-mcp
From Source
git clone https://github.com/your-username/challenge-mcp.git
cd challenge-mcp
pip install -e .
Development Installation
git clone https://github.com/your-username/challenge-mcp.git
cd challenge-mcp
pip install -e ".[dev]"
Quick Start
1. Environment Setup
Create a .env file in your project directory:
API_BASE_URL=https://your-api-server.com
# Add other environment variables as needed
2. Start the Server
from challenge_mcp import mcp
# Configure if needed
mcp.host = "0.0.0.0"
mcp.port = 8050
# Start the server
mcp.run()
3. Health Check
Once the server is running, you can check its health:
curl http://localhost:8050/v1/mcp/health
API Endpoints
The server provides several MCP tools for challenge management:
Challenge Management
get_active_challenge_list- Fetch active challenges with filtering and paginationget_active_challenge_by_id- Get specific challenge detailsget_challenge_pool_list- Browse available challenge templatesget_challenge_pool_by_id- Get challenge template details
Participant Management
get_active_challenge_participants- List challenge participantsget_active_challenge_participant_workouts- Get participant workout data
Team Management
get_active_challenge_teams- List challenge teams
Statistics
get_active_challenge_stats- Get challenge statistics and analytics
Configuration
Environment Variables
| Variable | Description | Required | Default |
|---|---|---|---|
API_BASE_URL |
Base URL for the backend API | Yes | - |
Server Configuration
from challenge_mcp import mcp
# Configure server settings
mcp.host = "127.0.0.1"
mcp.port = 8080
mcp.timeout_keep_alive = 30
mcp.timeout_graceful_shutdown = 10
Authentication
The server uses token-based authentication. Tokens should be provided in the request context when calling MCP tools. The authentication is handled automatically by the AuthFastMCP class.
Development
Setting up Development Environment
# Clone the repository
git clone https://github.com/your-username/challenge-mcp.git
cd challenge-mcp
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev]"
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=challenge_mcp
# Run specific test file
pytest tests/test_server.py
Code Formatting
# Format code with black
black challenge_mcp/
# Sort imports with isort
isort challenge_mcp/
# Type checking with mypy
mypy challenge_mcp/
Docker Support
You can also run the server using Docker:
FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install .
EXPOSE 8050
CMD ["python", "-c", "from challenge_mcp import mcp; mcp.run()"]
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
Changelog
See CHANGELOG.md for a list of changes and version history.
Made with ❤️ by the Challenge MCP Team
Metadata
Release files for challenge-mcp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| challenge_mcp-0.1.1.tar.gz | 8.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| challenge_mcp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.8 kB
Release files / challenge_mcp-0.1.1.tar.gz
| Download URL | challenge_mcp-0.1.1.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5315bcc16026f5c942caf4b0d79c29f4cc88154fcb799b1026e06f074ee5cb0
|
|
BLAKE2b-256 checksum How to use checksums |
517dc6bffd6ea0b69ed88c004af343852c67581868dc87731df340ac35f1c257
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / challenge_mcp-0.1.1-py3-none-any.whl
| Download URL | challenge_mcp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06cd084477e5a97a5f88bb3ee99d7a4582063b2ed111f09d4bbbd6dd6037e320
|
|
BLAKE2b-256 checksum How to use checksums |
2dbbd4f3ce6d293fb1619c8b4b3c975d4e55a442c02910fd609a00d9b40f7b87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|