Celery MCP
A Python library that provides a connector to use Celery distributed task queues over the Model Context Protocol (MCP).
Features
- Seamless integration of Celery with MCP
- Easy-to-use API for task management
- Support for asynchronous task execution
- MCP server with tools for LLM interaction
- Comprehensive documentation and examples
Installation
Install from PyPI:
pip install celery-mcp
Or install from source:
git clone https://github.com/yourusername/celery-mcp.git
cd celery-mcp
pip install -e .
Quick Start
Using the Python API
from celery_mcp import CeleryMCP
# Initialize the connector
mcp = CeleryMCP(broker_url='redis://localhost:6379/0')
# Send a task
result = mcp.send_task('my_app.add', args=[4, 4])
print(result.get()) # 8
Using the MCP Server
The package includes an MCP server that exposes Celery functionality as tools that can be used by LLMs:
# Start the MCP server
celery-mcp-server
Available MCP Tools
- initialize_celery_connection - Initialize connection to Celery broker
- list_registered_tasks - List all registered task names
- send_task - Send a task to the Celery queue
- get_task_status - Get the status of a Celery task
- get_active_tasks - Get information about active (running) tasks
- get_scheduled_tasks - Get information about scheduled tasks
- revoke_task - Revoke (cancel) a task
- get_worker_stats - Get statistics about Celery workers
MCP Client Configuration
To use the MCP server with Claude Desktop, add this to your claude_desktop_config.json:
{
"mcpServers": {
"celery-mcp": {
"command": "celery-mcp-server"
}
}
}
Documentation
Full documentation is available at https://celery-mcp.readthedocs.io/.
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you have any questions or issues, please open an issue on GitHub.
