MCP Server
Give AI agents durable task execution through the Model Context Protocol.
Overview
The Model Context Protocol (MCP) is a standard for connecting AI agents to external tools. Tasked implements MCP over stdio using JSON-RPC 2.0 with Content-Length framing (LSP-style).
This lets agents submit long-running DAG workflows, continue working on other tasks, and check back for results later. The agent never blocks waiting for a shell command to finish — Tasked handles execution, retries, and dependency resolution in the background.
Starting the MCP Server
tasked-server mcp --data-dir tasked-data
The server reads JSON-RPC messages from stdin and writes responses to stdout. Logs go to stderr so they don't interfere with the protocol.
Claude Desktop
Add this to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"tasked": {
"command": "tasked-server",
"args": ["mcp", "--data-dir", "tasked-data"]
}
}
}
Claude Code
Add to your project's .mcp.json:
{
"mcpServers": {
"tasked": {
"command": "tasked-server",
"args": ["mcp", "--data-dir", "tasked-data"]
}
}
}
Tools Reference
Tasked exposes eight MCP tools. Each tool auto-creates queues as needed, so agents can submit workflows without any setup.
tasked_submit_flow
Submit a DAG workflow for execution. Tasks run concurrently where dependencies allow. Auto-creates the queue if it doesn't exist.
| Parameter | Type | Required | Description |
|---|---|---|---|
queue | string | yes | Queue name (created automatically if it doesn't exist) |
tasks | array | yes | Array of task definitions forming the DAG |
webhooks | object | no | Optional { on_complete, on_failure } URLs for flow-level webhook notifications |
queue_config | object | no | Queue configuration (only used when creating a new queue) |
Each task in the tasks array accepts:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Unique task identifier within the flow |
executor | string | yes | Executor type: shell, http, or noop |
config | object | no | Executor-specific configuration |
input | any | no | Optional input data for the task |
depends_on | string[] | no | Task IDs this task depends on |
timeout_secs | integer | no | Timeout in seconds (default: queue default) |
retries | integer | no | Max retry count (default: queue default) |
The optional queue_config object accepts:
| Field | Type | Default | Description |
|---|---|---|---|
concurrency | integer | 10 | Max concurrent tasks |
max_retries | integer | 3 | Default max retries |
timeout_secs | integer | 300 | Default task timeout in seconds |
Returns the flow ID, queue, state, and task count.
tasked_flow_status
Check the status of a submitted flow, including per-task state and outputs.
| Parameter | Type | Required | Description |
|---|---|---|---|
flow_id | string | yes | The flow ID returned by tasked_submit_flow |
Returns the flow state, task counts, and an array of per-task statuses with their outputs and errors.
tasked_task_output
Get the output or error of a specific task within a flow.
| Parameter | Type | Required | Description |
|---|---|---|---|
flow_id | string | yes | The flow ID |
task_id | string | yes | The task ID within the flow |
Returns the task state, output JSON, and error message (if any).
tasked_list_flows
List active and recent flows, optionally filtered by state.
| Parameter | Type | Required | Description |
|---|---|---|---|
queue | string | yes | Filter by queue name |
state | string | no | Filter by state: running, succeeded, failed, cancelled |
Returns the queue name, count, and an array of flow summaries.
tasked_cancel_flow
Cancel a running flow and all its non-terminal tasks.
| Parameter | Type | Required | Description |
|---|---|---|---|
flow_id | string | yes | The flow ID to cancel |
Returns a confirmation message on success.
tasked_create_schedule
Create a cron schedule that automatically submits a flow to a queue on a recurring basis.
| Parameter | Type | Required | Description |
|---|---|---|---|
queue | string | yes | Queue to submit flows to |
cron | string | yes | Cron expression (5-field or 7-field with seconds) |
flow | object | yes | FlowDef to submit on each trigger (same schema as tasked_submit_flow) |
Returns the schedule ID, queue, cron expression, and creation timestamp.
tasked_list_schedules
List all schedules for a queue.
| Parameter | Type | Required | Description |
|---|---|---|---|
queue | string | yes | Queue to list schedules for |
Returns an array of schedule summaries including ID, cron expression, and last/next fire times.
tasked_delete_schedule
Delete a schedule by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
schedule_id | string | yes | The schedule ID to delete |
Returns a confirmation message on success.
Integration Examples
Agent workflow
A typical agent interaction with Tasked follows this pattern: submit a flow, continue working, then check back for results.
// 1. Agent submits a workflow
tasked_submit_flow({
"queue": "agent-tasks",
"tasks": [
{
"id": "fetch-data",
"executor": "http",
"config": {
"url": "https://api.example.com/data",
"method": "GET"
}
},
{
"id": "process",
"executor": "shell",
"config": { "command": "python3 process.py" },
"depends_on": ["fetch-data"]
}
]
})
// Returns: { "flow_id": "f_abc123", "state": "running", ... }
// 2. Agent checks status later
tasked_flow_status({ "flow_id": "f_abc123" })
// Returns: { "state": "succeeded", "tasks": [...] }
// 3. Agent retrieves specific task output
tasked_task_output({
"flow_id": "f_abc123",
"task_id": "process"
})
// Returns: { "state": "succeeded", "output": {...} }