justynroberts/rundeck-mcp-server-production
If you are the rightful owner of rundeck-mcp-server-production and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A production-ready MCP server for the Rundeck automation platform, enabling management of projects, jobs, executions, and infrastructure directly from Claude Desktop or any MCP-enabled client.
Rundeck MCP Server
A production-ready MCP (Model Context Protocol) server for Rundeck automation platform. Manage projects, jobs, executions, and infrastructure directly from Claude Desktop or any MCP-enabled client.
๐ Having issues? Check the for solutions to common MCP protocol and configuration problems.
๐ Quick Start
Prerequisites
- Python 3.12+ installed
- Rundeck API Token (see Getting a Token)
- uv package manager (see Installing uv)
Installing uv
uv is a fast, modern Python package manager. Install it using one of these methods:
macOS/Linux
# Using curl
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or using Homebrew
brew install uv
Windows
# Using PowerShell
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Or using Scoop
scoop install uv
Verify Installation
uv --version
Installation
# Clone the repository
git clone https://github.com/yourusername/rundeck-mcp-server.git
cd rundeck-mcp-server
# Install with uv (creates virtual environment automatically)
uv sync
# Or install globally with uvx for direct use
uvx install rundeck-mcp-server
Configuration
Set your Rundeck environment variables:
export RUNDECK_URL="https://rundeck.example.com"
export RUNDECK_API_TOKEN="your-api-token-here"
export RUNDECK_API_VERSION="47" # Optional, defaults to 47
Running the Server
# Development mode (read-only)
uv run rundeck-mcp serve
# Production mode (with write operations)
uv run rundeck-mcp serve --enable-write-tools
# Or if installed globally with uvx
uvx rundeck-mcp-server serve --enable-write-tools
โจ Recent Improvements
MCP Protocol Compliance & Tool Restoration (Latest)
- Restored Full Tool Set: Fixed MCP protocol compatibility issues to restore all 30+ Rundeck tools
- uvx Configuration Fixed: Proper
uvx --from /path/to/project rundeck-mcp serve
pattern for development - Handler Signature Compatibility: Resolved "Invalid request parameters" errors with MCP library versions
- Complete Troubleshooting Guide: Added comprehensive troubleshooting documentation for MCP issues
- Multi-Server Support: Full support for multiple Rundeck environments via environment variables
Previous Improvements
- Fixed Parameter Validation Issue: Resolved "job retrieval functions aren't accepting the required project parameter properly"
- Dynamic Schema Generation: Automatic input schema generation from function signatures using Python
inspect
module - Enhanced Type Safety: Proper JSON schema types (string, integer, boolean) with required/optional parameter detection
- Better User Experience: Claude Desktop now shows proper parameter forms and validation errors
- Union Type Support: Handles
str | None
patterns for optional parameters with automatic descriptions
Tool Consolidation
- Simplified Interface: Reduced from 35 to 30 tools by consolidating related functions
job_import
: Single tool supporting both YAML and JSON formats (replaces 3 separate tools)job_control
: Unified enable/disable operations with operation parameter- Enhanced UUIDs: 16-digit alphanumeric job identifiers for better tracking
Variable Substitution
- Consistent Format: All job scripts now use
@option.VARIABLENAME@
format regardless of script type - Intelligent Extraction: Automatic variable detection from scripts with type inference
- Secure Defaults: Password options automatically get placeholder defaults
๐ฆ Deployment
Production Deployment
-
Environment Setup
# Create production environment file cat > .env.production << EOF RUNDECK_URL=https://your-rundeck.com RUNDECK_API_TOKEN=your-production-token RUNDECK_API_VERSION=47 EOF
-
Install Dependencies
# Install in production mode uv sync --no-dev
-
Run Server
# Start with production settings source .env.production uv run rundeck-mcp serve --enable-write-tools
Docker Deployment
FROM python:3.12-slim
# Install uv
RUN pip install uv
# Copy application
WORKDIR /app
COPY . .
# Install dependencies
RUN uv sync --no-dev
# Run server
CMD ["uv", "run", "rundeck-mcp", "serve", "--enable-write-tools"]
Systemd Service (Linux)
Create /etc/systemd/system/rundeck-mcp.service
:
[Unit]
Description=Rundeck MCP Server
After=network.target
[Service]
Type=simple
User=rundeck-mcp
WorkingDirectory=/opt/rundeck-mcp-server
Environment="RUNDECK_URL=https://your-rundeck.com"
Environment="RUNDECK_API_TOKEN=your-token"
ExecStart=/usr/local/bin/uv run rundeck-mcp serve --enable-write-tools
Restart=always
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl enable rundeck-mcp
sudo systemctl start rundeck-mcp
๐ง Claude Desktop Integration
Automatic Configuration
# Generate Claude Desktop configuration
uv run python tests/get_claude_config.py --write-tools
# Config will be saved to ~/Library/Application Support/Claude/claude_desktop_config.json
Manual Configuration
Edit ~/Library/Application Support/Claude/claude_desktop_config.json
:
Development Installation (from local project):
{
"mcpServers": {
"rundeck-mcp": {
"command": "uvx",
"args": ["--from", "/path/to/rundeck-mcp-server-production", "rundeck-mcp", "serve", "--enable-write-tools"],
"env": {
"RUNDECK_URL": "https://your-rundeck.com",
"RUNDECK_API_TOKEN": "your-token-here"
}
}
}
}
Global Installation (via PyPI):
{
"mcpServers": {
"rundeck-mcp": {
"command": "uvx",
"args": ["rundeck-mcp-server", "serve", "--enable-write-tools"],
"env": {
"RUNDECK_URL": "https://your-rundeck.com",
"RUNDECK_API_TOKEN": "your-token-here"
}
}
}
}
๐ Getting a Rundeck API Token
- Log into Rundeck - Navigate to your Rundeck server
- Access Profile - Click your username โ "Profile"
- API Tokens Section - Find the "User API Tokens" section
- Generate Token - Click "Generate New Token"
- Set Expiration - Choose expiration (or never)
- Copy & Save - Store the token securely
๐ ๏ธ Available Tools
Complete Tool Reference
The server provides 36 tools organized by category and access level:
Tool Name | Type | Category | Description |
---|---|---|---|
SYSTEM TOOLS | |||
list_servers | ๐ Read | System | List all configured Rundeck servers |
health_check_servers | ๐ Read | System | Check health status of all servers |
get_system_info | ๐ Read | System | Get Rundeck system information and version |
get_execution_mode | ๐ Read | System | Get current execution mode (active/passive) |
set_execution_mode | โ๏ธ Write | System | Set execution mode for maintenance |
PROJECT TOOLS | |||
get_projects | ๐ Read | Projects | List all projects in Rundeck |
get_project_stats | ๐ Read | Projects | Get project statistics and metrics |
create_project | โ๏ธ Write | Projects | Create new Rundeck project |
JOB TOOLS | |||
get_jobs | ๐ Read | Jobs | List jobs in a project with filtering |
get_job_definition | ๐ Read | Jobs | Get complete job definition and configuration |
analyze_job | ๐ Read | Jobs | Analyze job for risk and recommendations |
visualize_job | ๐ Read | Jobs | Generate job workflow visualization |
run_job | โ๏ธ Write | Jobs | Execute a job with parameters |
run_job_with_monitoring | โ๏ธ Write | Jobs | Execute job and monitor until completion |
create_job | โ๏ธ Write | Jobs | Create new job programmatically |
create_job_from_yaml | โ๏ธ Write | Jobs | Import job from YAML definition |
create_multiple_jobs_from_yaml | โ๏ธ Write | Jobs | Bulk import multiple jobs from YAML |
enable_job | โ๏ธ Write | Jobs | Enable a disabled job |
disable_job | โ๏ธ Write | Jobs | Disable an enabled job |
enable_job_schedule | โ๏ธ Write | Jobs | Enable job scheduling |
disable_job_schedule | โ๏ธ Write | Jobs | Disable job scheduling |
EXECUTION TOOLS | |||
get_executions | ๐ Read | Executions | List executions with filtering |
get_execution_status | ๐ Read | Executions | Get execution status and details |
get_execution_output | ๐ Read | Executions | Get execution output logs |
get_bulk_execution_status | ๐ Read | Executions | Get status for multiple executions |
abort_execution | โ๏ธ Write | Executions | Abort a running execution |
retry_execution | โ๏ธ Write | Executions | Retry a failed execution |
delete_execution | โ๏ธ Write | Executions | Delete execution history |
run_adhoc_command | โ๏ธ Write | Executions | Execute ad hoc commands on nodes |
NODE TOOLS | |||
get_nodes | ๐ Read | Nodes | List nodes with filtering |
get_node_details | ๐ Read | Nodes | Get detailed node information |
get_node_summary | ๐ Read | Nodes | Get node statistics summary |
ANALYTICS TOOLS | |||
get_execution_metrics | ๐ Read | Analytics | Get execution metrics and trends |
calculate_job_roi | ๐ Read | Analytics | Calculate ROI for job automation |
get_all_executions | ๐ Read | Analytics | Get all executions with pagination |
Tool Categories Summary
Category | Read Tools | Write Tools | Total |
---|---|---|---|
System | 4 | 1 | 5 |
Projects | 2 | 1 | 3 |
Jobs | 4 | 10 | 14 |
Executions | 4 | 4 | 8 |
Nodes | 3 | 0 | 3 |
Analytics | 3 | 0 | 3 |
Total | 20 | 16 | 36 |
Access Control
- ๐ Read Tools (20): Always available, safe for production use
- โ๏ธ Write Tools (16): Require
--enable-write-tools
flag, can modify Rundeck state
๐ Usage Examples
Basic Commands
# Check server status
uv run rundeck-mcp check
# List available tools
uv run rundeck-mcp serve --help
# Run with debug logging
LOG_LEVEL=DEBUG uv run rundeck-mcp serve
Multi-Server Setup
Configure multiple Rundeck instances:
# Primary server
export RUNDECK_URL="https://prod.rundeck.com"
export RUNDECK_API_TOKEN="prod-token"
export RUNDECK_NAME="production"
# Secondary server
export RUNDECK_URL_1="https://dev.rundeck.com"
export RUNDECK_API_TOKEN_1="dev-token"
export RUNDECK_NAME_1="development"
๐งช Testing
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov
# Test server connection
uv run python tests/test_server.py
# Debug job operations
uv run python tests/debug_jobs.py
๐ Troubleshooting
Common Issues
Connection Refused
# Check URL and network
curl -I $RUNDECK_URL/api/47/system/info
# Verify token
echo $RUNDECK_API_TOKEN
Permission Denied
- Ensure API token has required permissions
- Check if write tools are enabled for write operations
Module Not Found
# Reinstall dependencies
uv sync --refresh
Debug Mode
# Enable debug logging
LOG_LEVEL=DEBUG uv run rundeck-mcp serve
# Test specific tool
uv run python -c "from rundeck_mcp.tools.jobs import get_jobs; print(get_jobs('my-project'))"
๐ค Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting:
make check # Runs format, lint, type-check, and test
- Submit a pull request
๐ License
MIT License - see file for details.
๐ Links
๐ก Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Security: See for reporting vulnerabilities
Built with โค๏ธ for the Rundeck community. Ready for production use!