A MCP server for Yala Events API
Project description
Yala Events MCP Server
A Model Context Protocol (MCP) server that provides programmatic access to the yala.events API, enabling event management, user roles, permissions, and organizational features.
Overview
This MCP server wraps the yala.events API, providing a set of tools for managing events, organizations, user roles, permissions, and more. It's built using FastMCP and provides asynchronous API access with comprehensive error handling and logging.
Requirements
- Python >= 3.11
- MCP CLI >= 1.6.0
- HTTPX >= 0.28.1
Installation
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
Configuration
The server requires the following environment variables:
YALA_EVENTS_API_TOKEN: Your yala.events API authentication tokenBASE_URL: The base URL for the yala.events API
Create a .env file in the project root:
YALA_EVENTS_API_TOKEN=your_token_here
BASE_URL=https://api.yala.events
Available Tools
Events Management
list_events: List events with optional date filteringcreate_event: Create a new event with full detailsget_event_details: Get comprehensive information about a specific event
Organizations Management
get_organizations: List all organizationslist_public_organizations: Get SEO-optimized list of public organizations
Module Management
list_modules: List all modules with search capabilitycreate_module: Create a new moduleupdate_module: Modify an existing moduledelete_module: Remove a moduleget_module_histories: View module change history
Permissions Management
list_permissions: List all permissionscreate_permission: Create a new permissionupdate_permission: Modify existing permissionsdelete_permission: Remove a permissionget_permission_histories: Track permission changes
Role Management
list_roles: List all roles with user countscreate_role: Create a new role with permissionsupdate_role: Modify role details and permissionsdelete_role: Remove a roleget_role_histories: View role modification history
Favorites Management
list_favorites_events: View favorited eventscreate_favorite_event: Add an event to favoritesupdate_favorite_event: Modify favorite event detailsdelete_favorite_event: Remove an event from favoritesget_favorites_events_histories: Track favorites changes
Personal Access Tokens
list_personal_access_tokens: View all access tokenscreate_personal_access_token: Generate new access tokenupdate_personal_access_token: Modify token detailsdelete_personal_access_token: Revoke access tokenget_personal_access_token_histories: Track token changes
System Tools
get_app_version: Retrieve application version infohealth_check: Verify system health status
Usage Examples
List Events
events = await list_events(date="2024-04-07")
print(events)
Create New Event
event = await create_event(
title="Tech Conference 2024",
content="Annual technology conference",
date="2024-05-15T09:00:00Z",
organization_id=1,
type_id=1,
category_id=1,
format_id=1,
covers=["https://example.com/cover.jpg"],
is_private=False
)
print(event)
Manage Roles
# List all roles
roles = await list_roles()
# Create new role with permissions
role = await create_role(
name="Event Manager",
permissions_per_module=[
{"moduleId": 1, "permissionId": 1},
{"moduleId": 2, "permissionId": 2}
]
)
Error Handling
The server includes comprehensive error handling with detailed logging. All API requests include:
- Timeout handling (30-second default)
- HTTP status error handling
- Detailed error messages in logs
- Graceful error responses
Logging
The server uses Python's built-in logging module with INFO level by default. All API requests and responses are logged for debugging purposes.
Health Monitoring
Use the health_check tool to verify the system status:
status = await health_check()
print(status) # "Application is healthy"
Contributing
Contributions are welcome! Please ensure you:
- Write tests for new features
- Follow existing code style
- Update documentation as needed
- Add logging for new functionality
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yala_events-0.1.1.tar.gz.
File metadata
- Download URL: yala_events-0.1.1.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.29
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e81488be0c0689767284b420827e96e2c89a1e5624930b15c6710376f5aea276
|
|
| MD5 |
47ec81945ba648eb165b1a366f33c9ab
|
|
| BLAKE2b-256 |
03d0f9c06897636e6cc3a5595cd512d803bfc26ad258c8a1b171c5d402476082
|
File details
Details for the file yala_events-0.1.1-py3-none-any.whl.
File metadata
- Download URL: yala_events-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.29
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0fe49b0cb8d08426bd14a2d1e9849d6985ebf2450922c393e32c222b1b3d83e
|
|
| MD5 |
29b59c614fd929bdf97d595fbbeb8f77
|
|
| BLAKE2b-256 |
5a7a3c9d5a88af6f67ecfe1726f542e25196a28ab7b19b78bb3c5f1d0cd60a10
|