A Model Context Protocol (MCP) server for managing and orchestrating LLM agents as task runners.
# Install globally
npm install -g taskdriver-mcp
# Or use directly with npx/bunx
npx taskdriver-mcp --help
bunx taskdriver-mcp --help# Create a new project
npx taskdriver-mcp create-project "my-project" "My first project"
# List projects
npx taskdriver-mcp list-projects
# Get project details
npx taskdriver-mcp get-project "my-project"
# Create a task type template
npx taskdriver-mcp create-task-type "my-project" "analysis"
# Create tasks
npx taskdriver-mcp create-task "my-project"
# Get next task for an agent
npx taskdriver-mcp get-next-task "my-project" "my-agent"
# Complete a task
npx taskdriver-mcp complete-task "my-agent" "my-project" "task-id" "Task completed"Run TaskDriver as an MCP server for stdio transport:
npx taskdriver-mcp mcpRun TaskDriver as an HTTP REST API server:
npx taskdriver-mcp server- Multi-Mode Deployment: MCP server (stdio), HTTP REST API, and CLI interface
- Project-Based Organization: Isolate tasks, agents, and configurations by project
- Template-Based Task Types: Create reusable task templates with variable substitution
- Atomic Task Assignment: Race-condition-free task distribution to agents
- Lease Management: Automatic cleanup of expired tasks and failed agents
- Multiple Storage Backends: File, MongoDB, and Redis storage providers
- Comprehensive Monitoring: Health checks, metrics, and detailed project statistics
- Batch Processing: Group related tasks and track batch completion
- Retry Logic: Configurable retry policies for failed tasks
Perfect for integration with LLM frameworks that support the Model Context Protocol:
bun run mcpThe MCP server provides 19 tools for complete task management:
- Project management (create, list, update, delete)
- Task lifecycle (create, assign, complete, fail)
- Agent operations (register, status)
- Monitoring (status, metrics, health)
For web applications and services:
bun run httpAccess the API at http://localhost:3000 with full REST endpoints for all operations.
For direct command-line usage and automation:
taskdriver --helpProjects provide isolated environments for tasks and agents:
# Create a project
taskdriver create-project "ai-analysis" "AI-powered code analysis project" \\
--instructions "@project-instructions.md" \\
--max-retries 3 \\
--lease-duration 15
# List projects
taskdriver list-projects
# Get project details
taskdriver get-project "ai-analysis"Task types are templates for creating similar tasks:
# Create a task type with template
taskdriver create-task-type "ai-analysis" "code-review" \\
--template "@review-template.md" \\
--variables "repository_url" "branch_name" "focus_area"
# List task types
taskdriver list-task-types "ai-analysis"Tasks are specific work items executed by agents:
# Create a task
taskdriver create-task "ai-analysis" "task-type-id" "Review security vulnerabilities" \\
--variables '{"repository_url": "https://github.com/user/repo", "focus_area": "security"}'
# List tasks
taskdriver list-tasks "ai-analysis" --status queued
# Get task details
taskdriver get-task "task-id"Agents are workers that execute tasks:
# Register an agent
taskdriver register-agent "ai-analysis" "security-agent"
# Get next task for agent
taskdriver get-next-task "security-agent" "ai-analysis"
# Complete a task
taskdriver complete-task "security-agent" "ai-analysis" "task-id" \\
--result '{"status": "completed", "findings": ["vulnerability1", "vulnerability2"]}'Both descriptions and templates support reading from files using the @ prefix:
# Project description from file
taskdriver create-project "my-project" "@project-description.txt"
# Project instructions from file
taskdriver create-project "my-project" "Short description" --instructions "@instructions.md"
# Task template from file
taskdriver create-task-type "my-project" "analysis" --template "@analysis-template.md"# Server Configuration
TASKDRIVER_HOST=localhost # Server host (default: localhost)
TASKDRIVER_PORT=3000 # Server port (default: 3000)
TASKDRIVER_MODE=auto # Server mode: auto, mcp, http, cli
# Storage Provider
TASKDRIVER_STORAGE_PROVIDER=file # Storage provider: file, mongodb, redis
TASKDRIVER_STORAGE_CONNECTION_STRING= # Connection string for mongodb/redisTASKDRIVER_FILE_DATA_DIR=./data # Data directory for file storage
TASKDRIVER_FILE_LOCK_TIMEOUT=30000 # File lock timeout in millisecondsTASKDRIVER_MONGODB_DATABASE=taskdriver # MongoDB database name
TASKDRIVER_MONGODB_OPTIONS={} # MongoDB connection options (JSON)TASKDRIVER_REDIS_DATABASE=0 # Redis database number
TASKDRIVER_REDIS_KEY_PREFIX=taskdriver: # Redis key prefix
TASKDRIVER_REDIS_OPTIONS={} # Redis connection options (JSON)TASKDRIVER_LOG_LEVEL=info # Log level: debug, info, warn, error
TASKDRIVER_LOG_PRETTY=false # Pretty print logs (true/false)
TASKDRIVER_LOG_CORRELATION=true # Enable correlation IDs (true/false)TASKDRIVER_ENABLE_AUTH=true # Enable authentication (true/false)
TASKDRIVER_API_KEY_LENGTH=32 # API key length in characters
TASKDRIVER_SESSION_TIMEOUT=3600 # Session timeout in secondsTASKDRIVER_DEFAULT_MAX_RETRIES=3 # Default maximum retries for tasks
TASKDRIVER_DEFAULT_LEASE_DURATION=10 # Default lease duration in minutes
TASKDRIVER_REAPER_INTERVAL=1 # Reaper interval in minutesTASKDRIVER_STORAGE_PROVIDER=file
TASKDRIVER_FILE_DATA_DIR=./dataTASKDRIVER_STORAGE_PROVIDER=mongodb
TASKDRIVER_MONGODB_URI=mongodb://localhost:27017/taskdriverTASKDRIVER_STORAGE_PROVIDER=redis
TASKDRIVER_REDIS_URI=redis://localhost:6379Full REST API documentation available at /api/docs when running the HTTP server.
Key endpoints:
GET /api/projects- List projectsPOST /api/projects- Create projectGET /api/projects/:id- Get project detailsPOST /api/projects/:id/tasks- Create taskGET /api/projects/:id/tasks- List tasksPOST /api/agents/:name/tasks/assign- Assign task to agent
When running as an MCP server, 19 tools are available:
Project Management:
create_project- Create new projectlist_projects- List all projectsget_project- Get project detailsupdate_project- Update project properties
Task Management:
create_task_type- Create task templatelist_task_types- List task typescreate_task- Create new tasklist_tasks- List tasks with filteringget_task- Get task details
Agent Operations:
register_agent- Register new agentlist_agents- List agentsassign_task- Assign task to agentcomplete_task- Mark task as completedfail_task- Mark task as failed
Monitoring:
get_project_stats- Get project statisticshealth_check- System health checkget_lease_stats- Get lease statisticsextend_task_lease- Extend task leasecleanup_expired_leases- Clean up expired tasks
# Check system health
taskdriver health-check
# Get project statistics
taskdriver get-project-stats "my-project"
# Clean up expired leases
taskdriver cleanup-leases "my-project"When running the HTTP server, Prometheus metrics are available at /metrics.
# Run all tests
bun test
# Run specific test suites
bun test test/services/
bun test test/storage/
bun test test/integration/
# Run with coverage
bun test --coverage
# E2E testing
./test/e2e/run-all-tests.sh# Development mode with hot reload
bun run dev
# Build TypeScript
bun run build
# Clean build artifacts
bun run cleanSee the docs/examples/ directory for complete usage examples:
- CLI Reference - Complete CLI command documentation
- MCP Tools Reference - MCP server tool documentation
- HTTP API Reference - REST API documentation
- Configuration Guide - Detailed configuration options
- Deployment Guide - Production deployment instructions
- Architecture Overview - Technical architecture details
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.